IR: de-duplicate two CmpInst routines (NFC) (#116866)
[llvm-project.git] / flang / test / Lower / assigned-goto.f90
blob4184839337de1841c9b91939b22cfb377e7e5f0b
1 ! RUN: bbc -emit-fir -o - %s | FileCheck %s
3 ! CHECK-LABEL: func @_QPnolist
4 subroutine nolist
5 integer L, V
6 11 V = 1
7 ! CHECK: fir.store %c31{{.*}} to %{{.}}
8 assign 31 to L
9 ! CHECK: fir.select %{{.}} : i32 [31, ^bb{{.}}, unit, ^bb{{.}}]
10 ! CHECK: fir.call @_FortranAReportFatalUserError
11 goto L ! no list
12 21 V = 2
13 go to 41
14 31 V = 3
15 41 print*, 3, V
16 end
18 ! CHECK-LABEL: func @_QPlist
19 subroutine list
20 integer L, L1, V
21 66 format("Nonsense")
22 assign 66 to L
23 assign 42 to L1
24 ! CHECK: fir.store %c22{{.*}} to %{{.}}
25 assign 22 to L
26 12 V = 100
27 ! CHECK: fir.store %c32{{.*}} to %{{.}}
28 assign 32 to L
29 ! CHECK: fir.select %{{.}} : i32 [22, ^bb{{.}}, 32, ^bb{{.}}, unit, ^bb{{.}}]
30 ! CHECK: fir.call @_FortranAReportFatalUserError
31 goto L (42, 32, 22, 32, 32) ! duplicate labels are allowed
32 22 V = 200
33 go to 42
34 32 V = 300
35 42 print*, 300, V
36 end
38 call nolist
39 call list
40 end