Skip to content

Commit 110fefa

Browse files
committed
Fix test failure with non default component lower bounds
forall.f90 tested used non-default array component lower bounds. Lowering does not implement this correctly yet and a TODO was added for this which now fires in the test.
1 parent 305d05a commit 110fefa

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

flang/test/Lower/forall.f90

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ pure integer function f(i)
10341034
end function f
10351035
end interface
10361036
type t
1037-
integer :: arr(5:15)
1037+
integer :: arr(11)
10381038
end type t
10391039
type(t) :: a(10,10)
10401040

@@ -1115,7 +1115,7 @@ pure integer function f(i)
11151115
end function f
11161116
end interface
11171117
type t
1118-
integer :: arr(5:15)
1118+
integer :: arr(11)
11191119
end type t
11201120
type(t) :: a(10,10)
11211121

@@ -1132,9 +1132,7 @@ end function f
11321132
forall (i=1:5)
11331133
! CHECK: %[[V_7:.*]] = fir.call @_QPf(%[[VAL_0]]) : (!fir.ref<i32>) -> i32
11341134
! CHECK-DAG: %[[V_8:.*]] = fir.load %[[VAL_0]] : !fir.ref<i32>
1135-
! CHECK-DAG: %[[V_9:.*]] = constant 4 : i32
1136-
! CHECK: %[[V_10:.*]] = addi %[[V_8]], %[[V_9]] : i32
1137-
! CHECK: %[[V_11:.*]] = fir.convert %[[V_10]] : (i32) -> i64
1135+
! CHECK: %[[V_11:.*]] = fir.convert %[[V_8]] : (i32) -> i64
11381136
! CHECK: %[[V_12:.*]] = fir.convert %[[V_11]] : (i64) -> index
11391137
! CHECK: %[[V_13:.*]] = fir.field_index arr, !fir.type<_QFtest_forall_with_ranked_dimensionTt{arr:!fir.array<11xi32>}>
11401138
! CHECK: %[[V_14:.*]] = constant 1 : i64
@@ -1148,7 +1146,7 @@ end function f
11481146
! CHECK: }
11491147
! CHECK: fir.result %[[V_4]] : !fir.array<10x10x!fir.type<_QFtest_forall_with_ranked_dimensionTt{arr:!fir.array<11xi32>}>>
11501148
! CHECK: }
1151-
a(i,:)%arr(i+4) = f(i)
1149+
a(i,:)%arr(i) = f(i)
11521150
end forall
11531151
! CHECK: fir.array_merge_store %[[VAL_5]], %[[V_0]] to %[[VAL_3]] : !fir.array<10x10x!fir.type<_QFtest_forall_with_ranked_dimensionTt{arr:!fir.array<11xi32>}>>, !fir.array<10x10x!fir.type<_QFtest_forall_with_ranked_dimensionTt{arr:!fir.array<11xi32>}>>, !fir.ref<!fir.array<10x10x!fir.type<_QFtest_forall_with_ranked_dimensionTt{arr:!fir.array<11xi32>}>>>
11541152
! CHECK: return

0 commit comments

Comments
 (0)