Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Lower / OpenMP / Todo / omp-default-clause-inner-loop.f90
blobfd56038231b195a0939baecaa3d62b41b6452e55
1 ! This test checks the lowering of parallel do
3 ! RUN: %flang_fc1 -emit-fir -fopenmp %s -o - | FileCheck %s
4 ! RUN: bbc -fopenmp -emit-fir %s -o - | FileCheck %s
6 ! The string "EXPECTED" denotes the expected FIR
8 ! CHECK: omp.parallel {
9 ! EXPECTED: %[[PRIVATE_Y:.*]] = fir.alloca i32 {bindc_name = "y", pinned, uniq_name = "_QFEy"}
10 ! EXPECTED: %[[PRIVATE_Z:.*]] = fir.alloca i32 {bindc_name = "z", pinned, uniq_name = "_QFEz"}
11 ! CHECK: %[[TEMP:.*]] = fir.alloca i32 {adapt.valuebyref, pinned}
12 ! CHECK: %[[const_1:.*]] = arith.constant 1 : i32
13 ! CHECK: %[[const_2:.*]] = arith.constant 10 : i32
14 ! CHECK: %[[const_3:.*]] = arith.constant 1 : i32
15 ! CHECK: omp.wsloop for (%[[ARG:.*]]) : i32 = (%[[const_1]]) to (%[[const_2]]) inclusive step (%[[const_3]]) {
16 ! CHECK: fir.store %[[ARG]] to %[[TEMP]] : !fir.ref<i32>
17 ! EXPECTED: %[[temp_1:.*]] = fir.load %[[PRIVATE_Z]] : !fir.ref<i32>
18 ! CHECK: %[[temp_1:.*]] = fir.load %{{.*}} : !fir.ref<i32>
19 ! CHECK: %[[temp_2:.*]] = fir.load %[[TEMP]] : !fir.ref<i32>
20 ! CHECK: %[[result:.*]] = arith.addi %[[temp_1]], %[[temp_2]] : i32
21 ! EXPECTED: fir.store %[[result]] to %[[PRIVATE_Y]] : !fir.ref<i32>
22 ! CHECK: fir.store %[[result]] to %{{.*}} : !fir.ref<i32>
23 ! CHECK: omp.yield
24 ! CHECK: }
25 ! CHECK: omp.terminator
26 ! CHECK: }
27 subroutine nested_default_clause()
28 integer x, y, z
29 !$omp parallel do default(private)
30 do x = 1, 10
31 y = z + x
32 enddo
33 !$omp end parallel do
34 end subroutine