1 ! This test checks lowering of OpenACC wait directive.
3 ! RUN: bbc -fopenacc -emit-fir %s -o - | FileCheck %s
7 logical :: ifCondition
= .TRUE
.
13 !CHECK: [[IF1:%.*]] = arith.constant true
14 !CHECK: acc.wait if([[IF1]]){{$}}
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]]){{$}}
22 !CHECK: [[WAIT1:%.*]] = arith.constant 1 : i32
23 !CHECK: [[WAIT2:%.*]] = arith.constant 2 : i32
24 !CHECK: acc.wait([[WAIT1]], [[WAIT2]] : i32, i32){{$}}
27 !CHECK: [[WAIT3:%.*]] = arith.constant 1 : i32
28 !CHECK: acc.wait([[WAIT3]] : i32) attributes {async}
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){{$}}
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){{$}}
41 end subroutine acc_update