2017-11-15 05:13:27 +08:00
|
|
|
// RUN: %clang_cc1 -S -debug-info-kind=standalone -emit-llvm -o - %s -finstrument-functions -disable-llvm-passes | FileCheck %s
|
2017-11-22 01:30:34 +08:00
|
|
|
// RUN: %clang_cc1 -S -debug-info-kind=standalone -emit-llvm -o - %s -finstrument-function-entry-bare -disable-llvm-passes | FileCheck -check-prefix=BARE %s
|
2010-06-22 08:03:40 +08:00
|
|
|
|
|
|
|
int test1(int x) {
|
2017-11-15 07:10:04 +08:00
|
|
|
// CHECK: @test1(i32 {{.*}}%x) #[[ATTR1:[0-9]+]]
|
2010-06-22 08:03:40 +08:00
|
|
|
// CHECK: ret
|
2017-11-22 01:30:34 +08:00
|
|
|
|
|
|
|
// BARE: @test1(i32 {{.*}}%x) #[[ATTR1:[0-9]+]]
|
|
|
|
// BARE: ret
|
2010-06-22 08:03:40 +08:00
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
int test2(int) __attribute__((no_instrument_function));
|
|
|
|
int test2(int x) {
|
2017-11-15 07:10:04 +08:00
|
|
|
// CHECK: @test2(i32 {{.*}}%x) #[[ATTR2:[0-9]+]]
|
2010-06-22 08:03:40 +08:00
|
|
|
// CHECK: ret
|
2017-11-22 01:30:34 +08:00
|
|
|
|
|
|
|
// BARE: @test2(i32 {{.*}}%x) #[[ATTR2:[0-9]+]]
|
|
|
|
// BARE: ret
|
2010-06-22 08:03:40 +08:00
|
|
|
return x;
|
|
|
|
}
|
2017-11-15 05:13:27 +08:00
|
|
|
|
|
|
|
// CHECK: attributes #[[ATTR1]] =
|
|
|
|
// CHECK-SAME: "instrument-function-entry"="__cyg_profile_func_enter"
|
|
|
|
// CHECK-SAME: "instrument-function-exit"="__cyg_profile_func_exit"
|
|
|
|
|
2017-11-22 01:30:34 +08:00
|
|
|
// BARE: attributes #[[ATTR1]] =
|
|
|
|
// BARE-SAME: "instrument-function-entry-inlined"="__cyg_profile_func_enter_bare"
|
|
|
|
|
2017-11-15 05:13:27 +08:00
|
|
|
// CHECK: attributes #[[ATTR2]] =
|
|
|
|
// CHECK-NOT: "instrument-function-entry"
|
2017-11-22 01:30:34 +08:00
|
|
|
|
|
|
|
// BARE: attributes #[[ATTR2]] =
|
|
|
|
// BARE-NOT: "instrument-function-entry"
|