OSDN Git Service

* gcc.dg/uninit-H.c: Define ASM for Xtensa targets.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / 20020411-1.c
1 /* PR c/6223
2    This testcase ICEd in internal check because a constant was not truncated
3    for its mode.  */
4 /* { dg-do compile } */
5 /* { dg-options "-O2" } */
6 /* { dg-options "-O2 -march=i686" { target i?86-*-* } } */
7 /* { dg-skip-if "" { i?86-*-* } { "-m64" } { "" } } */
8
9 #if __INT_MAX__ > 32767
10
11 typedef struct
12 {
13   unsigned a : 16;
14   unsigned b : 16;
15   unsigned c : 5;
16   unsigned d : 2;
17   unsigned e : 1;
18   unsigned f : 4;
19   unsigned g : 1;
20   unsigned h : 1;
21   unsigned i : 1;
22   unsigned j : 1;
23 } T;
24
25 inline void
26 foo (T *x, unsigned int y)
27 {
28   if ((x->j = (y >= 0x100000)))
29     y >>= 12;
30   x->a = y;
31   x->f = (y >> 16);
32 }
33
34 void __attribute__((noinline))
35 bar (T *x)
36 {
37 }
38
39 void
40 baz (unsigned int x, unsigned char y)
41 {
42   T t;
43
44   foo (&t, x - 1);
45   t.e = 1;
46   t.c = y;
47   t.g = 0;
48   t.h = 0;
49   t.i = (y & 0x40) != 0;
50   if (x == 1)
51     foo (&t, 1);
52   bar (&t);
53 }
54
55 #endif /* __INT_MAX__ */