| 1 |
/* Verify that alignment flags are set when attribute __optimize is used. */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2" } */ |
| 4 |
|
| 5 |
extern void non_existent(int); |
| 6 |
|
| 7 |
__attribute__ ((__optimize__ ("O2"))) |
| 8 |
static void hooray () |
| 9 |
{ |
| 10 |
non_existent (1); |
| 11 |
} |
| 12 |
|
| 13 |
__attribute__ ((__optimize__ ("O2"))) |
| 14 |
static void hiphip (void (*f)()) |
| 15 |
{ |
| 16 |
non_existent (2); |
| 17 |
f (); |
| 18 |
} |
| 19 |
|
| 20 |
__attribute__ ((__optimize__ ("O2"))) |
| 21 |
int test (void) |
| 22 |
{ |
| 23 |
hiphip (hooray); |
| 24 |
return 0; |
| 25 |
} |
| 26 |
|
| 27 |
/* { dg-final { scan-assembler "p2align" } } */ |
| 28 |
|
| 29 |
|