Files
clang-p2996/compiler-rt/test/xray/TestCases/Posix/always-never-instrument.cpp
Fangrui Song 6db8c59f21 compiler-rt: Rename .cc file in test/xray to .cpp
Like r367463, but for test/xray.

Update test/xray/lit.cfg.py config.suffixes to remove .cc (we actually
don't have .c tests now)

llvm-svn: 367652
2019-08-02 05:49:58 +00:00

24 lines
762 B
C++

// Test that the always/never instrument lists apply.
// RUN: echo "fun:main" > %tmp-always.txt
// RUN: echo "fun:__xray*" > %tmp-never.txt
// RUN: %clangxx_xray \
// RUN: -fxray-never-instrument=%tmp-never.txt \
// RUN: -fxray-always-instrument=%tmp-always.txt \
// RUN: %s -o %t
// RUN: %llvm_xray extract -symbolize %t | \
// RUN: FileCheck %s --check-prefix NOINSTR
// RUN: %llvm_xray extract -symbolize %t | \
// RUN: FileCheck %s --check-prefix ALWAYSINSTR
// REQUIRES: x86_64-target-arch
// REQUIRES: built-in-llvm-tree
// NOINSTR-NOT: {{.*__xray_NeverInstrumented.*}}
int __xray_NeverInstrumented() {
return 0;
}
// ALWAYSINSTR: {{.*function-name:.*main.*}}
int main(int argc, char *argv[]) {
return __xray_NeverInstrumented();
}