Pirama Arumuga Nainar | 259f706 | 2015-05-06 11:49:53 -0700 | [diff] [blame] | 1 | // RUN: rm -rf %T/coverage-basic |
| 2 | // RUN: mkdir %T/coverage-basic && cd %T/coverage-basic |
Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 3 | // RUN: %clangxx_asan -fsanitize-coverage=func %s -o test.exe |
| 4 | // RUN: env ASAN_OPTIONS=%ASAN_OPTIONS%:coverage=1 %run ./test.exe |
Pirama Arumuga Nainar | 259f706 | 2015-05-06 11:49:53 -0700 | [diff] [blame] | 5 | // |
| 6 | // RUN: %sancov print *.sancov | FileCheck %s |
| 7 | #include <stdio.h> |
| 8 | |
| 9 | void foo() { fprintf(stderr, "FOO\n"); } |
| 10 | void bar() { fprintf(stderr, "BAR\n"); } |
| 11 | |
| 12 | int main(int argc, char **argv) { |
| 13 | if (argc == 2) { |
| 14 | foo(); |
| 15 | bar(); |
| 16 | } else { |
| 17 | bar(); |
| 18 | foo(); |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | // CHECK: 0x{{[0-9a-f]*}} |
| 23 | // CHECK: 0x{{[0-9a-f]*}} |
| 24 | // CHECK: 0x{{[0-9a-f]*}} |
| 25 | // CHECK-NOT: 0x{{[0-9a-f]*}} |