gcc/testsuite/gcc.dg/tree-prof/bb-reorg.c
raw| 1 | /* { dg-require-effective-target freorder } */ |
| 2 | /* { dg-options "-O2 -freorder-blocks-and-partition" } */ |
| 3 | |
| 4 | #include <string.h> |
| 5 | |
| 6 | #define SIZE 1000 |
| 7 | int t0 = 0; |
| 8 | const char *t2[SIZE]; |
| 9 | char buf[SIZE]; |
| 10 | |
| 11 | void |
| 12 | foo (void) |
| 13 | { |
| 14 | char *s = buf; |
| 15 | t0 = 1; |
| 16 | |
| 17 | for (;;) |
| 18 | { |
| 19 | if (*s == '\0') |
| 20 | break; |
| 21 | else |
| 22 | { |
| 23 | t2[t0] = s; |
| 24 | t0++; |
| 25 | } |
| 26 | *s++ = '\0'; |
| 27 | } |
| 28 | t2[t0] = NULL; |
| 29 | } |
| 30 | |
| 31 | |
| 32 | int |
| 33 | main () |
| 34 | { |
| 35 | strcpy (buf, "hello"); |
| 36 | foo (); |
| 37 | return 0; |
| 38 | } |
| 39 |