diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-prof/bb-reorg.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/bb-reorg.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-prof/bb-reorg.c b/gcc/testsuite/gcc.dg/tree-prof/bb-reorg.c new file mode 100644 index 000000000..f850c9bfd --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-prof/bb-reorg.c @@ -0,0 +1,39 @@ +/* { dg-require-effective-target freorder } */ +/* { dg-options "-O2 -freorder-blocks-and-partition" } */ + +#include <string.h> + +#define SIZE 1000 +int t0 = 0; +const char *t2[SIZE]; +char buf[SIZE]; + +void +foo (void) +{ + char *s = buf; + t0 = 1; + + for (;;) + { + if (*s == '\0') + break; + else + { + t2[t0] = s; + t0++; + } + *s++ = '\0'; + } + t2[t0] = NULL; +} + + +int +main () +{ + strcpy (buf, "hello"); + foo (); + return 0; +} + |