gcc/
[official-gcc.git] / gcc / testsuite / gcc.dg / pr20115.c
blobcea4b486854f239eff9bcdbbf17ec6e49997df89
1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
4 int func_pure (void);
5 void func_other (int);
6 int global_int;
7 int func_pure (void) { return global_int; }
8 void func_other (int a)
10 global_int = a + 1;
12 int f(void)
14 int a;
15 a = func_pure();
16 func_other (a);
17 a = func_pure (); // We were removing this function call
18 return a;
20 void abort (void);
22 int main(void)
24 global_int = 10;
25 if (f() != 11)
26 abort ();
27 return 0;