1 ! RUN: bbc %s -emit-fir -o - | FileCheck %s
3 ! Test trivial goto statement
9 ! CHECK: cf.br ^[[BB1:.*]]
11 ! CHECK: {{.*}} fir.call @_FortranAStopStatement({{.*}}, {{.*}}, {{.*}}) {{.*}}: (i32, i1, i1) -> none
14 ! Test multiple goto statements
22 ! CHECK: cf.br ^[[BB1:.*]]
24 ! CHECK: cf.br ^[[BB2:.*]]
26 ! CHECK: cf.br ^[[BB3:.*]]
28 ! CHECK: {{.*}} fir.call @_FortranAStopStatement({{.*}}, {{.*}}, {{.*}}) {{.*}}: (i32, i1, i1) -> none
31 ! Test goto which branches to a previous label
39 ! CHECK: {{.*}} fir.call @_FortranAPauseStatement() {{.*}}: () -> none
40 ! CHECK: cf.br ^[[BB2:.*]]
41 ! CHECK: ^[[BB1:.*]]: //
42 ! CHECK: {{.*}} fir.call @_FortranAStopStatement({{.*}}, {{.*}}, {{.*}}) {{.*}}: (i32, i1, i1) -> none
44 ! CHECK: cf.br ^[[BB1]]
47 ! Test removal of blocks (pauses) which are not reachable
58 ! CHECK: {{.*}} fir.call @_FortranAPauseStatement() {{.*}}: () -> none
59 ! CHECK-NEXT: cf.br ^[[BB1:.*]]
60 ! CHECK-NEXT: ^[[BB1]]:
61 ! CHECK-NEXT: cf.br ^[[BB2:.*]]
62 ! CHECK-NEXT: ^[[BB2]]:
63 ! CHECK-NEXT: cf.br ^[[BB3:.*]]
64 ! CHECK-NEXT: ^[[BB3]]:
65 ! CHECK-NEXT: cf.br ^[[BB1]]