diff options
author | Kostya Serebryany <kcc@google.com> | 2015-01-03 02:07:58 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2015-01-03 02:07:58 +0000 |
commit | c5576ae946ba193b49efba22f9d2549f4b338218 (patch) | |
tree | 1e20e4148f6cd56638f77ae10f04fdc62d870c38 /test | |
parent | 105651aba0277bd52a4987c6e48a8c2dc84fb13e (diff) | |
download | compiler-rt-c5576ae946ba193b49efba22f9d2549f4b338218.tar.gz |
[asan/tracing] extend the test a bit more, simplify the tracing code, add a guard page to trace array, fix the trace IDs before dumping
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@225108 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/asan/TestCases/Linux/coverage-tracing.cc | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/test/asan/TestCases/Linux/coverage-tracing.cc b/test/asan/TestCases/Linux/coverage-tracing.cc index f696fb4f7..49dbb5e95 100644 --- a/test/asan/TestCases/Linux/coverage-tracing.cc +++ b/test/asan/TestCases/Linux/coverage-tracing.cc @@ -4,14 +4,14 @@ // RUN: rm -rf %T/coverage-tracing // RUN: mkdir %T/coverage-tracing // RUN: cd %T/coverage-tracing -// RUN: A=x; ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK1; mv trace-points.*.sancov $A.points -// RUN: A=f; ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK2; mv trace-points.*.sancov $A.points -// RUN: A=b; ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK2; mv trace-points.*.sancov $A.points -// RUN: A=bf; ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK3; mv trace-points.*.sancov $A.points -// RUN: A=fb; ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK3; mv trace-points.*.sancov $A.points -// RUN: A=ffb; ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK4; mv trace-points.*.sancov $A.points -// RUN: A=fff; ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK4; mv trace-points.*.sancov $A.points -// RUN: A=bbf; ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK4; mv trace-points.*.sancov $A.points +// RUN: A=x; ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 1 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK1; mv trace-points.*.sancov $A.points +// RUN: A=f; ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 1 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK2; mv trace-points.*.sancov $A.points +// RUN: A=b; ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 1 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK2; mv trace-points.*.sancov $A.points +// RUN: A=bf; ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 1 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK3; mv trace-points.*.sancov $A.points +// RUN: A=fb; ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 1 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK3; mv trace-points.*.sancov $A.points +// RUN: A=ffb; ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 1 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK4; mv trace-points.*.sancov $A.points +// RUN: A=fff; ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 1 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK4; mv trace-points.*.sancov $A.points +// RUN: A=bbf; ASAN_OPTIONS=coverage=1:verbosity=1 %run %t $A 100 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK301; mv trace-points.*.sancov $A.points // RUN: diff f.points fff.points // RUN: diff bf.points fb.points // RUN: diff bf.points ffb.points @@ -32,10 +32,13 @@ __attribute__((noinline)) void foo() { sink++; } __attribute__((noinline)) void bar() { sink++; } int main(int argc, char **argv) { - if (argc != 2) return 0; - for (int i = 0; argv[1][i]; i++) { - if (argv[1][i] == 'f') foo(); - else if (argv[1][i] == 'b') bar(); + if (argc != 3) return 0; + int n = strtol(argv[2], 0, 10); + while (n-- > 0) { + for (int i = 0; argv[1][i]; i++) { + if (argv[1][i] == 'f') foo(); + else if (argv[1][i] == 'b') bar(); + } } } @@ -44,3 +47,4 @@ int main(int argc, char **argv) { // CHECK2: CovDump: Trace: 2 Events written // CHECK3: CovDump: Trace: 3 Events written // CHECK4: CovDump: Trace: 4 Events written +// CHECK301: CovDump: Trace: 301 Events written |