|
3 | 3 | ! RUN: bbc -fopenacc -emit-fir %s -o - | FileCheck %s --check-prefixes=CHECK,FIR
|
4 | 4 | ! RUN: bbc -fopenacc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK,HLFIR
|
5 | 5 |
|
| 6 | +! CHECK-LABEL: acc.private.recipe @privatization_ref_10xf32 : !fir.ref<!fir.array<10xf32>> init { |
| 7 | +! HLFIR: ^bb0(%[[ARG0:.*]]: !fir.ref<!fir.array<10xf32>>): |
| 8 | +! HLFIR: %[[C10:.*]] = arith.constant 10 : index |
| 9 | +! HLFIR: %[[SHAPE:.*]] = fir.shape %[[C10]] : (index) -> !fir.shape<1> |
| 10 | +! HLFIR: %[[ALLOCA:.*]] = fir.alloca !fir.array<10xf32> |
| 11 | +! HLFIR: %[[DECLARE:.*]]:2 = hlfir.declare %[[ALLOCA]](%[[SHAPE]]) {uniq_name = "acc.private.init"} : (!fir.ref<!fir.array<10xf32>>, !fir.shape<1>) -> (!fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) |
| 12 | +! HLFIR: acc.yield %[[DECLARE]]#0 : !fir.ref<!fir.array<10xf32>> |
| 13 | +! CHECK: } |
| 14 | + |
6 | 15 | ! CHECK-LABEL: acc.firstprivate.recipe @firstprivatization_ref_UxUx2xi32 : !fir.ref<!fir.array<?x?x2xi32>> init {
|
7 | 16 | ! CHECK: ^bb0(%[[ARG0:.*]]: !fir.ref<!fir.array<?x?x2xi32>>, %[[ARG1:.*]]: index, %[[ARG2:.*]]: index, %[[ARG3:.*]]: index):
|
8 | 17 | ! HLFIR: %[[SHAPE:.*]] = fir.shape %[[ARG1]], %[[ARG2]], %[[ARG3]] : (index, index, index) -> !fir.shape<3>
|
@@ -363,3 +372,17 @@ subroutine acc_firstprivate_dynamic_extent(a, n)
|
363 | 372 | end subroutine
|
364 | 373 |
|
365 | 374 | ! CHECK: acc.parallel firstprivate(@firstprivatization_ref_UxUx2xi32 -> %{{.*}} : !fir.ref<!fir.array<?x?x2xi32>>)
|
| 375 | + |
| 376 | +module acc_declare_equivalent |
| 377 | + integer, parameter :: n = 10 |
| 378 | + real :: v1(n) |
| 379 | + real :: v2(n) |
| 380 | + equivalence(v1(1), v2(1)) |
| 381 | +contains |
| 382 | + subroutine sub1() |
| 383 | + !$acc parallel private(v2) |
| 384 | + !$acc end parallel |
| 385 | + end subroutine |
| 386 | +end module |
| 387 | + |
| 388 | +! CHECK: acc.parallel private(@privatization_ref_10xf32 -> %{{.*}} : !fir.ref<!fir.array<10xf32>>) |
0 commit comments