diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/20031216-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/20031216-1.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/20031216-1.c b/gcc/testsuite/gcc.dg/20031216-1.c new file mode 100644 index 000000000..7c706d86b --- /dev/null +++ b/gcc/testsuite/gcc.dg/20031216-1.c @@ -0,0 +1,39 @@ +/* This used to abort due to a loop bug on s390*. */ + +/* { dg-do run } */ +/* { dg-options "-O2" } */ +/* { dg-options "-O2 -fPIC" { target s390*-*-* } } */ + +extern void abort (void); + +int count = 0; +char *str; + +void test (int flag) +{ + char *p; + + for (;;) + { + if (count > 5) + return; + + p = "test"; + + if (flag) + count++; + + str = p; + } +} + +int main (void) +{ + test (1); + + if (str[0] != 't') + abort (); + + return 0; +} + |