PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / ipa-icf-7.c
blob488e133d93f72a2be7c0ea68a5c3c0e034b20532
1 /* { dg-do compile { target c99_runtime } } */
2 /* { dg-options "-O2 -fdump-ipa-icf" } */
3 /* { dg-add-options c99_runtime } */
5 #include <complex.h>
7 #if (__SIZEOF_INT__ == __SIZEOF_FLOAT__)
8 typedef int intflt;
9 #elif (__SIZEOF_LONG__ == __SIZEOF_FLOAT__)
10 typedef long intflt;
11 #else
12 #error Add target support here for type that will union float size
13 #endif
16 static double test;
18 struct struktura
20 union
22 long i;
23 float f;
24 } u;
27 struct struktura sss;
29 struct X
31 int i;
32 union
34 intflt j;
35 intflt k;
36 float f;
37 } u;
40 __attribute__ ((noinline))
41 intflt foo(intflt j)
43 struct X a;
45 a.u.j = j;
46 a.u.f = a.u.f;
47 a.u.f = a.u.f;
48 a.u.j = a.u.j;
49 a.u.f = a.u.f;
50 return a.u.k;
53 __attribute__ ((noinline))
54 intflt foo2(intflt j)
56 struct X a;
58 a.u.j = j;
59 a.u.f = a.u.f;
60 a.u.f = a.u.f;
61 a.u.j = a.u.j;
62 a.u.f = a.u.f;
63 return a.u.k;
66 int main()
68 return 1;
71 /* { dg-final { scan-ipa-dump "Semantic equality hit:foo->foo2" "icf" } } */
72 /* { dg-final { scan-ipa-dump "Equal symbols: 1" "icf" } } */