OSDN Git Service

2007-07-25 Andreas Krebbel <krebbel1@de.ibm.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / 20070725-1.c
1 /* This used to fail due to a ifcombine problem wrecking 64bit
2    checks.  Fixed with rev. 126876.  */
3 /* { dg-do run } */
4 /* { dg-options "-O1" } */
5
6 struct tree_base
7 {
8   unsigned code:16;
9
10   unsigned side_effects_flag:1;
11   unsigned constant_flag:1;
12   unsigned addressable_flag:1;
13   unsigned volatile_flag:1;
14   unsigned readonly_flag:1;
15   unsigned unsigned_flag:1;
16   unsigned asm_written_flag:1;
17   unsigned nowarning_flag:1;
18
19   unsigned used_flag:1;
20   unsigned nothrow_flag:1;
21   unsigned static_flag:1;
22   unsigned public_flag:1;
23   unsigned private_flag:1;
24   unsigned protected_flag:1;
25   unsigned deprecated_flag:1;
26   unsigned invariant_flag:1;
27
28   unsigned lang_flag_0:1;
29   unsigned lang_flag_1:1;
30   unsigned lang_flag_2:1;
31   unsigned lang_flag_3:1;
32   unsigned lang_flag_4:1;
33   unsigned lang_flag_5:1;
34   unsigned lang_flag_6:1;
35   unsigned visited:1;
36
37   unsigned spare:24;
38   unsigned long  a;
39 };
40
41 int
42 foo (struct tree_base *rhs)
43 {
44   if (({const struct tree_base* __t = (rhs);  __t;})->readonly_flag
45       && (rhs)->static_flag)
46     return 1;
47
48   return 0;
49 }
50
51 extern void abort (void);
52
53 int
54 main ()
55 {
56   struct tree_base t;
57
58   t.readonly_flag = t.static_flag = 0;
59   if (foo (&t))
60     abort ();
61
62   return 0;
63 }