Dean Michael Berris | 20dc6ef | 2018-04-09 04:02:09 +0000 | [diff] [blame] | 1 | // RUN: echo "[always]" > %t.xray-attrlist |
| 2 | // RUN: echo "fun:*always*" >> %t.xray-attrlist |
| 3 | // RUN: echo "[never]" >> %t.xray-attrlist |
| 4 | // RUN: echo "fun:*never*" >> %t.xray-attrlist |
| 5 | // RUN: %clang_cc1 -fxray-instrument -x c++ -std=c++11 \ |
| 6 | // RUN: -fxray-attr-list=%t.xray-attrlist -emit-llvm -o - %s \ |
| 7 | // RUN: -triple x86_64-unknown-linux-gnu | FileCheck %s |
| 8 | |
| 9 | void always() {} |
| 10 | void never() {} |
| 11 | [[clang::xray_never_instrument]] void alwaysNever() {} |
| 12 | [[clang::xray_always_instrument]] void neverAlways() {} |
| 13 | |
| 14 | // CHECK: define void @_Z6alwaysv() #[[ALWAYSATTR:[0-9]+]] { |
| 15 | // CHECK: define void @_Z5neverv() #[[NEVERATTR:[0-9]+]] { |
| 16 | // CHECK: define void @_Z11alwaysNeverv() #[[NEVERATTR]] { |
| 17 | // CHECK: define void @_Z11neverAlwaysv() #[[ALWAYSATTR]] { |
| 18 | // CHECK: attributes #[[ALWAYSATTR]] = {{.*}} "function-instrument"="xray-always" {{.*}} |
| 19 | // CHECK: attributes #[[NEVERATTR]] = {{.*}} "function-instrument"="xray-never" {{.*}} |