IR: de-duplicate two CmpInst routines (NFC) (#116866)
[llvm-project.git] / flang / test / Lower / OpenACC / acc-shutdown.f90
blob6c080b932f92eef00b3b3fb1ecc08714340823f2
1 ! This test checks lowering of OpenACC shutdown directive.
3 ! RUN: bbc -fopenacc -emit-hlfir %s -o - | FileCheck %s
5 subroutine acc_shutdown
6 logical :: ifCondition = .TRUE.
8 !$acc shutdown
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(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>]}
28 end subroutine acc_shutdown