[llvm-commits] [compiler-rt] r173336 - in /compiler-rt/trunk/lib/asan/tests: asan_globals_test.cc asan_noinst_test.cc asan_test_utils.h
Kostya Serebryany
kcc at google.com
Thu Jan 24 02:36:12 PST 2013
Author: kcc
Date: Thu Jan 24 04:36:11 2013
New Revision: 173336
URL: http://llvm.org/viewvc/llvm-project?rev=173336&view=rev
Log:
[asan] run-time tests for adaptive redzones
Modified:
compiler-rt/trunk/lib/asan/tests/asan_globals_test.cc
compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc
compiler-rt/trunk/lib/asan/tests/asan_test_utils.h
Modified: compiler-rt/trunk/lib/asan/tests/asan_globals_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_globals_test.cc?rev=173336&r1=173335&r2=173336&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_globals_test.cc (original)
+++ compiler-rt/trunk/lib/asan/tests/asan_globals_test.cc Thu Jan 24 04:36:11 2013
@@ -30,6 +30,9 @@
char glob15[15];
char glob16[16];
char glob17[17];
+char glob1000[1000];
+char glob10000[10000];
+char glob100000[100000];
static char static10[10];
Modified: compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc?rev=173336&r1=173335&r2=173336&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc (original)
+++ compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc Thu Jan 24 04:36:11 2013
@@ -651,6 +651,9 @@
GOOD_ACCESS(glob15, 15 - 1);
GOOD_ACCESS(glob16, 16 - 1);
GOOD_ACCESS(glob17, 17 - 1);
+ GOOD_ACCESS(glob1000, 1000 - 1);
+ GOOD_ACCESS(glob10000, 10000 - 1);
+ GOOD_ACCESS(glob100000, 100000 - 1);
BAD_ACCESS(glob1, 1);
BAD_ACCESS(glob2, 2);
@@ -669,6 +672,12 @@
BAD_ACCESS(glob15, 15);
BAD_ACCESS(glob16, 16);
BAD_ACCESS(glob17, 17);
+ BAD_ACCESS(glob1000, 1000);
+ BAD_ACCESS(glob1000, 1100); // Redzone is at least 101 bytes.
+ BAD_ACCESS(glob10000, 10000);
+ BAD_ACCESS(glob10000, 11000); // Redzone is at least 1001 bytes.
+ BAD_ACCESS(glob100000, 100000);
+ BAD_ACCESS(glob100000, 110000); // Redzone is at least 10001 bytes.
}
// Make sure that each aligned block of size "2^granularity" doesn't have
Modified: compiler-rt/trunk/lib/asan/tests/asan_test_utils.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_test_utils.h?rev=173336&r1=173335&r2=173336&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_test_utils.h (original)
+++ compiler-rt/trunk/lib/asan/tests/asan_test_utils.h Thu Jan 24 04:36:11 2013
@@ -103,6 +103,9 @@
extern char glob15[15];
extern char glob16[16];
extern char glob17[17];
+extern char glob1000[1000];
+extern char glob10000[10000];
+extern char glob100000[100000];
extern int GlobalsTest(int x);
#endif // ASAN_TEST_UTILS_H
More information about the llvm-commits
mailing list