github.com/llvm-mirror/llgo@v0.0.0-20190322182713-bf6f0a60fce1/test/execution/unsafe/const_sizeof.go (about)

     1  // RUN: llgo -o %t %s
     2  // RUN: %t 2>&1 | FileCheck %s
     3  
     4  // CHECK: 8
     5  // CHECK-NEXT: 8
     6  
     7  package main
     8  
     9  import "unsafe"
    10  
    11  const ptrSize = unsafe.Sizeof((*byte)(nil))
    12  
    13  var x [ptrSize]int
    14  
    15  func main() {
    16  	println(ptrSize)
    17  	println(len(x))
    18  }