xref: /aosp_15_r20/external/bazelbuild-rules_go/tests/legacy/cgo_pthread_flag/cgo_pthread_flag_test.go (revision 9bb1b549b6a84214c53be0924760be030e66b93a)
1package cgo_pthread_flag
2
3import "testing"
4
5// Checks that we can build and run pthread code without explicitly giving
6// any flags to cgo. -pthread should be passed to the C compiler by default.
7func TestCgoPthread(t *testing.T) {
8	x := int(callFFromGo())
9	if x != 42 {
10		t.Errorf("got %d; want 42", x)
11	}
12}
13