diff options
author | Kostya Serebryany <kcc@google.com> | 2013-09-27 11:37:23 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2013-09-27 11:37:23 +0000 |
commit | e1c68c319a0113be832da17a777892353a8b5f23 (patch) | |
tree | e3a70664b35c2a72869e30af1375ab33a6ce97fe /lib/asan/lit_tests | |
parent | cfc29de659f3abbb9273fb0fb1c9a3cd5400c81b (diff) | |
download | compiler-rt-e1c68c319a0113be832da17a777892353a8b5f23.tar.gz compiler-rt-e1c68c319a0113be832da17a777892353a8b5f23.tar.bz2 compiler-rt-e1c68c319a0113be832da17a777892353a8b5f23.tar.xz |
[asan] introduce run-time flag uar_stack_size_log to control the size of FakeStack; don't crash when the fake stack is exhausted, move some code to .cc file
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191510 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/lit_tests')
-rw-r--r-- | lib/asan/lit_tests/TestCases/stack-use-after-return.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/asan/lit_tests/TestCases/stack-use-after-return.cc b/lib/asan/lit_tests/TestCases/stack-use-after-return.cc index a3adda80..5ed42a8c 100644 --- a/lib/asan/lit_tests/TestCases/stack-use-after-return.cc +++ b/lib/asan/lit_tests/TestCases/stack-use-after-return.cc @@ -15,6 +15,11 @@ // Test that we can find UAR in a thread other than main: // RUN: %clangxx_asan -DUseThread -O2 %s -o %t && \ // RUN: not %t 2>&1 | FileCheck --check-prefix=THREAD %s +// +// Test the uar_stack_size_log flag. +// +// RUN: ASAN_OPTIONS=$ASAN_OPTIONS:uar_stack_size_log=20:verbosity=1 not %t 2>&1 | FileCheck --check-prefix=CHECK-20 %s +// RUN: ASAN_OPTIONS=$ASAN_OPTIONS:uar_stack_size_log=24:verbosity=1 not %t 2>&1 | FileCheck --check-prefix=CHECK-24 %s #include <stdio.h> #include <pthread.h> @@ -51,6 +56,8 @@ void Func2(char *x) { // THREAD: #0{{.*}}Func2{{.*}}stack-use-after-return.cc:[[@LINE-6]] // THREAD: is located in stack of thread T{{[1-9]}} at offset // THREAD: 'local' <== Memory access at offset 32 is inside this variable + // CHECK-20: T0: FakeStack created:{{.*}} stack_size_log: 20 + // CHECK-24: T0: FakeStack created:{{.*}} stack_size_log: 24 } void *Thread(void *unused) { |