1 // Copyright 2015 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.
7 // This program produced false race reports when run under the C/C++
8 // ThreadSanitizer, as it did not understand the synchronization in
12 #cgo CFLAGS: -fsanitize=thread
13 #cgo LDFLAGS: -fsanitize=thread
15 extern void GoRun(void);
17 // Yes, you can have definitions if you use //export, as long as they are weak.
19 int val __attribute__ ((weak));
21 int run(void) __attribute__ ((weak));
29 void setVal(int) __attribute__ ((weak));
41 runtime.LockOSThread()
44 runtime.LockOSThread()
52 if v := C.run(); v != 2 {