Eric Christopher | d3e22df | 2013-04-03 01:58:53 +0000 | [diff] [blame] | 1 | // 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 Kistanova | 0ccb31c | 2011-06-03 22:24:54 +0000 | [diff] [blame] | 6 | |
Eric Christopher | d3e22df | 2013-04-03 01:58:53 +0000 | [diff] [blame] | 7 | // RUN: %clang -### -target i386-pc-linux-gnu -S %s 2>&1 | \ |
Nick Lewycky | 5b5828b | 2011-02-02 07:17:02 +0000 | [diff] [blame] | 8 | // RUN: FileCheck --check-prefix=LINUX %s |
Eric Christopher | d3e22df | 2013-04-03 01:58:53 +0000 | [diff] [blame] | 9 | // LINUX-NOT: "-momit-leaf-frame-pointer" |
Nick Lewycky | 5b5828b | 2011-02-02 07:17:02 +0000 | [diff] [blame] | 10 | |
Eric Christopher | d3e22df | 2013-04-03 01:58:53 +0000 | [diff] [blame] | 11 | // 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 Dunbar | 1ad6648 | 2010-07-01 01:31:45 +0000 | [diff] [blame] | 22 | // RUN: FileCheck --check-prefix=OMIT_ALL %s |
Eric Christopher | d3e22df | 2013-04-03 01:58:53 +0000 | [diff] [blame] | 23 | // OMIT_ALL-NOT: "-mdisable-fp-elim" |
Daniel Dunbar | 1ad6648 | 2010-07-01 01:31:45 +0000 | [diff] [blame] | 24 | |
Eric Christopher | d3e22df | 2013-04-03 01:58:53 +0000 | [diff] [blame] | 25 | // RUN: %clang -### -target i386-darwin -S -momit-leaf-frame-pointer %s 2>&1 | \ |
Daniel Dunbar | 1ad6648 | 2010-07-01 01:31:45 +0000 | [diff] [blame] | 26 | // RUN: FileCheck --check-prefix=OMIT_LEAF %s |
Eric Christopher | d3e22df | 2013-04-03 01:58:53 +0000 | [diff] [blame] | 27 | // OMIT_LEAF: "-momit-leaf-frame-pointer" |
Daniel Dunbar | 1ad6648 | 2010-07-01 01:31:45 +0000 | [diff] [blame] | 28 | |
| 29 | void f0() {} |
| 30 | void f1() { f0(); } |