brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 6cefda8 Raw
43 lines · plain
1! RUN: %flang_fc1 -emit-hlfir -fopenmp \2! RUN:   -o - %s 2>&1 | FileCheck %s3! RUN: bbc -emit-hlfir -fopenmp  -o - %s 2>&1 \4! RUN:   | FileCheck %s5 6subroutine wsloop_private7    implicit none8    integer :: x, i9 10    !$omp parallel do firstprivate(x)11    do i = 0, 1012      x = x + i13    end do14end subroutine wsloop_private15 16! CHECK: omp.private {type = private} @[[I_PRIVATIZER:.*i_private_i32]]17! CHECK: omp.private {type = firstprivate} @[[X_PRIVATIZER:.*x_firstprivate_i32]]18 19! CHECK: func.func @{{.*}}() {20! CHECK:   %[[I_DECL:.*]]:2 = hlfir.declare %{{.*}} {uniq_name = "{{.*}}i"}21! CHECK:   %[[X_DECL:.*]]:2 = hlfir.declare %{{.*}} {uniq_name = "{{.*}}x"}22 23! CHECK:   omp.parallel {24! CHECK:     omp.wsloop private(25! CHECK-SAME:  @[[X_PRIVATIZER]] %[[X_DECL]]#0 -> %[[X_ARG:[^[:space:]]+]],26! CHECK-SAME:  @[[I_PRIVATIZER]] %[[I_DECL]]#0 -> %[[I_ARG:.*]] : {{.*}}) {27 28! CHECK:       omp.loop_nest (%[[IV:.*]]) : i32 = {{.*}} {29! CHECK:         %[[X_PRIV_DECL:.*]]:2 = hlfir.declare %[[X_ARG]] {uniq_name = "{{.*}}x"}30! CHECK:         %[[I_PRIV_DECL:.*]]:2 = hlfir.declare %[[I_ARG]] {uniq_name = "{{.*}}i"}31! CHECK:         hlfir.assign %[[IV]] to %[[I_PRIV_DECL]]#032! CHECK:         %[[X_VAL:.*]] = fir.load %[[X_PRIV_DECL]]#033! CHECK:         %[[I_VAL:.*]] = fir.load %[[I_PRIV_DECL]]#034! CHECK:         %[[ADD_VAL:.*]] = arith.addi %[[X_VAL]], %[[I_VAL]]35! CHECK:         hlfir.assign %[[ADD_VAL]] to %[[X_PRIV_DECL]]#036! CHECK:         omp.yield37! CHECK:       }38! CHECK:     }39 40! CHECK:     omp.terminator41! CHECK:   }42! CHECK: }43