diff options
author | Kuba Brecka <kuba.brecka@gmail.com> | 2016-03-21 16:05:42 +0000 |
---|---|---|
committer | Kuba Brecka <kuba.brecka@gmail.com> | 2016-03-21 16:05:42 +0000 |
commit | 2e084e7292c9c840954c287b46b836e7dde6550b (patch) | |
tree | 96cad05477212a524facca0da9ea85fe45e3cb42 | |
parent | 155dda9134c4f771ffc75864a6a0554309ec0531 (diff) | |
download | bcm5719-llvm-2e084e7292c9c840954c287b46b836e7dde6550b.tar.gz bcm5719-llvm-2e084e7292c9c840954c287b46b836e7dde6550b.zip |
[tsan] Adding a test case for r263939 ("Add some NULL pointer checks into the debugging API")
llvm-svn: 263946
-rw-r--r-- | compiler-rt/test/tsan/debugging.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/compiler-rt/test/tsan/debugging.cc b/compiler-rt/test/tsan/debugging.cc index cacdf69f8b5..08ba82c0df7 100644 --- a/compiler-rt/test/tsan/debugging.cc +++ b/compiler-rt/test/tsan/debugging.cc @@ -19,6 +19,10 @@ int __tsan_get_report_data(void *report, const char **description, int *count, int __tsan_get_report_mop(void *report, unsigned long idx, int *tid, void **addr, int *size, int *write, int *atomic, void **trace, unsigned long trace_size); +int __tsan_get_report_thread(void *report, unsigned long idx, int *tid, + unsigned long *pid, int *running, + const char **name, int *parent_tid, void **trace, + unsigned long trace_size); } long my_global; @@ -82,6 +86,22 @@ void __tsan_on_report(void *report) { // CHECK: tid = 0, addr = [[GLOBAL]], size = 8, write = 1, atomic = 0 fprintf(stderr, "trace[0] = %p, trace[1] = %p\n", trace[0], trace[1]); // CHECK: trace[0] = 0x{{[0-9a-f]+}}, trace[1] = {{0x0|\(nil\)|\(null\)}} + + fprintf(stderr, "thread_count = %d\n", thread_count); + // CHECK: thread_count = 2 + + unsigned long pid; + int running; + const char *name; + int parent_tid; + + __tsan_get_report_thread(report, 0, &tid, &pid, &running, &name, &parent_tid, trace, 16); + fprintf(stderr, "tid = %d\n", tid); + // CHECK: tid = 1 + + __tsan_get_report_thread(report, 1, &tid, &pid, &running, &name, &parent_tid, trace, 16); + fprintf(stderr, "tid = %d\n", tid); + // CHECK: tid = 0 } // CHECK: Done. |