@@ -11,10 +11,14 @@ void label() {
1111}
1212
1313// CIR: cir.func no_proto dso_local @label
14+ // CIR: cir.br ^bb1
15+ // CIR: ^bb1:
1416// CIR: cir.label "labelA"
1517// CIR: cir.return
1618
1719// LLVM:define dso_local void @label
20+ // LLVM: br label %1
21+ // LLVM: 1:
1822// LLVM: ret void
1923
2024// OGCG: define dso_local void @label
@@ -29,15 +33,19 @@ void multiple_labels() {
2933}
3034
3135// CIR: cir.func no_proto dso_local @multiple_labels
32- // CIR: cir.label "labelB"
3336// CIR: cir.br ^bb1
34- // CIR: ^bb1: // pred: ^bb0
37+ // CIR: ^bb1:
38+ // CIR: cir.label "labelB"
39+ // CIR: cir.br ^bb2
40+ // CIR: ^bb2:
3541// CIR: cir.label "labelC"
3642// CIR: cir.return
3743
3844// LLVM: define dso_local void @multiple_labels()
3945// LLVM: br label %1
4046// LLVM: 1:
47+ // LLVM: br label %2
48+ // LLVM: 2:
4149// LLVM: ret void
4250
4351// OGCG: define dso_local void @multiple_labels
@@ -56,6 +64,8 @@ void label_in_if(int cond) {
5664
5765// CIR: cir.func dso_local @label_in_if
5866// CIR: cir.if {{.*}} {
67+ // CIR: cir.br ^bb1
68+ // CIR: ^bb1:
5969// CIR: cir.label "labelD"
6070// CIR: [[LOAD:%.*]] = cir.load align(4) [[COND:%.*]] : !cir.ptr<!s32i>, !s32i
6171// CIR: [[INC:%.*]] = cir.unary(inc, %3) nsw : !s32i, !s32i
@@ -68,15 +78,17 @@ void label_in_if(int cond) {
6878// LLVM: 3:
6979// LLVM: [[LOAD:%.*]] = load i32, ptr [[COND:%.*]], align 4
7080// LLVM: [[CMP:%.*]] = icmp ne i32 [[LOAD]], 0
71- // LLVM: br i1 [[CMP]], label %6, label %9
81+ // LLVM: br i1 [[CMP]], label %6, label %10
7282// LLVM: 6:
83+ // LLVM: br label %7
84+ // LLVM: 7:
7385// LLVM: [[LOAD2:%.*]] = load i32, ptr [[COND]], align 4
7486// LLVM: [[ADD1:%.*]] = add nsw i32 [[LOAD2]], 1
7587// LLVM: store i32 [[ADD1]], ptr [[COND]], align 4
76- // LLVM: br label %9
77- // LLVM: 9:
7888// LLVM: br label %10
7989// LLVM: 10:
90+ // LLVM: br label %11
91+ // LLVM: 11:
8092// LLVM: ret void
8193
8294// OGCG: define dso_local void @label_in_if
@@ -142,11 +154,15 @@ void labelWithoutMatch() {
142154 return ;
143155}
144156// CIR: cir.func no_proto dso_local @labelWithoutMatch
157+ // CIR: cir.br ^bb1
158+ // CIR: ^bb1:
145159// CIR: cir.label "end"
146160// CIR: cir.return
147161// CIR: }
148162
149163// LLVM: define dso_local void @labelWithoutMatch
164+ // LLVM: br label %1
165+ // LLVM: 1:
150166// LLVM: ret void
151167
152168// OGCG: define dso_local void @labelWithoutMatch
@@ -167,13 +183,17 @@ void foo() {
167183
168184// CIR: cir.func no_proto dso_local @foo
169185// CIR: cir.scope {
170- // CIR: cir.label "label"
171186// CIR: %0 = cir.alloca !rec_S, !cir.ptr<!rec_S>, ["agg.tmp0"]
187+ // CIR: cir.br ^bb1
188+ // CIR: ^bb1:
189+ // CIR: cir.label "label"
172190
173191// LLVM:define dso_local void @foo() {
174192// LLVM: [[ALLOC:%.*]] = alloca %struct.S, i64 1, align 1
175193// LLVM: br label %2
176194// LLVM:2:
195+ // LLVM: br label %3
196+ // LLVM:3:
177197// LLVM: [[CALL:%.*]] = call %struct.S @get()
178198// LLVM: store %struct.S [[CALL]], ptr [[ALLOC]], align 1
179199// LLVM: [[LOAD:%.*]] = load %struct.S, ptr [[ALLOC]], align 1
0 commit comments