1 // Copyright 2016 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // Test a constant in conjunction with pointer checking.
12 #define CheckConstVal 0
18 static void CheckConstFunc(CheckConstStruct *p, int e) {
28 func testCheckConst(t
*testing
.T
) {
29 // The test is that this compiles successfully.
30 p
:= C
.malloc(C
.size_t(unsafe
.Sizeof(C
.int(0))))
32 C
.CheckConstFunc(&C
.CheckConstStruct
{(*C
.int)(p
)}, C
.CheckConstVal
)