| 1 | // Test that the always/never instrument lists apply. |
| 2 | // RUN: echo "fun:main" > %tmp-always.txt |
| 3 | // RUN: echo "fun:__xray*" > %tmp-never.txt |
| 4 | // RUN: %clangxx_xray \ |
| 5 | // RUN: -fxray-never-instrument=%tmp-never.txt \ |
| 6 | // RUN: -fxray-always-instrument=%tmp-always.txt \ |
| 7 | // RUN: %s -o %t |
| 8 | // RUN: %llvm_xray extract -symbolize %t | \ |
| 9 | // RUN: FileCheck %s --check-prefix NOINSTR |
| 10 | // RUN: %llvm_xray extract -symbolize %t | \ |
| 11 | // RUN: FileCheck %s --check-prefix ALWAYSINSTR |
| 12 | |
| 13 | // REQUIRES: built-in-llvm-tree |
| 14 | |
| 15 | // NOINSTR-NOT: {{.*__xray_NeverInstrumented.*}} |
| 16 | int __xray_NeverInstrumented() { |
| 17 | return 0; |
| 18 | } |
| 19 | |
| 20 | // ALWAYSINSTR: {{.*function-name:.*main.*}} |
| 21 | int main(int argc, char *argv[]) { |
| 22 | return __xray_NeverInstrumented(); |
| 23 | } |
| 24 | |