diff options
Diffstat (limited to 'tests/legacy/cgo_pthread_flag/cgo_pthread_flag_test.go')
-rw-r--r-- | tests/legacy/cgo_pthread_flag/cgo_pthread_flag_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/legacy/cgo_pthread_flag/cgo_pthread_flag_test.go b/tests/legacy/cgo_pthread_flag/cgo_pthread_flag_test.go new file mode 100644 index 00000000..cc440617 --- /dev/null +++ b/tests/legacy/cgo_pthread_flag/cgo_pthread_flag_test.go @@ -0,0 +1,12 @@ +package cgo_pthread_flag + +import "testing" + +// Checks that we can build and run pthread code without explicitly giving +// any flags to cgo. -pthread should be passed to the C compiler by default. +func TestCgoPthread(t *testing.T) { + x := int(callFFromGo()) + if x != 42 { + t.Errorf("got %d; want 42", x) + } +} |