| Dean Michael Berris | 835832d | 2017-03-30 00:29:36 +0000 | [diff] [blame] | 1 | // RUN: echo "fun:*foo*" > %t.always-instrument | 
|  | 2 | // RUN: echo "src:*xray-always-instrument.cpp" >> %t.always-instrument | 
| Dean Michael Berris | 20dc6ef | 2018-04-09 04:02:09 +0000 | [diff] [blame^] | 3 | // RUN: echo "[always]" > %t.xray-attrlist | 
|  | 4 | // RUN: echo "fun:*foo*" >> %t.xray-attrlist | 
|  | 5 | // RUN: echo "src:*xray-always-instrument.cpp" >> %t.xray-attrlist | 
|  | 6 | // RUN: %clang_cc1 -fxray-instrument -x c++ -std=c++11 \ | 
|  | 7 | // RUN:     -fxray-always-instrument=%t.always-instrument -emit-llvm -o - %s \ | 
|  | 8 | // RUN:     -triple x86_64-unknown-linux-gnu | FileCheck %s | 
|  | 9 | // RUN: %clang_cc1 -fxray-instrument -x c++ -std=c++11 \ | 
|  | 10 | // RUN:     -fxray-attr-list=%t.xray-attrlist -emit-llvm -o - %s \ | 
|  | 11 | // RUN:     -triple x86_64-unknown-linux-gnu | FileCheck %s | 
| Dean Michael Berris | 835832d | 2017-03-30 00:29:36 +0000 | [diff] [blame] | 12 |  | 
|  | 13 | void foo() {} | 
|  | 14 |  | 
|  | 15 | [[clang::xray_never_instrument]] void bar() {} | 
|  | 16 |  | 
|  | 17 | void baz() {} | 
|  | 18 |  | 
|  | 19 | // CHECK: define void @_Z3foov() #[[ALWAYSATTR:[0-9]+]] { | 
|  | 20 | // CHECK: define void @_Z3barv() #[[NEVERATTR:[0-9]+]] { | 
|  | 21 | // CHECK: define void @_Z3bazv() #[[ALWAYSATTR:[0-9]+]] { | 
|  | 22 | // CHECK: attributes #[[ALWAYSATTR]] = {{.*}} "function-instrument"="xray-always" {{.*}} | 
|  | 23 | // CHECK: attributes #[[NEVERATTR]] = {{.*}} "function-instrument"="xray-never" {{.*}} |