summaryrefslogtreecommitdiffstats
path: root/llgo/test/execution/unsafe/const_sizeof.go
blob: ade9d0bc22ba9aaf604cc25e0b7414602a124ea2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// RUN: llgo -o %t %s
// RUN: %t 2>&1 | FileCheck %s

// CHECK: 8
// CHECK-NEXT: 8

package main

import "unsafe"

const ptrSize = unsafe.Sizeof((*byte)(nil))

var x [ptrSize]int

func main() {
	println(ptrSize)
	println(len(x))
}
OpenPOWER on IntegriCloud