blob: e1796d6f723751ef3b3c7d71ebff69ae0755102f [file] [log] [blame]
Russ Coxf9ca3b52011-03-07 10:37:42 -05001// Copyright 2011 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
7import "testing"
8
9// extern void BackIntoGo(void);
Russ Coxc3f43192012-03-06 23:27:30 -050010// void IntoC(void);
Russ Coxf9ca3b52011-03-07 10:37:42 -050011import "C"
12
13//export BackIntoGo
14func BackIntoGo() {
15 x := 1
16
17 for i := 0; i < 10000; i++ {
18 xvariadic(x)
19 if x != 1 {
20 panic("x is not 1?")
21 }
22 }
23}
24
25func xvariadic(x ...interface{}) {
26}
27
Russ Coxf9856382011-05-02 13:55:51 -040028func test1328(t *testing.T) {
Russ Coxf9ca3b52011-03-07 10:37:42 -050029 C.IntoC()
30}