aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/instrument-functions-size.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/instrument-functions-size.cpp')
-rw-r--r--test/CodeGenCXX/instrument-functions-size.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/CodeGenCXX/instrument-functions-size.cpp b/test/CodeGenCXX/instrument-functions-size.cpp
new file mode 100644
index 0000000000..6fcb839ca1
--- /dev/null
+++ b/test/CodeGenCXX/instrument-functions-size.cpp
@@ -0,0 +1,28 @@
+// RUN: %clang_cc1 -S -emit-llvm -o - %s -finstrument-functions -finstrument-functions-size 2 | FileCheck %s
+
+// CHECK: define i32 @_Z5test1i
+int test1(int x) {
+// CHECK-NOT: __cyg_profile_func_enter
+// CHECK-NOT: __cyg_profile_func_exit
+// CHECK: ret i32
+ return x;
+}
+
+// CHECK: define i32 @_Z5test2i
+int test2(int) __attribute__((no_instrument_function));
+int test2(int x) {
+ if(x) {test1(x);}
+// CHECK-NOT: __cyg_profile_func_enter
+// CHECK-NOT: __cyg_profile_func_exit
+// CHECK: ret i32
+ return x;
+}
+
+// CHECK: define i32 @_Z5test3i
+int test3(int x) {
+ if(x) {test1(x);}
+// CHECK: __cyg_profile_func_enter
+// CHECK: __cyg_profile_func_exit
+// CHECK: ret i32
+ return x;
+}