summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/lit_tests/SharedLibs/load_shared_lib-so.cc
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2013-04-08 17:46:34 +0000
committerAlexander Potapenko <glider@google.com>2013-04-08 17:46:34 +0000
commit32efd25b939432d1c5b365fbb0438c3644a546f1 (patch)
tree7e642832aae424df6bbcdee1564b02389f0e5e59 /compiler-rt/lib/tsan/lit_tests/SharedLibs/load_shared_lib-so.cc
parent6bec4f9af34ae25db26b791482f4aaaeddb7e887 (diff)
downloadbcm5719-llvm-32efd25b939432d1c5b365fbb0438c3644a546f1.tar.gz
bcm5719-llvm-32efd25b939432d1c5b365fbb0438c3644a546f1.zip
[libsymbolized] If we can't find an address in the list of shared libraries, try to reload it.
Add a regression test for the case where such behavior helps TSan: 1. race is reported in the main module 2. new shared library is loaded 3. race is reported in the shared library llvm-svn: 179032
Diffstat (limited to 'compiler-rt/lib/tsan/lit_tests/SharedLibs/load_shared_lib-so.cc')
-rw-r--r--compiler-rt/lib/tsan/lit_tests/SharedLibs/load_shared_lib-so.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/compiler-rt/lib/tsan/lit_tests/SharedLibs/load_shared_lib-so.cc b/compiler-rt/lib/tsan/lit_tests/SharedLibs/load_shared_lib-so.cc
new file mode 100644
index 00000000000..d05aa6a40d1
--- /dev/null
+++ b/compiler-rt/lib/tsan/lit_tests/SharedLibs/load_shared_lib-so.cc
@@ -0,0 +1,22 @@
+//===----------- load_shared_lib-so.cc --------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file is a part of ThreadSanitizer (TSan), a race detector.
+//
+//===----------------------------------------------------------------------===//
+
+#include <stddef.h>
+
+int GLOB_SHARED = 0;
+
+extern "C"
+void *write_from_so(void *unused) {
+ GLOB_SHARED++;
+ return NULL;
+}
OpenPOWER on IntegriCloud