1 ! This test checks lowering of OpenACC shutdown directive.
3 ! RUN: bbc -fopenacc -emit-fir %s -o - | FileCheck %s
5 subroutine acc_shutdown
6 logical :: ifCondition
= .TRUE
.
9 !CHECK: acc.shutdown{{$}}
11 !$acc shutdown if(.true.)
12 !CHECK: [[IF1:%.*]] = arith.constant true
13 !CHECK: acc.shutdown if([[IF1]]){{$}}
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]]){{$}}
20 !$acc shutdown device_num(1)
21 !CHECK: [[DEVNUM:%.*]] = arith.constant 1 : i32
22 !CHECK: acc.shutdown device_num([[DEVNUM]] : i32){{$}}
24 !$acc shutdown device_num(1) device_type(1, 2)
25 !CHECK: [[DEVNUM:%.*]] = arith.constant 1 : i32
26 !CHECK: [[DEVTYPE1:%.*]] = arith.constant 1 : i32
27 !CHECK: [[DEVTYPE2:%.*]] = arith.constant 2 : i32
28 !CHECK: acc.shutdown device_type([[DEVTYPE1]], [[DEVTYPE2]] : i32, i32) device_num([[DEVNUM]] : i32){{$}}
30 end subroutine acc_shutdown