blob: 286cd6e61f833037d86e8b046188dff96b033309 [file] [log] [blame]
Eric Christopherd3e22df2013-04-03 01:58:53 +00001// For these next two tests when optimized we should omit the leaf frame
2// pointer, for unoptimized we should have a leaf frame pointer.
3// RUN: %clang -### -target i386-pc-linux-gnu -S -O1 %s 2>&1 | \
4// RUN: FileCheck --check-prefix=LINUX-OPT %s
5// LINUX-OPT: "-momit-leaf-frame-pointer"
Galina Kistanova0ccb31c2011-06-03 22:24:54 +00006
Eric Christopherd3e22df2013-04-03 01:58:53 +00007// RUN: %clang -### -target i386-pc-linux-gnu -S %s 2>&1 | \
Nick Lewycky5b5828b2011-02-02 07:17:02 +00008// RUN: FileCheck --check-prefix=LINUX %s
Eric Christopherd3e22df2013-04-03 01:58:53 +00009// LINUX-NOT: "-momit-leaf-frame-pointer"
Nick Lewycky5b5828b2011-02-02 07:17:02 +000010
Eric Christopherd3e22df2013-04-03 01:58:53 +000011// Darwin disables omitting the leaf frame pointer even under optimization
12// unless the command lines are given.
13// RUN: %clang -### -target i386-apple-darwin -S %s 2>&1 | \
14// RUN: FileCheck --check-prefix=DARWIN %s
15// DARWIN: "-mdisable-fp-elim"
16
17// RUN: %clang -### -target i386-apple-darwin -S -O1 %s 2>&1 | \
18// RUN: FileCheck --check-prefix=DARWIN-OPT %s
19// DARWIN-OPT-NOT: "-momit-leaf-frame-pointer"
20
21// RUN: %clang -### -target i386-darwin -S -fomit-frame-pointer %s 2>&1 | \
Daniel Dunbar1ad66482010-07-01 01:31:45 +000022// RUN: FileCheck --check-prefix=OMIT_ALL %s
Eric Christopherd3e22df2013-04-03 01:58:53 +000023// OMIT_ALL-NOT: "-mdisable-fp-elim"
Daniel Dunbar1ad66482010-07-01 01:31:45 +000024
Eric Christopherd3e22df2013-04-03 01:58:53 +000025// RUN: %clang -### -target i386-darwin -S -momit-leaf-frame-pointer %s 2>&1 | \
Daniel Dunbar1ad66482010-07-01 01:31:45 +000026// RUN: FileCheck --check-prefix=OMIT_LEAF %s
Eric Christopherd3e22df2013-04-03 01:58:53 +000027// OMIT_LEAF: "-momit-leaf-frame-pointer"
Daniel Dunbar1ad66482010-07-01 01:31:45 +000028
29void f0() {}
30void f1() { f0(); }