2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / bf-spl1.c
blobdf3f4817043a221c02c736e58690c67f8ead3889
1 /* { dg-do run { target m68k-*-* sparc-*-* } } */
2 /* { dg-options { -m68000 -O2 } { target m68k-*-* } } */
3 /* { dg-options { -O2 } { target sparc-*-* } } */
5 typedef SFtype __attribute__ ((mode (SF)));
6 typedef DFtype __attribute__ ((mode (DF)));
8 typedef int HItype __attribute__ ((mode (HI)));
9 typedef int SItype __attribute__ ((mode (SI)));
10 typedef int DItype __attribute__ ((mode (DI)));
12 typedef unsigned int UHItype __attribute__ ((mode (HI)));
13 typedef unsigned int USItype __attribute__ ((mode (SI)));
14 typedef unsigned int UDItype __attribute__ ((mode (DI)));
16 typedef UDItype fractype;
17 typedef USItype halffractype;
18 typedef DFtype FLO_type;
19 typedef DItype intfrac;
22 typedef union
24 long long foo;
25 FLO_type value;
26 struct
28 fractype fraction:52 __attribute__ ((packed));
29 unsigned int exp:11 __attribute__ ((packed));
30 unsigned int sign:1 __attribute__ ((packed));
32 bits;
33 } FLO_union_type;
35 void foo (long long a);
36 long long x;
38 void
39 pack_d ()
41 FLO_union_type dst = { 0x0123456789abcdefLL };
43 x = dst.bits.fraction;
46 main ()
48 pack_d ();
49 foo (x);
50 return 0;
53 void
54 foo (long long a)
56 if (a != 0x0123456789abcLL)
57 abort ();