@@ -126,6 +126,9 @@ def test_loop_navigation_properties():
126126 loop .addchild (Literal ("1" , ScalarType .integer_single_type ()))
127127
128128 # If it's not fully complete, it still returns an error
129+ with pytest .raises (InternalError ) as err :
130+ _ = loop .variable_reference
131+ assert error_str in str (err .value )
129132 with pytest .raises (InternalError ) as err :
130133 _ = loop .start_expr
131134 assert error_str in str (err .value )
@@ -143,6 +146,7 @@ def test_loop_navigation_properties():
143146 loop .addchild (Schedule (parent = loop ))
144147 loop .loop_body .addchild (Return (parent = loop .loop_body ))
145148
149+ assert loop .variable_reference .name == "i"
146150 assert loop .start_expr .value == "0"
147151 assert loop .stop_expr .value == "2"
148152 assert loop .step_expr .value == "1"
@@ -274,7 +278,7 @@ def test_loop_create(fortran_writer):
274278 Reference (DataSymbol ("i" , ScalarType .real_single_type ())))
275279 loop = Loop .create (DataSymbol ("i" , ScalarType .integer_single_type ()),
276280 start , stop , step , [child_node ])
277- ref = loop .children [ 0 ]
281+ ref = loop .variable_reference
278282 schedule = loop .loop_body
279283 assert isinstance (schedule , Schedule )
280284 check_links (loop , [ref , start , stop , step , schedule ])
0 commit comments