PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / pure-const-3.c
blobe3d27c10f33a97493d7176679638314fb2faae7f
1 /* { dg-do run } */
2 /* { dg-require-alias "" } */
3 /* { dg-options "-O2 -fdump-tree-local-pure-const1" } */
5 __attribute__ ((weak))
6 __attribute__ ((noinline))
7 int a(int v)
9 return v;
11 __attribute__ ((noinline))
12 static int b(int v) __attribute__ ((alias("a")));
13 int
14 main()
16 int c = a(1)==a(1);
17 int d = b(1)==b(1);
18 if (__builtin_constant_p (c))
19 __builtin_abort ();
20 if (!__builtin_constant_p (d))
21 __builtin_abort ();
22 return 0;
24 /* { dg-final { scan-tree-dump "found to be const" "local-pure-const1"} } */