brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · d0f7ef6 Raw
55 lines · plain
1! Test delayed privatization for the `CHARACTER` type.2 3! RUN: split-file %s %t4 5! RUN: %flang_fc1 -emit-hlfir -fopenmp -mmlir --enable-delayed-privatization \6! RUN:   -o - %t/dyn_len.f90 2>&1 | FileCheck %s --check-prefix=DYN_LEN7! RUN: bbc -emit-hlfir -fopenmp --enable-delayed-privatization -o - %t/dyn_len.f90 2>&1 \8! RUN:   | FileCheck %s --check-prefix=DYN_LEN9 10! RUN: %flang_fc1 -emit-hlfir -fopenmp -mmlir --enable-delayed-privatization \11! RUN:   -o - %t/static_len.f90 2>&1 | FileCheck %s --check-prefix=STATIC_LEN12! RUN: bbc -emit-hlfir -fopenmp --enable-delayed-privatization -o - %t/static_len.f90 2>&1 \13! RUN:   | FileCheck %s --check-prefix=STATIC_LEN14 15!--- dyn_len.f9016subroutine delayed_privatization_character(var1, l)17  implicit none18  integer(8):: l19  character(len = l)  :: var120 21!$omp parallel firstprivate(var1)22  var1 = "test"23!$omp end parallel24end subroutine25 26! DYN_LEN-LABEL: omp.private {type = firstprivate}27! DYN_LEN-SAME: @[[PRIVATIZER_SYM:.*]] : [[TYPE:!fir.boxchar<1>]] init {28 29! DYN_LEN-NEXT: ^bb0(%[[PRIV_ARG:.*]]: [[TYPE]], %[[ALLOC_ARG:.*]]: [[TYPE]]):30! DYN_LEN-NEXT:   %[[UNBOX:.*]]:2 = fir.unboxchar %[[PRIV_ARG]]31! DYN_LEN-NEXT:   %[[PRIV_ALLOC:.*]] = fir.allocmem !fir.char<1,?>(%[[UNBOX]]#1 : index)32! DYN_LEN-NEXT:   %[[EMBOXCHAR:.*]] = fir.emboxchar %[[PRIV_ALLOC]], %[[UNBOX]]#133! DYN_LEN:        omp.yield(%[[EMBOXCHAR]] : !fir.boxchar<1>)34 35! DYN_LEN-NEXT: } copy {36! DYN_LEN-NEXT: ^bb0(%[[PRIV_ORIG_ARG:.*]]: [[TYPE]], %[[PRIV_PRIV_ARG:.*]]: [[TYPE]]):37 38! DYN_LEN-NEXT:   hlfir.assign %[[PRIV_ORIG_ARG]] to %[[PRIV_PRIV_ARG]]39 40! DYN_LEN-NEXT:   omp.yield(%[[PRIV_PRIV_ARG]] : !fir.boxchar<1>)41! DYN_LEN-NEXT: }42 43!--- static_len.f9044subroutine delayed_privatization_character_static_len(var1)45  implicit none46  character(len = 10)  :: var147 48!$omp parallel private(var1)49  var1 = "test"50!$omp end parallel51end subroutine52 53! STATIC_LEN-LABEL: omp.private {type = private}54! STATIC_LEN-SAME: @[[PRIVATIZER_SYM:.*]] : [[TYPE:!fir.char<1,10>]]55