2014-08-04 Ed Schonberg <schonberg@adacore.com>
[official-gcc.git] / gcc / testsuite / gcc.dg / bf-spl1.c
blobb28130dac73a2bf2c04a20c494b5ad82b3e32bce
1 /* { dg-do run { target m68k-*-* fido-*-* sparc-*-* } } */
2 /* { dg-options { -O2 } } */
4 extern void abort (void);
6 typedef float SFtype __attribute__ ((mode (SF)));
7 typedef float DFtype __attribute__ ((mode (DF)));
9 typedef int HItype __attribute__ ((mode (HI)));
10 typedef int SItype __attribute__ ((mode (SI)));
11 typedef int DItype __attribute__ ((mode (DI)));
13 typedef unsigned int UHItype __attribute__ ((mode (HI)));
14 typedef unsigned int USItype __attribute__ ((mode (SI)));
15 typedef unsigned int UDItype __attribute__ ((mode (DI)));
17 typedef UDItype fractype;
18 typedef USItype halffractype;
19 typedef DFtype FLO_type;
20 typedef DItype intfrac;
23 typedef union
25 long long foo;
26 FLO_type value;
27 struct
29 fractype fraction:52 __attribute__ ((packed));
30 unsigned int exp:11 __attribute__ ((packed));
31 unsigned int sign:1 __attribute__ ((packed));
33 bits;
34 } FLO_union_type;
36 void foo (long long a);
37 long long x;
39 void
40 pack_d ()
42 FLO_union_type dst = { 0x0123456789abcdefLL };
44 x = dst.bits.fraction;
47 main ()
49 pack_d ();
50 foo (x);
51 return 0;
54 void
55 foo (long long a)
57 if (a != 0x0123456789abcLL)
58 abort ();