aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/fpomit-1.c
blob: c5398070b0b6d41a303eb5b513a68a61ac7f9f9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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();
    }
  }
}