| 1 |
! This test checks lowering of OpenACC shutdown directive. |
| 2 |
|
| 3 |
! RUN: bbc -fopenacc -emit-hlfir %s -o - | FileCheck %s |
| 4 |
|
| 5 |
subroutine acc_shutdown |
| 6 |
logical :: ifCondition = .TRUE. |
| 7 |
|
| 8 |
!$acc shutdown |
| 9 |
!CHECK: acc.shutdown{{ *}}{{$}} |
| 10 |
|
| 11 |
!$acc shutdown if(.true.) |
| 12 |
!CHECK: [[IF1:%.*]] = arith.constant true |
| 13 |
!CHECK: acc.shutdown if([[IF1]]){{$}} |
| 14 |
|
| 15 |
!$acc shutdown if(ifCondition) |
| 16 |
!CHECK: [[IFCOND:%.*]] = fir.load %{{.*}} : !fir.ref<!fir.logical<4>> |
| 17 |
!CHECK: [[IF2:%.*]] = fir.convert [[IFCOND]] : (!fir.logical<4>) -> i1 |
| 18 |
!CHECK: acc.shutdown if([[IF2]]){{$}} |
| 19 |
|
| 20 |
!$acc shutdown device_num(1) |
| 21 |
!CHECK: [[DEVNUM:%.*]] = arith.constant 1 : i32 |
| 22 |
!CHECK: acc.shutdown device_num([[DEVNUM]] : i32){{$}} |
| 23 |
|
| 24 |
!$acc shutdown device_num(1) device_type(default, nvidia) |
| 25 |
!CHECK: [[DEVNUM:%.*]] = arith.constant 1 : i32 |
| 26 |
!CHECK: acc.shutdown device_num([[DEVNUM]] : i32) attributes {device_types = [#acc.device_type<default>, #acc.device_type<nvidia>]} |
| 27 |
|
| 28 |
end subroutine acc_shutdown |