PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / ipa-icf-25.c
blob4b364eb7c72af2864d38a43d405702989ae84d11
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-ipa-icf" } */
4 static int zip();
5 static int zap();
6 static int two();
8 __attribute__ ((noinline))
9 int foo()
11 return zip();
14 __attribute__ ((noinline))
15 int bar()
17 return zap();
20 __attribute__ ((noinline))
21 int baz()
23 return two();
26 __attribute__ ((noinline))
27 int zip()
29 return 0;
32 __attribute__ ((noinline))
33 int zap()
35 return 0;
38 __attribute__ ((noinline))
39 int two()
41 return 2;
44 int main()
46 return foo() + bar();
49 /* { dg-final { scan-ipa-dump "Semantic equality hit:foo->bar" "icf" } } */
50 /* { dg-final { scan-ipa-dump "Semantic equality hit:zip->zap" "icf" } } */
51 /* { dg-final { scan-ipa-dump "Equal symbols: 2" "icf" } } */