diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/fpomit-1.c')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/fpomit-1.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fpomit-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fpomit-1.c new file mode 100644 index 000000000..c5398070b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/fpomit-1.c @@ -0,0 +1,25 @@ +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-O2 -fno-omit-frame-pointer -fshrink-wrap-frame-pointer -dA" } */ +/* { dg-final { scan-assembler-times "BLOCK 2.*push\[^\n\r\]*bp.*mov\[^\n\r\]*sp\[^\n\r\]*bp.*BLOCK 3" 1 } } */ +/* { dg-final { scan-assembler-times "pop\[^\n\r\]*bp" 1 } } */ + +/* Check there is 1 push, 1 pop and 1 mov-sp-to-bp. */ + +unsigned M; +int cond1, cond2; +extern void goo(); +extern void hoo(); +extern void ioo(); + +void foo() { + unsigned i; + for (i = 0; i <= M; i++) { + if (cond1) { + goo(); + } else if (cond2) { + hoo(); + } else { + ioo(); + } + } +} |