Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / instrument-functions.c
blobb73278d61ce7cd3cc9912d413f2025801eeec8e9
1 // RUN: %clang_cc1 -debug-info-kind=standalone -emit-llvm -o - %s -finstrument-functions -disable-llvm-passes | FileCheck %s
2 // RUN: %clang_cc1 -debug-info-kind=standalone -emit-llvm -o - %s -finstrument-function-entry-bare -disable-llvm-passes | FileCheck -check-prefix=BARE %s
4 int test1(int x) {
5 // CHECK: @test1(i32 {{.*}}%x) #[[ATTR1:[0-9]+]]
6 // CHECK: ret
8 // BARE: @test1(i32 {{.*}}%x) #[[ATTR1:[0-9]+]]
9 // BARE: ret
10 return x;
13 int test2(int) __attribute__((no_instrument_function));
14 int test2(int x) {
15 // CHECK: @test2(i32 {{.*}}%x) #[[ATTR2:[0-9]+]]
16 // CHECK: ret
18 // BARE: @test2(i32 {{.*}}%x) #[[ATTR2:[0-9]+]]
19 // BARE: ret
20 return x;
23 // CHECK: attributes #[[ATTR1]] =
24 // CHECK-SAME: "instrument-function-entry"="__cyg_profile_func_enter"
25 // CHECK-SAME: "instrument-function-exit"="__cyg_profile_func_exit"
27 // BARE: attributes #[[ATTR1]] =
28 // BARE-SAME: "instrument-function-entry-inlined"="__cyg_profile_func_enter_bare"
30 // CHECK: attributes #[[ATTR2]] =
31 // CHECK-NOT: "instrument-function-entry"
33 // BARE: attributes #[[ATTR2]] =
34 // BARE-NOT: "instrument-function-entry"