introduce TDF_compare_debug, omit OBJ_TYPE_REF casts with it
[official-gcc.git] / libgo / misc / cgo / test / issue20129.go
blobe69e0e16efa6ab583a33f53b5e7cc276eb282691
1 // Copyright 2017 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 int issue20129 = 0;
9 typedef void issue20129Void;
10 issue20129Void issue20129Foo() {
11 issue20129 = 1;
13 typedef issue20129Void issue20129Void2;
14 issue20129Void2 issue20129Bar() {
15 issue20129 = 2;
18 import "C"
19 import "testing"
21 func test20129(t *testing.T) {
22 if C.issue20129 != 0 {
23 t.Fatal("test is broken")
25 C.issue20129Foo()
26 if C.issue20129 != 1 {
27 t.Errorf("got %v but expected %v", C.issue20129, 1)
29 C.issue20129Bar()
30 if C.issue20129 != 2 {
31 t.Errorf("got %v but expected %v", C.issue20129, 2)