summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2015-11-23 05:09:10 +0000
committerXinliang David Li <davidxl@google.com>2015-11-23 05:09:10 +0000
commit957c5b5a740c66687c9ea2b13f0c66b43e4c7499 (patch)
tree5fc7cb2c57bba25e175455c34ed22aad33633bc6 /test
parent24174192e46b3b2ac2117efe1029379f873d080a (diff)
Disable frame pointer elimination when using -pg
This diff makes sure that the driver does not pass -fomit-frame-pointer or -momit-leaf-frame-pointer to the frontend when -pg is used. Currently, clang gives an error if -fomit-frame-pointer is used in combination with -pg, but -momit-leaf-frame-pointer was forgotten. Also, disable frame pointer elimination in the frontend when -pg is set. Patch by Stefan Kempf. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253846 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/x86_64-profiling-keep-fp.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CodeGen/x86_64-profiling-keep-fp.c b/test/CodeGen/x86_64-profiling-keep-fp.c
new file mode 100644
index 0000000000..e56ac953a6
--- /dev/null
+++ b/test/CodeGen/x86_64-profiling-keep-fp.c
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -O3 -pg -S -o - %s | \
+// RUN: FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -O3 -momit-leaf-frame-pointer -pg -S -o - %s | \
+// RUN: FileCheck %s
+
+// Test that the frame pointer is kept when compiling with
+// profiling.
+
+//CHECK: pushq %rbp
+int main(void)
+{
+ return 0;
+}