From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/CodeGen/frame-pointer-elim.c | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 clang/test/CodeGen/frame-pointer-elim.c (limited to 'clang/test/CodeGen/frame-pointer-elim.c') diff --git a/clang/test/CodeGen/frame-pointer-elim.c b/clang/test/CodeGen/frame-pointer-elim.c new file mode 100644 index 0000000..b105a19 --- /dev/null +++ b/clang/test/CodeGen/frame-pointer-elim.c @@ -0,0 +1,40 @@ +// REQUIRES: x86-registered-target + +// RUN: %clang -target i386-apple-darwin -S -o - %s | \ +// RUN: FileCheck --check-prefix=DARWIN %s +// DARWIN: f0: +// DARWIN: pushl %ebp +// DARWIN: ret +// DARWIN: f1: +// DARWIN: pushl %ebp +// DARWIN: ret + +// RUN: %clang -target i386-pc-linux-gnu -S -o - %s | \ +// RUN: FileCheck --check-prefix=LINUX %s +// LINUX: f0: +// LINUX-NOT: pushl %ebp +// LINUX: ret +// LINUX: f1: +// LINUX: pushl %ebp +// LINUX: ret + +// RUN: %clang -target i386-darwin -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 -target i386-darwin -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(); } -- cgit v1.2.3