Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / xray / TestCases / Posix / always-never-instrument.cpp
blobe5fefc07c1cc8160501db5fb266bf3c022c6f169
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
13 // REQUIRES: built-in-llvm-tree
15 // NOINSTR-NOT: {{.*__xray_NeverInstrumented.*}}
16 int __xray_NeverInstrumented() {
17 return 0;
20 // ALWAYSINSTR: {{.*function-name:.*main.*}}
21 int main(int argc, char *argv[]) {
22 return __xray_NeverInstrumented();