summaryrefslogtreecommitdiff
path: root/test/hwasan/TestCases
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2018-09-04 23:26:08 +0000
committerKostya Serebryany <kcc@google.com>2018-09-04 23:26:08 +0000
commit2b4497d17092e2b369a43c04b3972f68f214168d (patch)
treeca425fdad6a02edc6288d85686e4400f3afbde2b /test/hwasan/TestCases
parent380632208bda2cf9900f48a1cbdca5b2b6805ca9 (diff)
downloadcompiler-rt-2b4497d17092e2b369a43c04b3972f68f214168d.tar.gz
[hwasan] add a unique id to a thread and add debug prints for thread creation/destruction
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341428 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/hwasan/TestCases')
-rw-r--r--test/hwasan/TestCases/many-threads-uaf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/hwasan/TestCases/many-threads-uaf.c b/test/hwasan/TestCases/many-threads-uaf.c
index 7ee35541e..4f58b3e35 100644
--- a/test/hwasan/TestCases/many-threads-uaf.c
+++ b/test/hwasan/TestCases/many-threads-uaf.c
@@ -1,4 +1,4 @@
-// RUN: %clang_hwasan %s -o %t && not %run %t 2>&1 | FileCheck %s
+// RUN: %clang_hwasan %s -o %t && not %env_hwasan_opts=verbose_threads=1 %run %t 2>&1 | FileCheck %s
// REQUIRES: stable-runtime
#include <pthread.h>
@@ -14,6 +14,13 @@ void *BoringThread(void *arg) {
return NULL;
}
+// CHECK: Creating : thread {{.*}} id: 0
+// CHECK: Creating : thread {{.*}} id: 1
+// CHECK: Destroying: thread {{.*}} id: 1
+// CHECK: Creating : thread {{.*}} id: 1100
+// CHECK: Destroying: thread {{.*}} id: 1100
+// CHECK: Creating : thread {{.*}} id: 1101
+
void *UAFThread(void *arg) {
char * volatile x = (char*)malloc(10);
fprintf(stderr, "ZZZ %p\n", x);