summaryrefslogtreecommitdiff
path: root/lib/tsan/lit_tests/oob_race.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tsan/lit_tests/oob_race.cc')
-rw-r--r--lib/tsan/lit_tests/oob_race.cc24
1 files changed, 0 insertions, 24 deletions
diff --git a/lib/tsan/lit_tests/oob_race.cc b/lib/tsan/lit_tests/oob_race.cc
deleted file mode 100644
index 9d8e2220d9a5b..0000000000000
--- a/lib/tsan/lit_tests/oob_race.cc
+++ /dev/null
@@ -1,24 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && not %t 2>&1 | FileCheck %s
-#include <pthread.h>
-#include <stdio.h>
-
-const long kOffset = 64*1024;
-
-void *Thread(void *p) {
- ((char*)p)[-kOffset] = 43;
- return 0;
-}
-
-int main() {
- char *volatile p0 = new char[16];
- delete[] p0;
- char *p = new char[32];
- pthread_t th;
- pthread_create(&th, 0, Thread, p);
- p[-kOffset] = 42;
- pthread_join(th, 0);
-}
-
-// Used to crash with CHECK failed.
-// CHECK: WARNING: ThreadSanitizer: data race
-