Debian Codegraph @

flang/test/Lower/OpenMP/firstprivate-allocatable.f90

raw
1 ! RUN: bbc -emit-hlfir -fopenmp -o - %s | FileCheck %s
2 ! RUN: %flang_fc1 -emit-hlfir -fopenmp -o - %s | FileCheck %s
3
4 program firstprivateallocatable
5 Integer, Allocatable :: a,u
6 a = 137
7
8 !$omp parallel firstprivate(a,u)
9 u = a**2
10 !$omp end parallel
11 end program
12
13
14 ! CHECK-LABEL: func.func @_QQmain()
15 ! [...]
16 ! CHECK: omp.parallel {
17 ! [...]
18 ! CHECK: %[[VAL_50:.*]] = arith.constant 2 : i32
19 ! CHECK: %[[VAL_51:.*]] = math.ipowi %{{.*}}, %[[VAL_50]] : i32
20 ! this is what we are really checking: the hlfir.assign must have realloc so that
21 ! u is allocated when the assignment occurs
22 ! CHECK: hlfir.assign %[[VAL_51]] to %{{.*}}#0 realloc : i32, !fir.ref<!fir.box<!fir.heap<i32>>>
23 ! [...]
24 ! CHECK: omp.terminator
25 ! CHECK: }