2 /* { dg-options "-O2 -ftree-loop-distribution" } */
4 /* Checks if loop distribution works correctly if the subscript used
5 is assigned to a loop invariant value. */
7 extern void abort (void);
8 struct S
{ int a
; int b
; int c
; };
10 int get_rr_node_index (int i
)
16 struct S
*rr_node
= nodes
;
17 volatile int io_rat
= 2;
21 int s_node
, p_node
, inode
, ipad
, iloop
;
23 for (ipad
= 0; ipad
< io_rat
; ipad
++)
25 p_node
= get_rr_node_index (ipad
+2);
26 inode
= get_rr_node_index (ipad
);
28 for (iloop
= 1; iloop
<= 2; iloop
++)
32 rr_node
[inode
].c
= ipad
;
45 if (rr_node
[0].a
!= rr_node
[1].a
46 || rr_node
[2].a
!= rr_node
[3].a
48 || rr_node
[0].b
!= rr_node
[1].b
49 || rr_node
[2].b
!= rr_node
[3].b