* tree-vect-loop-manip.c (vect_do_peeling): Do not use
[official-gcc.git] / libgo / misc / cgo / test / checkconst.go
blob0160c1e0ced6c1ab27ce4f46d55c99e4b256f896
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.
7 package cgotest
9 /*
10 #include <stdlib.h>
12 #define CheckConstVal 0
14 typedef struct {
15 int *p;
16 } CheckConstStruct;
18 static void CheckConstFunc(CheckConstStruct *p, int e) {
21 import "C"
23 import (
24 "testing"
25 "unsafe"
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))))
31 defer C.free(p)
32 C.CheckConstFunc(&C.CheckConstStruct{(*C.int)(p)}, C.CheckConstVal)