modernc.org/ccgo/v3@v3.16.14/lib/testdata/gcc-9.1.0/gcc/testsuite/gcc.c-torture/execute/loop-12.c (about) 1 /* Checks that pure functions are not treated as const. */ 2 3 char *p; 4 5 static int __attribute__ ((pure)) 6 is_end_of_statement (void) 7 { 8 return *p == '\n' || *p == ';' || *p == '!'; 9 } 10 11 void foo (void) 12 { 13 /* The is_end_of_statement call was moved out of the loop at one stage, 14 resulting in an endless loop. */ 15 while (!is_end_of_statement ()) 16 p++; 17 } 18 19 int 20 main (void) 21 { 22 p = "abc\n"; 23 foo (); 24 return 0; 25 }