summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/go/test.c
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2013-08-16 11:15:14 +0000
committerDmitry Vyukov <dvyukov@google.com>2013-08-16 11:15:14 +0000
commitf6ea6a5a19609f3482385522d27a2f95a89c4660 (patch)
tree978c3e44a4a1855f6a778785fe921fec0e42f28a /compiler-rt/lib/tsan/go/test.c
parent51cda144aeadf6a7352591ad614f8e77057f3001 (diff)
downloadbcm5719-llvm-f6ea6a5a19609f3482385522d27a2f95a89c4660.tar.gz
bcm5719-llvm-f6ea6a5a19609f3482385522d27a2f95a89c4660.zip
tsan: better report formatting for Go
Say that gorotuine 1 is main goroutine. Remove excessive new line. llvm-svn: 188542
Diffstat (limited to 'compiler-rt/lib/tsan/go/test.c')
-rw-r--r--compiler-rt/lib/tsan/go/test.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/compiler-rt/lib/tsan/go/test.c b/compiler-rt/lib/tsan/go/test.c
index 902dfc91558..859b35d348e 100644
--- a/compiler-rt/lib/tsan/go/test.c
+++ b/compiler-rt/lib/tsan/go/test.c
@@ -34,20 +34,32 @@ int __tsan_symbolize(void *pc, char **img, char **rtn, char **file, int *l) {
char buf[10];
+void foobar() {}
+void barfoo() {}
+
int main(void) {
void *thr0 = 0;
__tsan_init(&thr0);
__tsan_map_shadow(buf, sizeof(buf) + 4096);
- __tsan_func_enter(thr0, &main);
+ __tsan_func_enter(thr0, (char*)&main + 1);
__tsan_malloc(thr0, buf, 10, 0);
__tsan_release(thr0, buf);
__tsan_release_merge(thr0, buf);
void *thr1 = 0;
- __tsan_go_start(thr0, &thr1, 0);
- __tsan_write(thr1, buf, 0);
+ __tsan_go_start(thr0, &thr1, (char*)&barfoo + 1);
+ void *thr2 = 0;
+ __tsan_go_start(thr0, &thr2, (char*)&barfoo + 1);
+ __tsan_func_enter(thr1, (char*)&foobar + 1);
+ __tsan_func_enter(thr1, (char*)&foobar + 1);
+ __tsan_write(thr1, buf, (char*)&barfoo + 1);
__tsan_acquire(thr1, buf);
+ __tsan_func_exit(thr1);
+ __tsan_func_exit(thr1);
__tsan_go_end(thr1);
- __tsan_read(thr0, buf, 0);
+ __tsan_func_enter(thr2, (char*)&foobar + 1);
+ __tsan_read(thr2, buf, (char*)&barfoo + 1);
+ __tsan_func_exit(thr2);
+ __tsan_go_end(thr2);
__tsan_free(buf);
__tsan_func_exit(thr0);
__tsan_fini();
OpenPOWER on IntegriCloud