1! This test checks lowering of OpenACC wait directive. 2 3! RUN: bbc -fopenacc -emit-hlfir %s -o - | FileCheck %s 4 5subroutine acc_update 6 integer :: async = 1 7 logical :: ifCondition = .TRUE. 8 9 !$acc wait 10!CHECK: acc.wait{{ *}}{{$}} 11 12 !$acc wait if(.true.) 13!CHECK: [[IF1:%.*]] = arith.constant true 14!CHECK: acc.wait if([[IF1]]){{$}} 15 16 !$acc wait if(ifCondition) 17!CHECK: [[IFCOND:%.*]] = fir.load %{{.*}} : !fir.ref<!fir.logical<4>> 18!CHECK: [[IF2:%.*]] = fir.convert [[IFCOND]] : (!fir.logical<4>) -> i1 19!CHECK: acc.wait if([[IF2]]){{$}} 20 21 !$acc wait(1, 2) 22!CHECK: [[WAIT1:%.*]] = arith.constant 1 : i32 23!CHECK: [[WAIT2:%.*]] = arith.constant 2 : i32 24!CHECK: acc.wait([[WAIT1]], [[WAIT2]] : i32, i32){{ *}}{{$}} 25 26 !$acc wait(1) async 27!CHECK: [[WAIT3:%.*]] = arith.constant 1 : i32 28!CHECK: acc.wait([[WAIT3]] : i32) attributes {async} 29 30 !$acc wait(1) async(async) 31!CHECK: [[WAIT3:%.*]] = arith.constant 1 : i32 32!CHECK: [[ASYNC1:%.*]] = fir.load %{{.*}} : !fir.ref<i32> 33!CHECK: acc.wait([[WAIT3]] : i32) async([[ASYNC1]] : i32){{$}} 34 35 !$acc wait(devnum: 3: queues: 1, 2) 36!CHECK: [[WAIT1:%.*]] = arith.constant 1 : i32 37!CHECK: [[WAIT2:%.*]] = arith.constant 2 : i32 38!CHECK: [[DEVNUM:%.*]] = arith.constant 3 : i32 39!CHECK: acc.wait([[WAIT1]], [[WAIT2]] : i32, i32) wait_devnum([[DEVNUM]] : i32){{$}} 40 41end subroutine acc_update 42