| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-require-effective-target arm_thumb2_ok } */ |
| 3 |
/* { dg-options "-mthumb -O2 -mrestrict-it" } */ |
| 4 |
|
| 5 |
__attribute__ ((noinline, noclone)) void |
| 6 |
fn2 () |
| 7 |
{ |
| 8 |
__builtin_printf ("4"); |
| 9 |
} |
| 10 |
|
| 11 |
enum |
| 12 |
{ |
| 13 |
ONE = 1, |
| 14 |
TWO |
| 15 |
} a; |
| 16 |
|
| 17 |
int b; |
| 18 |
|
| 19 |
__attribute__ ((noinline, noclone)) int |
| 20 |
fn1 () |
| 21 |
{ |
| 22 |
int c = b == 0; |
| 23 |
if (a <= ONE) |
| 24 |
if (b == 0) |
| 25 |
fn2 (); |
| 26 |
if (a) |
| 27 |
if (c) |
| 28 |
a = 0; |
| 29 |
|
| 30 |
return a; |
| 31 |
} |
| 32 |
|
| 33 |
int |
| 34 |
main (void) |
| 35 |
{ |
| 36 |
a = ONE; |
| 37 |
b = 1; |
| 38 |
if (fn1 () != ONE) |
| 39 |
__builtin_abort (); |
| 40 |
|
| 41 |
a = TWO; |
| 42 |
b = 0; |
| 43 |
if (fn1 () != 0) |
| 44 |
__builtin_abort (); |
| 45 |
|
| 46 |
return 0; |
| 47 |
} |