[LLVM] Fix Maintainers.md formatting (NFC)
[llvm-project.git] / flang / test / Lower / OpenACC / acc-loop-exit.f90
blob85394e4a5b74c7f7711d92a5f1e7fc000d809145
1 ! RUN: bbc -fopenacc -emit-hlfir %s -o - | FileCheck %s
3 subroutine sub1(x, a)
4 real :: x(200)
5 integer :: a
7 !$acc loop
8 do i = 100, 200
9 x(i) = 1.0
10 if (i == a) return
11 end do
13 i = 2
14 end
16 ! CHECK-LABEL: func.func @_QPsub1
17 ! CHECK: %[[A:.*]]:2 = hlfir.declare %arg1 dummy_scope %{{[0-9]+}} {uniq_name = "_QFsub1Ea"} : (!fir.ref<i32>, !fir.dscope) -> (!fir.ref<i32>, !fir.ref<i32>)
18 ! CHECK: %[[I:.*]]:2 = hlfir.declare %{{[0-9]+}} {uniq_name = "_QFsub1Ei"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)
19 ! CHECK: %[[I:.*]]:2 = hlfir.declare %{{[0-9]+}} {uniq_name = "_QFsub1Ei"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)
20 ! CHECK: %[[EXIT_COND:.*]] = acc.loop
21 ! CHECK: ^bb{{.*}}:
22 ! CHECK: ^bb{{.*}}:
23 ! CHECK: %[[LOAD_I:.*]] = fir.load %[[I]]#0 : !fir.ref<i32>
24 ! CHECK: %[[LOAD_I:.*]] = fir.load %[[I]]#0 : !fir.ref<i32>
25 ! CHECK: %[[LOAD_A:.*]] = fir.load %[[A]]#0 : !fir.ref<i32>
26 ! CHECK: %[[CMP:.*]] = arith.cmpi eq, %[[LOAD_I]], %[[LOAD_A]] : i32
27 ! CHECK: cf.cond_br %[[CMP]], ^[[EARLY_RET:.*]], ^[[NO_RET:.*]]
28 ! CHECK: ^[[EARLY_RET]]:
29 ! CHECK: acc.yield %true : i1
30 ! CHECK: ^[[NO_RET]]:
31 ! CHECK: cf.br ^bb{{.*}}
32 ! CHECK: ^bb{{.*}}:
33 ! CHECK: acc.yield %false : i1
34 ! CHECK: }(i1)
35 ! CHECK: cf.cond_br %[[EXIT_COND]], ^[[EXIT_BLOCK:.*]], ^[[CONTINUE_BLOCK:.*]]
36 ! CHECK: ^[[CONTINUE_BLOCK]]:
37 ! CHECK: hlfir.assign
38 ! CHECK: cf.br ^[[EXIT_BLOCK]]
39 ! CHECK: ^[[EXIT_BLOCK]]:
40 ! CHECK: return
41 ! CHECK: }