1 // Copyright 2012 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 // Issue 3729: cmd/cgo: access errno from void C function
6 // void f(void) returns [0]byte, error in Go world.
19 // try to pass some non-trivial arguments to function g2
20 const char _expA = 0x42;
21 const float _expB = 3.14159;
22 const short _expC = 0x55aa;
23 const int _expD = 0xdeadbeef;
24 void g2(int x, char a, float b, short c, int d) {
25 if (a == _expA && b == _expB && c == _expC && d == _expD)
38 func test3729(t *testing.T) {
40 if e != syscall.E2BIG {
41 t.Errorf("got %q, expect %q", e, syscall.E2BIG)
43 _, e = C.g2(C.EINVAL, C._expA, C._expB, C._expC, C._expD)
44 if e != syscall.EINVAL {
45 t.Errorf("got %q, expect %q", e, syscall.EINVAL)