Skip to content

Commit 85e6ba8

Browse files
committed
Fix test added after rebase
Because this patch fixes the reference to the source variable for static length arrays, I had to change the array to be assumed shape (which slightly changed some other codegen).
1 parent cef4554 commit 85e6ba8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

flang/test/Lower/OpenMP/different_vars_lastprivate_barrier.f90

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
! RUN: %flang_fc1 -fopenmp -mmlir --openmp-enable-delayed-privatization-staging=true -emit-hlfir %s -o - | FileCheck %s
22

3-
subroutine first_and_lastprivate
3+
subroutine first_and_lastprivate(var)
44
integer i
5-
integer, dimension(3) :: var
5+
integer, dimension(:) :: var
66

77
!$omp parallel do lastprivate(i) private(var)
88
do i=1,1
99
end do
1010
!$omp end parallel do
1111
end subroutine
1212

13-
! CHECK: omp.private {type = private} @[[VAR_PRIVATIZER:.*Evar_private_box_3xi32]] : [[BOX_TYPE:!fir\.box<!fir\.array<3xi32>>]] init {
13+
! CHECK: omp.private {type = private} @[[VAR_PRIVATIZER:.*Evar_private_box_Uxi32]] : [[BOX_TYPE:!fir\.box<!fir\.array<\?xi32>>]] init {
1414
! CHECK-NEXT: ^bb0(%[[ORIG_REF:.*]]: {{.*}}, %[[PRIV_REF:.*]]: {{.*}}):
1515
! CHECK: %[[ORIG_VAL:.*]] = fir.load %[[ORIG_REF]]
16+
! CHECK: %[[BOX_DIMS_0:.*]]:3 = fir.box_dims %[[ORIG_VAL]], %{{.*}} : ([[BOX_TYPE]], index) -> (index, index, index)
1617
! CHECK: %[[BOX_DIMS:.*]]:3 = fir.box_dims %[[ORIG_VAL]], %{{.*}} : ([[BOX_TYPE]], index) -> (index, index, index)
1718
! CHECK: %[[SHAPE_SHIFT:.*]] = fir.shape_shift %[[BOX_DIMS]]#0, %[[BOX_DIMS]]#1
18-
! CHECK: %[[EMBOX:.*]] = fir.embox %{{.*}}(%[[SHAPE_SHIFT]]) : {{.*}} -> [[BOX_TYPE]]
19+
! CHECK: %[[EMBOX:.*]] = fir.rebox %{{.*}}(%[[SHAPE_SHIFT]]) : {{.*}} -> [[BOX_TYPE]]
1920
! CHECK: fir.store %[[EMBOX]] to %[[PRIV_REF]]
2021
! CHECK: omp.yield(%[[PRIV_REF]] : !fir.ref<[[BOX_TYPE]]>)
2122
! CHECK: }
2223

2324
! CHECK: omp.private {type = private} @[[I_PRIVATIZER:.*Ei_private_i32]] : i32
2425

25-
! CHECK: func.func @{{.*}}first_and_lastprivate()
26+
! CHECK: func.func @{{.*}}first_and_lastprivate({{.*}})
2627
! CHECK: %[[ORIG_I_DECL:.*]]:2 = hlfir.declare {{.*}} {uniq_name = "{{.*}}Ei"}
2728
! CHECK: omp.parallel {
2829
! CHECK-NOT: omp.barrier

0 commit comments

Comments
 (0)