Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / testsuite / gcc.dg / 20020411-1.c
blob0413ed9b56bb57c1bbf3a1fa256645d16d127155
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" } { "" } } */
9 #if __INT_MAX__ > 32767
11 typedef struct
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;
25 inline void
26 foo (T *x, unsigned int y)
28 if ((x->j = (y >= 0x100000)))
29 y >>= 12;
30 x->a = y;
31 x->f = (y >> 16);
34 void __attribute__((noinline))
35 bar (T *x)
39 void
40 baz (unsigned int x, unsigned char y)
42 T t;
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);
55 #endif /* __INT_MAX__ */