[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / flang / test / Lower / OpenACC / acc-wait.f90
blob604fa5b3d6f9905eb705242092c5b10728ebb95d
1 ! This test checks lowering of OpenACC wait directive.
3 ! RUN: bbc -fopenacc -emit-fir %s -o - | FileCheck %s
4 ! RUN: bbc -fopenacc -emit-hlfir %s -o - | FileCheck %s
6 subroutine acc_update
7 integer :: async = 1
8 logical :: ifCondition = .TRUE.
10 !$acc wait
11 !CHECK: acc.wait{{ *}}{{$}}
13 !$acc wait if(.true.)
14 !CHECK: [[IF1:%.*]] = arith.constant true
15 !CHECK: acc.wait if([[IF1]]){{$}}
17 !$acc wait if(ifCondition)
18 !CHECK: [[IFCOND:%.*]] = fir.load %{{.*}} : !fir.ref<!fir.logical<4>>
19 !CHECK: [[IF2:%.*]] = fir.convert [[IFCOND]] : (!fir.logical<4>) -> i1
20 !CHECK: acc.wait if([[IF2]]){{$}}
22 !$acc wait(1, 2)
23 !CHECK: [[WAIT1:%.*]] = arith.constant 1 : i32
24 !CHECK: [[WAIT2:%.*]] = arith.constant 2 : i32
25 !CHECK: acc.wait([[WAIT1]], [[WAIT2]] : i32, i32){{ *}}{{$}}
27 !$acc wait(1) async
28 !CHECK: [[WAIT3:%.*]] = arith.constant 1 : i32
29 !CHECK: acc.wait([[WAIT3]] : i32) attributes {async}
31 !$acc wait(1) async(async)
32 !CHECK: [[WAIT3:%.*]] = arith.constant 1 : i32
33 !CHECK: [[ASYNC1:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
34 !CHECK: acc.wait([[WAIT3]] : i32) async([[ASYNC1]] : i32){{$}}
36 !$acc wait(devnum: 3: queues: 1, 2)
37 !CHECK: [[WAIT1:%.*]] = arith.constant 1 : i32
38 !CHECK: [[WAIT2:%.*]] = arith.constant 2 : i32
39 !CHECK: [[DEVNUM:%.*]] = arith.constant 3 : i32
40 !CHECK: acc.wait([[WAIT1]], [[WAIT2]] : i32, i32) wait_devnum([[DEVNUM]] : i32){{$}}
42 end subroutine acc_update