35 lines · plain
1! Tests delayed privatization for `targets ... private(..)` for simple variables.2 3! RUN: %flang_fc1 -emit-hlfir -fopenmp -mmlir --enable-delayed-privatization-staging \4! RUN: -o - %s 2>&1 | FileCheck %s5! RUN: bbc -emit-hlfir -fopenmp --enable-delayed-privatization-staging -o - %s 2>&1 \6! RUN: | FileCheck %s7 8subroutine target_simple9 implicit none10 integer :: simple_var11 12 !$omp target private(simple_var)13 simple_var = 1014 !$omp end target15end subroutine target_simple16 17! CHECK-LABEL: omp.private {type = private}18! CHECK-SAME: @[[VAR_PRIVATIZER_SYM:.*]] : i3219 20! CHECK-LABEL: func.func @_QPtarget_simple() {21! CHECK: %[[VAR_ALLOC:.*]] = fir.alloca i32 {bindc_name = "simple_var", {{.*}}}22! CHECK: %[[VAR_DECL:.*]]:2 = hlfir.declare %[[VAR_ALLOC]]23 24! CHECK: omp.target private(25! CHECK-SAME: @[[VAR_PRIVATIZER_SYM]] %[[VAR_DECL]]#0 -> %[[REG_ARG:.*]] : !fir.ref<i32>) {26! CHECK: %[[REG_DECL:.*]]:2 = hlfir.declare %[[REG_ARG]]27! CHECK: %[[C10:.*]] = arith.constant 1028! CHECK: hlfir.assign %[[C10]] to %[[REG_DECL]]#029! CHECK: omp.terminator30! CHECK: }31 32! CHECK: return33! CHECK: }34 35