PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / lto / ipareference_0.c
blobf8270d5d9fc52e303cbaf406c0672f3ccbc82fd8
1 /* { dg-lto-options {{ -O1 -flto -flto-partition=1to1 }} } */
2 /* { dg-lto-do run } */
4 /* Test that ipa-reference notice that get_val will not change since do_nothing does not
5 modify anything. This needs streaming cross file boundary summaries. */
6 extern int get_val (void);
7 extern int set_val (void);
8 extern void do_nothing (void);
9 void abort (void);
10 int
11 main()
13 int a;
14 int b;
15 set_val ();
16 a = get_val ();
17 do_nothing();
18 b = get_val ();
19 if (a==b)
21 if (!__builtin_constant_p (a==b))
22 abort ();
23 return 0;
25 else
26 abort ();