OSDN Git Service

b530c841a7f73a64d3c1b12829b3312e1232e53a
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / tree-ssa / 20030807-5.c
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fdump-tree-dom3" } */
3                                                                                 
4 struct rtx_def;
5 typedef struct rtx_def *rtx;
6
7
8 struct rtx_def
9 {
10
11   int code;
12   unsigned int unchanging:1;
13
14 };
15 static rtx current_sym_addr;
16
17 static int
18 foo ()
19 {
20   if (current_sym_addr->code == 42
21       && (({
22                rtx _rtx = current_sym_addr;
23                if (((_rtx)->code) != 42)
24                  abort ();
25                _rtx;}
26            )->unchanging))
27     return 0;
28 }
29
30 /* There should be precisely one load of ->code.  If there is
31    more than, then the dominator optimizations failed.  */
32 /* { dg-final { scan-tree-dump-times "->code" 1 "dom3"} } */
33
34 /* There should be two IF statements.  One for 'current_sym_addr->code == 42'.
35    The other one for '(EXPR)->unchanging'.  */
36 /* { dg-final { scan-tree-dump-times "if " 2 "dom3"} } */