diff options
author | Kostya Serebryany <kcc@google.com> | 2013-09-12 14:41:10 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2013-09-12 14:41:10 +0000 |
commit | b1173c27c2791aef27304e68911a11648401064d (patch) | |
tree | 34dfaddea8edad14cc0a19176e160166cce819d5 /lib/asan/lit_tests | |
parent | 89de457bd3ec40d38bc7860f88f1d4da473eacc4 (diff) | |
download | compiler-rt-b1173c27c2791aef27304e68911a11648401064d.tar.gz compiler-rt-b1173c27c2791aef27304e68911a11648401064d.tar.bz2 compiler-rt-b1173c27c2791aef27304e68911a11648401064d.tar.xz |
[asan] a bit of performance improvement in fake stack, generalized one test, fixed android build of another test
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190606 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/lit_tests')
-rw-r--r-- | lib/asan/lit_tests/TestCases/uar_and_exceptions.cc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/asan/lit_tests/TestCases/uar_and_exceptions.cc b/lib/asan/lit_tests/TestCases/uar_and_exceptions.cc index f1639f08..beb41515 100644 --- a/lib/asan/lit_tests/TestCases/uar_and_exceptions.cc +++ b/lib/asan/lit_tests/TestCases/uar_and_exceptions.cc @@ -5,22 +5,34 @@ volatile char *g; +#ifndef FRAME_SIZE +# define FRAME_SIZE 100 +#endif + +#ifndef NUM_ITER +# define NUM_ITER 4000 +#endif + +#ifndef DO_THROW +# define DO_THROW 1 +#endif + void Func(int depth) { - char frame[100]; + char frame[FRAME_SIZE]; g = &frame[0]; if (depth) Func(depth - 1); - else + else if (DO_THROW) throw 1; } int main(int argc, char **argv) { - for (int i = 0; i < 4000; i++) { + for (int i = 0; i < NUM_ITER; i++) { try { Func(argc * 100); } catch(...) { } - if ((i % 1000) == 0) + if ((i % (NUM_ITER / 10)) == 0) fprintf(stderr, "done [%d]\n", i); } return 0; |