OSDN Git Service

Add NIOS2 support. Code from SourceyG++.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-fre-8.c
1 /* { dg-do compile } */
2 /* { dg-options "-O -fno-tree-sra -fdump-tree-fre-details" } */
3 #if (__SIZEOF_INT__ == __SIZEOF_FLOAT__)
4 typedef int intflt;
5 #elif (__SIZEOF_LONG__ == __SIZEOF_FLOAT__)
6 typedef long intflt;
7 #else
8 #error Add target support here for type that will union float size
9 #endif
10 union U {
11   intflt i;
12   float f;
13 };
14 intflt foo(int i, int b)
15 {
16   union U u;
17   if (b)
18     {
19       i = i << 2;
20       u.i = i;
21       return u.f;
22     }
23   else
24     {
25       i = i << 2;
26       u.i = i;
27       return u.f;
28     }
29 }
30
31 /* { dg-final { scan-tree-dump-times "Replaced u.f with pretmp" 2 "fre" } } */
32 /* { dg-final { scan-tree-dump-times "Inserted pretmp" 2 "fre" } } */
33 /* { dg-final { cleanup-tree-dump "fre" } } */