brintos

brintos / llvm-project-archived public Read only

0
0
Text · 723 B · c876266 Raw
26 lines · plain
1! Testcase adopted from the Fujitsu test suite:2! https://github.com/fujitsu/compiler-test-suite/blob/main/Fortran/0407/0407_0006.f903 4!RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=60 %s -o - | FileCheck %s5 6! Make sure that the variable in the atomic construct is privatized at7! the task level8 9!CHECK: omp.task private(@_QFfredEprv_firstprivate_i32 %{{[0-9]+}}#0 -> %arg010!CHECK: %[[DECL:[0-9]+]]:2 = hlfir.declare %arg0 {uniq_name = "_QFfredEprv"}11!CHECK: omp.atomic.update memory_order(relaxed) %[[DECL]]#012 13integer function fred14  integer :: prv15 16  prv = 117  !$omp parallel shared(prv)18  !$omp task default(firstprivate)19  !$omp atomic20  prv = prv + 121  !$omp end task22  !$omp end parallel23  fred = prv24end25 26