introduce TDF_compare_debug, omit OBJ_TYPE_REF casts with it
[official-gcc.git] / libgo / misc / cgo / test / issue5603.go
blobab84339e1016f8e65f5185cf326f311b37d307ed
1 // Copyright 2013 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 package cgotest
7 /*
8 const long long issue5603exp = 0x12345678;
9 long long issue5603foo0() { return issue5603exp; }
10 long long issue5603foo1(void *p) { return issue5603exp; }
11 long long issue5603foo2(void *p, void *q) { return issue5603exp; }
12 long long issue5603foo3(void *p, void *q, void *r) { return issue5603exp; }
13 long long issue5603foo4(void *p, void *q, void *r, void *s) { return issue5603exp; }
15 import "C"
17 import "testing"
19 func test5603(t *testing.T) {
20 var x [5]int64
21 exp := int64(C.issue5603exp)
22 x[0] = int64(C.issue5603foo0())
23 x[1] = int64(C.issue5603foo1(nil))
24 x[2] = int64(C.issue5603foo2(nil, nil))
25 x[3] = int64(C.issue5603foo3(nil, nil, nil))
26 x[4] = int64(C.issue5603foo4(nil, nil, nil, nil))
27 for i, v := range x {
28 if v != exp {
29 t.Errorf("issue5603foo%d() returns %v, expected %v", i, v, exp)