summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/go/test.c
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2016-03-01 15:38:12 +0000
committerDmitry Vyukov <dvyukov@google.com>2016-03-01 15:38:12 +0000
commita029b79e1a71b46b3e8d0ace236a2d935643cf7b (patch)
tree2cbb858663092dd86810104b645d6e6ccafa198c /compiler-rt/lib/tsan/go/test.c
parentf5fcdd268f9253f32e6cefbc085bae6bee79f588 (diff)
downloadbcm5719-llvm-a029b79e1a71b46b3e8d0ace236a2d935643cf7b.tar.gz
bcm5719-llvm-a029b79e1a71b46b3e8d0ace236a2d935643cf7b.zip
tsan: describe heap/data locations in Go
llvm-svn: 262343
Diffstat (limited to 'compiler-rt/lib/tsan/go/test.c')
-rw-r--r--compiler-rt/lib/tsan/go/test.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/compiler-rt/lib/tsan/go/test.c b/compiler-rt/lib/tsan/go/test.c
index 94433f1b8c2..00199672b9b 100644
--- a/compiler-rt/lib/tsan/go/test.c
+++ b/compiler-rt/lib/tsan/go/test.c
@@ -13,7 +13,7 @@
#include <stdio.h>
-void __tsan_init(void **thr, void (*cb)(void*));
+void __tsan_init(void **thr, void (*cb)(long, void*));
void __tsan_fini();
void __tsan_map_shadow(void *addr, unsigned long size);
void __tsan_go_start(void *thr, void **chthr, void *pc);
@@ -22,12 +22,12 @@ void __tsan_read(void *thr, void *addr, void *pc);
void __tsan_write(void *thr, void *addr, void *pc);
void __tsan_func_enter(void *thr, void *pc);
void __tsan_func_exit(void *thr);
-void __tsan_malloc(void *p, unsigned long sz);
+void __tsan_malloc(void *thr, void *pc, void *p, unsigned long sz);
void __tsan_acquire(void *thr, void *addr);
void __tsan_release(void *thr, void *addr);
void __tsan_release_merge(void *thr, void *addr);
-void symbolize_cb(void *ctx) {}
+void symbolize_cb(long cmd, void *ctx) {}
char buf0[100<<10];
@@ -36,12 +36,13 @@ void barfoo() {}
int main(void) {
void *thr0 = 0;
- char *buf = (char*)((unsigned long)buf0 + (64<<10) - 1 & ~((64<<10) - 1));
- __tsan_malloc(buf, 10);
__tsan_init(&thr0, symbolize_cb);
+ char *buf = (char*)((unsigned long)buf0 + (64<<10) - 1 & ~((64<<10) - 1));
__tsan_map_shadow(buf, 4096);
+ __tsan_malloc(thr0, (char*)&barfoo + 1, buf, 10);
+ __tsan_free(thr0, buf, 10);
__tsan_func_enter(thr0, (char*)&main + 1);
- __tsan_malloc(buf, 10);
+ __tsan_malloc(thr0, (char*)&barfoo + 1, buf, 10);
__tsan_release(thr0, buf);
__tsan_release_merge(thr0, buf);
void *thr1 = 0;
OpenPOWER on IntegriCloud