Russ Cox | f9ca3b5 | 2011-03-07 10:37:42 -0500 | [diff] [blame] | 1 | // 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 | |
| 5 | package cgotest |
| 6 | |
| 7 | import "testing" |
| 8 | |
| 9 | // extern void BackIntoGo(void); |
Russ Cox | c3f4319 | 2012-03-06 23:27:30 -0500 | [diff] [blame] | 10 | // void IntoC(void); |
Russ Cox | f9ca3b5 | 2011-03-07 10:37:42 -0500 | [diff] [blame] | 11 | import "C" |
| 12 | |
| 13 | //export BackIntoGo |
| 14 | func 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 | |
| 25 | func xvariadic(x ...interface{}) { |
| 26 | } |
| 27 | |
Russ Cox | f985638 | 2011-05-02 13:55:51 -0400 | [diff] [blame] | 28 | func test1328(t *testing.T) { |
Russ Cox | f9ca3b5 | 2011-03-07 10:37:42 -0500 | [diff] [blame] | 29 | C.IntoC() |
| 30 | } |