[LLVM] Fix Maintainers.md formatting (NFC)
[llvm-project.git] / flang / test / Lower / OpenACC / stop-stmt-in-region.f90
blob2694a1531d1693413f5d7f16b3481fa1be3d7e15
1 ! This test checks lowering of stop statement in OpenACC region.
3 ! RUN: bbc -fopenacc -emit-hlfir %s -o - | FileCheck %s
4 ! RUN: %flang_fc1 -emit-hlfir -fopenacc %s -o - | FileCheck %s
6 ! CHECK-LABEL: func.func @_QPtest_stop_in_region1() {
7 ! CHECK: acc.parallel {
8 ! CHECK: %[[VAL_0:.*]] = arith.constant 1 : i32
9 ! CHECK: %[[VAL_1:.*]] = arith.constant false
10 ! CHECK: %[[VAL_2:.*]] = arith.constant false
11 ! CHECK: %[[VAL_3:.*]] = fir.call @_FortranAStopStatement(%[[VAL_0]], %[[VAL_1]], %[[VAL_2]]) {{.*}} : (i32, i1, i1) -> none
12 ! CHECK: acc.yield
13 ! CHECK: }
14 ! CHECK: return
15 ! CHECK: }
17 subroutine test_stop_in_region1()
18 !$acc parallel
19 stop 1
20 !$acc end parallel
21 end
23 ! CHECK-LABEL: func.func @_QPtest_stop_in_region2() {
24 ! CHECK: %[[VAL_0:.*]] = fir.alloca i32 {bindc_name = "x", uniq_name = "_QFtest_stop_in_region2Ex"}
25 ! CHECK: acc.parallel {
26 ! CHECK: %[[VAL_1:.*]] = arith.constant 1 : i32
27 ! CHECK: %[[VAL_2:.*]] = arith.constant false
28 ! CHECK: %[[VAL_3:.*]] = arith.constant false
29 ! CHECK: %[[VAL_4:.*]] = fir.call @_FortranAStopStatement(%[[VAL_1]], %[[VAL_2]], %[[VAL_3]]) {{.*}} : (i32, i1, i1) -> none
30 ! CHECK: acc.yield
31 ! CHECK: }
32 ! CHECK: return
33 ! CHECK: }
35 subroutine test_stop_in_region2()
36 integer :: x
37 !$acc parallel
38 stop 1
39 x = 2
40 !$acc end parallel
41 end