Changeset View
Changeset View
Standalone View
Standalone View
compiler-rt/lib/tsan/go/test.c
Show All 26 Lines | |||||
void __tsan_read(void *thr, void *addr, void *pc); | void __tsan_read(void *thr, void *addr, void *pc); | ||||
void __tsan_write(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_enter(void *thr, void *pc); | ||||
void __tsan_func_exit(void *thr); | void __tsan_func_exit(void *thr); | ||||
void __tsan_malloc(void *thr, void *pc, void *p, unsigned long sz); | void __tsan_malloc(void *thr, void *pc, void *p, unsigned long sz); | ||||
void __tsan_free(void *p, unsigned long sz); | void __tsan_free(void *p, unsigned long sz); | ||||
void __tsan_acquire(void *thr, void *addr); | void __tsan_acquire(void *thr, void *addr); | ||||
void __tsan_release(void *thr, void *addr); | void __tsan_release(void *thr, void *addr); | ||||
void __tsan_release_acquire(void *thr, void *addr); | |||||
void __tsan_release_merge(void *thr, void *addr); | void __tsan_release_merge(void *thr, void *addr); | ||||
void *current_proc; | void *current_proc; | ||||
void symbolize_cb(long cmd, void *ctx) { | void symbolize_cb(long cmd, void *ctx) { | ||||
switch (cmd) { | switch (cmd) { | ||||
case 0: | case 0: | ||||
if (current_proc == 0) | if (current_proc == 0) | ||||
Show All 29 Lines | int main(void) { | ||||
} | } | ||||
char *buf = (char*)((unsigned long)buf0 + (64<<10) - 1 & ~((64<<10) - 1)); | char *buf = (char*)((unsigned long)buf0 + (64<<10) - 1 & ~((64<<10) - 1)); | ||||
__tsan_map_shadow(buf, 4096); | __tsan_map_shadow(buf, 4096); | ||||
__tsan_malloc(thr0, (char*)&barfoo + 1, buf, 10); | __tsan_malloc(thr0, (char*)&barfoo + 1, buf, 10); | ||||
__tsan_free(buf, 10); | __tsan_free(buf, 10); | ||||
__tsan_func_enter(thr0, (char*)&main + 1); | __tsan_func_enter(thr0, (char*)&main + 1); | ||||
__tsan_malloc(thr0, (char*)&barfoo + 1, buf, 10); | __tsan_malloc(thr0, (char*)&barfoo + 1, buf, 10); | ||||
__tsan_release(thr0, buf); | __tsan_release(thr0, buf); | ||||
__tsan_release_acquire(thr0, buf); | |||||
__tsan_release_merge(thr0, buf); | __tsan_release_merge(thr0, buf); | ||||
void *thr1 = 0; | void *thr1 = 0; | ||||
__tsan_go_start(thr0, &thr1, (char*)&barfoo + 1); | __tsan_go_start(thr0, &thr1, (char*)&barfoo + 1); | ||||
void *thr2 = 0; | void *thr2 = 0; | ||||
__tsan_go_start(thr0, &thr2, (char*)&barfoo + 1); | __tsan_go_start(thr0, &thr2, (char*)&barfoo + 1); | ||||
__tsan_func_exit(thr0); | __tsan_func_exit(thr0); | ||||
__tsan_func_enter(thr1, (char*)&foobar + 1); | __tsan_func_enter(thr1, (char*)&foobar + 1); | ||||
__tsan_func_enter(thr1, (char*)&foobar + 1); | __tsan_func_enter(thr1, (char*)&foobar + 1); | ||||
Show All 18 Lines |