[compiler-rt] r179281 - [ASan] test source-based init-order blacklisting added in r179280
Alexey Samsonov
samsonov at google.com
Thu Apr 11 06:21:42 PDT 2013
Author: samsonov
Date: Thu Apr 11 08:21:41 2013
New Revision: 179281
URL: http://llvm.org/viewvc/llvm-project?rev=179281&view=rev
Log:
[ASan] test source-based init-order blacklisting added in r179280
Added:
compiler-rt/trunk/lib/asan/lit_tests/Helpers/initialization-blacklist-extra2.cc
Modified:
compiler-rt/trunk/lib/asan/lit_tests/Helpers/initialization-blacklist.txt
compiler-rt/trunk/lib/asan/lit_tests/initialization-blacklist.cc
Added: compiler-rt/trunk/lib/asan/lit_tests/Helpers/initialization-blacklist-extra2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/Helpers/initialization-blacklist-extra2.cc?rev=179281&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/Helpers/initialization-blacklist-extra2.cc (added)
+++ compiler-rt/trunk/lib/asan/lit_tests/Helpers/initialization-blacklist-extra2.cc Thu Apr 11 08:21:41 2013
@@ -0,0 +1,4 @@
+int zero_init();
+int badSrcGlobal = zero_init();
+int readBadSrcGlobal() { return badSrcGlobal; }
+
Modified: compiler-rt/trunk/lib/asan/lit_tests/Helpers/initialization-blacklist.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/Helpers/initialization-blacklist.txt?rev=179281&r1=179280&r2=179281&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/Helpers/initialization-blacklist.txt (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/Helpers/initialization-blacklist.txt Thu Apr 11 08:21:41 2013
@@ -1,2 +1,3 @@
global-init:*badGlobal*
global-init-type:*badNamespace::BadClass*
+global-init-src:*initialization-blacklist-extra2.cc
Modified: compiler-rt/trunk/lib/asan/lit_tests/initialization-blacklist.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/initialization-blacklist.cc?rev=179281&r1=179280&r2=179281&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/initialization-blacklist.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/initialization-blacklist.cc Thu Apr 11 08:21:41 2013
@@ -1,26 +1,32 @@
// Test for blacklist functionality of initialization-order checker.
// RUN: %clangxx_asan -m64 -O0 %s %p/Helpers/initialization-blacklist-extra.cc\
+// RUN: %p/Helpers/initialization-blacklist-extra2.cc \
// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \
// RUN: -fsanitize=init-order -o %t
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
// RUN: %clangxx_asan -m64 -O1 %s %p/Helpers/initialization-blacklist-extra.cc\
+// RUN: %p/Helpers/initialization-blacklist-extra2.cc \
// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \
// RUN: -fsanitize=init-order -o %t
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
// RUN: %clangxx_asan -m64 -O2 %s %p/Helpers/initialization-blacklist-extra.cc\
+// RUN: %p/Helpers/initialization-blacklist-extra2.cc \
// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \
// RUN: -fsanitize=init-order -o %t
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
// RUN: %clangxx_asan -m32 -O0 %s %p/Helpers/initialization-blacklist-extra.cc\
+// RUN: %p/Helpers/initialization-blacklist-extra2.cc \
// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \
// RUN: -fsanitize=init-order -o %t
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
// RUN: %clangxx_asan -m32 -O1 %s %p/Helpers/initialization-blacklist-extra.cc\
+// RUN: %p/Helpers/initialization-blacklist-extra2.cc \
// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \
// RUN: -fsanitize=init-order -o %t
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
// RUN: %clangxx_asan -m32 -O2 %s %p/Helpers/initialization-blacklist-extra.cc\
+// RUN: %p/Helpers/initialization-blacklist-extra2.cc \
// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \
// RUN: -fsanitize=init-order -o %t
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
@@ -33,6 +39,9 @@ int x = readBadGlobal(); // init-order
int accessBadObject();
int y = accessBadObject(); // init-order bug.
+int readBadSrcGlobal();
+int z = readBadSrcGlobal(); // init-order bug.
+
int main(int argc, char **argv) {
- return argc + x + y - 1;
+ return argc + x + y + z - 1;
}
More information about the llvm-commits
mailing list