1 ! This test checks lowering of OpenACC set directive.
3 ! RUN: bbc -fopenacc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK,HLFIR
8 !$acc set default_async(1)
10 !$acc set default_async(1) if(l)
12 !$acc set device_num(0)
14 !$acc set device_type(*)
16 !$acc set device_type(multicore)
20 ! CHECK-LABEL: func.func @_QQmain()
21 ! CHECK: %[[L:.*]] = fir.alloca !fir.logical<4> {bindc_name = "l", uniq_name = "_QFEl"}
22 ! HLFIR: %[[DECLL:.*]]:2 = hlfir.declare %[[L]] {uniq_name = "_QFEl"}
24 ! CHECK: %[[C1:.*]] = arith.constant 1 : i32
25 ! CHECK: acc.set default_async(%[[C1]] : i32)
27 ! CHECK: %[[C1:.*]] = arith.constant 1 : i32
28 ! FIR: %[[LOAD_L:.*]] = fir.load %[[L]] : !fir.ref<!fir.logical<4>>
29 ! HLFIR: %[[LOAD_L:.*]] = fir.load %[[DECLL]]#0 : !fir.ref<!fir.logical<4>>
30 ! CHECK: %[[CONV_L:.*]] = fir.convert %[[LOAD_L]] : (!fir.logical<4>) -> i1
31 ! CHECK: acc.set default_async(%[[C1]] : i32) if(%[[CONV_L]])
33 ! CHECK: %[[C0:.*]] = arith.constant 0 : i32
34 ! CHECK: acc.set device_num(%[[C0]] : i32)
36 ! CHECK: acc.set attributes {device_type = #acc.device_type<star>}
38 ! CHECK: acc.set attributes {device_type = #acc.device_type<multicore>}