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.
4
5package cgotest
6
7/*
8int issue20129 = 0;
9typedef void issue20129Void;
10issue20129Void issue20129Foo() {
11	issue20129 = 1;
12}
13typedef issue20129Void issue20129Void2;
14issue20129Void2 issue20129Bar() {
15	issue20129 = 2;
16}
17*/
18import "C"
19import "testing"
20
21func test20129(t *testing.T) {
22	if C.issue20129 != 0 {
23		t.Fatal("test is broken")
24	}
25	C.issue20129Foo()
26	if C.issue20129 != 1 {
27		t.Errorf("got %v but expected %v", C.issue20129, 1)
28	}
29	C.issue20129Bar()
30	if C.issue20129 != 2 {
31		t.Errorf("got %v but expected %v", C.issue20129, 2)
32	}
33}
34