1 /* { dg-do run } */ 2 /* { dg-require-alias "" } */ 3 /* { dg-options "-O2 -fdump-tree-local-pure-const1" } */ 4 5 __attribute__ ((weak)) 6 __attribute__ ((noinline)) a(int v)7int a(int v) 8 { 9 return v; 10 } 11 __attribute__ ((noinline)) 12 static int b(int v) __attribute__ ((alias("a"))); 13 int main()14main() 15 { 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; 23 } 24 /* { dg-final { scan-tree-dump "found to be const" "local-pure-const1"} } */ 25