[RISCV] Rename a lambda to have plural nouns to reflect that it contains a loop. NFC
[llvm-project.git] / flang / test / Lower / forall / forall-construct-4.f90
blob8134a2f7f271052d93d713f91aed3b62345edd4e
1 ! Test forall lowering
3 ! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s
5 !*** Test forall targeted by label
6 subroutine test4_forall_construct()
7 integer :: a(2) = 1
8 100 forall (i=1:2)
9 a(i) = a(i) + 1
10 end forall
11 if (a(1) > 3) goto 200
12 goto 100
13 200 return
14 end subroutine test4_forall_construct
16 ! CHECK-LABEL: func @_QPtest4_forall_construct
17 ! CHECK: cf.br ^bb1
18 ! CHECK: ^bb1: // 2 preds: ^bb0, ^bb2
19 ! CHECK: %{{.*}} = fir.do_loop
20 ! CHECK: cf.cond_br %{{.*}}, ^bb2, ^bb3
21 ! CHECK: ^bb2: // pred: ^bb1
22 ! CHECK: cf.br ^bb1
23 ! CHECK: ^bb3: // pred: ^bb1
24 ! CHECK: cf.br ^bb4
25 ! CHECK: ^bb4: // pred: ^bb3
26 ! CHECK: return
28 subroutine test4_forall_construct2()
29 integer :: a(2) = 1
30 100 forall (i=1:2) a(i) = a(i) + 1
31 if (a(1) > 3) goto 200
32 goto 100
33 200 return
34 end subroutine test4_forall_construct2
36 ! CHECK-LABEL: func @_QPtest4_forall_construct2
37 ! CHECK: cf.br ^bb1
38 ! CHECK: ^bb1: // 2 preds: ^bb0, ^bb2
39 ! CHECK: %{{.*}} = fir.do_loop
40 ! CHECK: cf.cond_br %{{.*}}, ^bb2, ^bb3
41 ! CHECK: ^bb2: // pred: ^bb1
42 ! CHECK: cf.br ^bb1
43 ! CHECK: ^bb3: // pred: ^bb1
44 ! CHECK: cf.br ^bb4
45 ! CHECK: ^bb4: // pred: ^bb3
46 ! CHECK: return