Driver/IRgen: Add support for -momit-leaf-frame-pointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107367 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/frame-pointer-elim.c b/test/CodeGen/frame-pointer-elim.c
new file mode 100644
index 0000000..79c0599
--- /dev/null
+++ b/test/CodeGen/frame-pointer-elim.c
@@ -0,0 +1,29 @@
+// RUN: %clang -ccc-host-triple i386 -S -o - %s | \
+// RUN:   FileCheck --check-prefix=DEFAULT %s
+// DEFAULT: f0:
+// DEFAULT: pushl %ebp
+// DEFAULT: ret
+// DEFAULT: f1:
+// DEFAULT: pushl %ebp
+// DEFAULT: ret
+
+// RUN: %clang -ccc-host-triple i386 -S -o - -fomit-frame-pointer %s | \
+// RUN:   FileCheck --check-prefix=OMIT_ALL %s
+// OMIT_ALL: f0:
+// OMIT_ALL-NOT: pushl %ebp
+// OMIT_ALL: ret
+// OMIT_ALL: f1:
+// OMIT_ALL-NOT: pushl %ebp
+// OMIT_ALL: ret
+
+// RUN: %clang -ccc-host-triple i386 -S -o - -momit-leaf-frame-pointer %s | \
+// RUN:   FileCheck --check-prefix=OMIT_LEAF %s
+// OMIT_LEAF: f0:
+// OMIT_LEAF-NOT: pushl %ebp
+// OMIT_LEAF: ret
+// OMIT_LEAF: f1:
+// OMIT_LEAF: pushl %ebp
+// OMIT_LEAF: ret
+
+void f0() {}
+void f1() { f0(); }