diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2014-11-06 22:49:13 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2014-11-06 22:49:13 +0000 |
commit | 8ef50bf3d1c287b5013c3168de77a462dfce3495 (patch) | |
tree | 3467f3372c1195b1546172d89af2205a50b1866d /lib/tsan/go/test.c | |
parent | 11023dc647fd8f41418da90d59db138400d0f334 (diff) |
Notes
Diffstat (limited to 'lib/tsan/go/test.c')
-rw-r--r-- | lib/tsan/go/test.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/tsan/go/test.c b/lib/tsan/go/test.c index 902dfc915582b..859b35d348e89 100644 --- a/lib/tsan/go/test.c +++ b/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(); |