37 lines · plain
1! This test checks the lowering of parallel do2 3! RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir -fopenmp %s -o - \4! RUN: | FileCheck %s5 6! RUN: bbc -fopenmp -emit-fir -hlfir=false %s -o - \7! RUN: | FileCheck %s8 9! The string "EXPECTED" denotes the expected FIR10 11! CHECK: omp.parallel private(@{{.*}} %{{.*}} -> %[[PRIVATE_Y:.*]], @{{.*}} %{{.*}} -> %[[PRIVATE_Y:.*]] : !fir.ref<i32>, !fir.ref<i32>) {12! CHECK: %[[const_1:.*]] = arith.constant 1 : i3213! CHECK: %[[const_2:.*]] = arith.constant 10 : i3214! CHECK: %[[const_3:.*]] = arith.constant 1 : i3215! CHECK: omp.wsloop private(@{{.*}} %{{.*}} -> %[[TEMP:.*]] : !fir.ref<i32>) {16! CHECK-NEXT: omp.loop_nest (%[[ARG:.*]]) : i32 = (%[[const_1]]) to (%[[const_2]]) inclusive step (%[[const_3]]) {17! CHECK: hlfir.assign %[[ARG]] to %[[TEMP]] : i32, !fir.ref<i32>18! EXPECTED: %[[temp_1:.*]] = fir.load %[[PRIVATE_Z]] : !fir.ref<i32>19! CHECK: %[[temp_1:.*]] = fir.load %{{.*}} : !fir.ref<i32>20! CHECK: %[[temp_2:.*]] = fir.load %[[TEMP]] : !fir.ref<i32>21! CHECK: %[[result:.*]] = arith.addi %[[temp_1]], %[[temp_2]] : i3222! EXPECTED: fir.store %[[result]] to %[[PRIVATE_Y]] : !fir.ref<i32>23! CHECK: fir.store %[[result]] to %{{.*}} : !fir.ref<i32>24! CHECK: omp.yield25! CHECK: }26! CHECK: }27! CHECK: omp.terminator28! CHECK: }29subroutine nested_default_clause()30 integer x, y, z31 !$omp parallel do default(private)32 do x = 1, 1033 y = z + x34 enddo35 !$omp end parallel do36end subroutine37