gcc/testsuite/gcc.target/s390/function-align1.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-options "-O2 -march=z13" } */ |
| 3 | |
| 4 | #include <assert.h> |
| 5 | #include <stdint.h> |
| 6 | |
| 7 | __attribute__((noinline)) |
| 8 | void foo1 () {} |
| 9 | |
| 10 | __attribute__((noinline)) |
| 11 | __attribute__((optimize("align-functions=32"))) |
| 12 | void foo2 () {} |
| 13 | |
| 14 | int main () |
| 15 | { |
| 16 | foo1 (); |
| 17 | foo2 (); |
| 18 | |
| 19 | void *f = &foo1; |
| 20 | void *g = &foo2; |
| 21 | |
| 22 | assert (((uintptr_t)f % 16) == 0); |
| 23 | assert (((uintptr_t)g % 32) == 0); |
| 24 | } |