blob: b28130dac73a2bf2c04a20c494b5ad82b3e32bce [file] [log] [blame]
Egor Pasko167ac2b2010-05-18 12:26:511/* { dg-do run { target m68k-*-* fido-*-* sparc-*-* } } */
2/* { dg-options { -O2 } } */
3
4extern void abort (void);
5
6typedef float SFtype __attribute__ ((mode (SF)));
7typedef float DFtype __attribute__ ((mode (DF)));
8
9typedef int HItype __attribute__ ((mode (HI)));
10typedef int SItype __attribute__ ((mode (SI)));
11typedef int DItype __attribute__ ((mode (DI)));
12
13typedef unsigned int UHItype __attribute__ ((mode (HI)));
14typedef unsigned int USItype __attribute__ ((mode (SI)));
15typedef unsigned int UDItype __attribute__ ((mode (DI)));
16
17typedef UDItype fractype;
18typedef USItype halffractype;
19typedef DFtype FLO_type;
20typedef DItype intfrac;
21
22
23typedef union
24{
25 long long foo;
26 FLO_type value;
27 struct
28 {
29 fractype fraction:52 __attribute__ ((packed));
30 unsigned int exp:11 __attribute__ ((packed));
31 unsigned int sign:1 __attribute__ ((packed));
32 }
33 bits;
34} FLO_union_type;
35
36void foo (long long a);
37long long x;
38
39void
40pack_d ()
41{
42 FLO_union_type dst = { 0x0123456789abcdefLL };
43
44 x = dst.bits.fraction;
45}
46
47main ()
48{
49 pack_d ();
50 foo (x);
51 return 0;
52}
53
54void
55foo (long long a)
56{
57 if (a != 0x0123456789abcLL)
58 abort ();
59}