1 /* This used to abort due to a loop bug on s390*. */ 2 3 /* { dg-do run } */ 4 /* { dg-options "-O2" } */ 5 /* { dg-options "-O2 -fPIC" { target s390*-*-* } } */ 6 7 extern void abort (void); 8 9 int count = 0; 10 char *str; 11 test(int flag)12void test (int flag) 13 { 14 char *p; 15 16 for (;;) 17 { 18 if (count > 5) 19 return; 20 21 p = "test"; 22 23 if (flag) 24 count++; 25 26 str = p; 27 } 28 } 29 main(void)30int main (void) 31 { 32 test (1); 33 34 if (str[0] != 't') 35 abort (); 36 37 return 0; 38 } 39 40