Skip to content

Commit a21a9c2

Browse files
committed
address comments
1 parent d460444 commit a21a9c2

File tree

1 file changed

+28
-29
lines changed

1 file changed

+28
-29
lines changed

clang/test/CIR/CodeGen/throws.cpp

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ void throw_complex_expr() {
145145
// OGCG: store float 0x40019999A0000000, ptr %[[EXCEPTION_IMAG]], align 4
146146
// OGCG: call void @__cxa_throw(ptr %[[EXCEPTION_ADDR]], ptr @_ZTICf, ptr null)
147147

148-
149148
void throw_enum_expr() {
150149
enum Test {
151150
TestA,
@@ -154,21 +153,21 @@ void throw_enum_expr() {
154153
throw Test::TestA;
155154
}
156155

157-
//CIR: %[[EXCEPTION_ADDR:.*]] = cir.alloc.exception 4 -> !cir.ptr<!u32i>
158-
//CIR: %[[EXCEPTION_VALUE:.*]] = cir.const #cir.int<0> : !u32i
159-
//CIR: cir.store{{.*}} %[[EXCEPTION_VALUE]], %[[EXCEPTION_ADDR]] : !u32i, !cir.ptr<!u32i>
160-
//CIR: cir.throw %[[EXCEPTION_ADDR]] : !cir.ptr<!u32i>, @_ZTIZ15throw_enum_exprvE4Test
161-
//CIR: cir.unreachable
156+
// CIR: %[[EXCEPTION_ADDR:.*]] = cir.alloc.exception 4 -> !cir.ptr<!u32i>
157+
// CIR: %[[EXCEPTION_VALUE:.*]] = cir.const #cir.int<0> : !u32i
158+
// CIR: cir.store{{.*}} %[[EXCEPTION_VALUE]], %[[EXCEPTION_ADDR]] : !u32i, !cir.ptr<!u32i>
159+
// CIR: cir.throw %[[EXCEPTION_ADDR]] : !cir.ptr<!u32i>, @_ZTIZ15throw_enum_exprvE4Test
160+
// CIR: cir.unreachable
162161

163-
//LLVM: %[[EXCEPTION_ADDR:.*]] = call ptr @__cxa_allocate_exception(i64 4)
164-
//LLVM: store i32 0, ptr %[[EXCEPTION_ADDR]], align 16
165-
//LLVM: call void @__cxa_throw(ptr %[[EXCEPTION_ADDR]], ptr @_ZTIZ15throw_enum_exprvE4Test, ptr null)
166-
//LLVM: unreachable
162+
// LLVM: %[[EXCEPTION_ADDR:.*]] = call ptr @__cxa_allocate_exception(i64 4)
163+
// LLVM: store i32 0, ptr %[[EXCEPTION_ADDR]], align 16
164+
// LLVM: call void @__cxa_throw(ptr %[[EXCEPTION_ADDR]], ptr @_ZTIZ15throw_enum_exprvE4Test, ptr null)
165+
// LLVM: unreachable
167166

168-
//OGCG: %[[EXCEPTION_ADDR:.*]] = call ptr @__cxa_allocate_exception(i64 4)
169-
//OGCG: store i32 0, ptr %[[EXCEPTION_ADDR]], align 16
170-
//OGCG: call void @__cxa_throw(ptr %[[EXCEPTION_ADDR]], ptr @_ZTIZ15throw_enum_exprvE4Test, ptr null)
171-
//OGCG: unreachable
167+
// OGCG: %[[EXCEPTION_ADDR:.*]] = call ptr @__cxa_allocate_exception(i64 4)
168+
// OGCG: store i32 0, ptr %[[EXCEPTION_ADDR]], align 16
169+
// OGCG: call void @__cxa_throw(ptr %[[EXCEPTION_ADDR]], ptr @_ZTIZ15throw_enum_exprvE4Test, ptr null)
170+
// OGCG: unreachable
172171

173172
void throw_enum_class_expr() {
174173
enum class Test {
@@ -178,18 +177,18 @@ void throw_enum_class_expr() {
178177
throw Test::TestA;
179178
}
180179

181-
//CIR: %[[EXCEPTION_ADDR:.*]] = cir.alloc.exception 4 -> !cir.ptr<!s32i>
182-
//CIR: %[[EXCEPTION_VALUE:.*]] = cir.const #cir.int<0> : !s32i
183-
//CIR: cir.store{{.*}} %[[EXCEPTION_VALUE]], %[[EXCEPTION_ADDR]] : !s32i, !cir.ptr<!s32i>
184-
//CIR: cir.throw %[[EXCEPTION_ADDR]] : !cir.ptr<!s32i>, @_ZTIZ21throw_enum_class_exprvE4Test
185-
//CIR: cir.unreachable
186-
187-
//LLVM: %[[EXCEPTION_ADDR:.*]] = call ptr @__cxa_allocate_exception(i64 4)
188-
//LLVM: store i32 0, ptr %[[EXCEPTION_ADDR]], align 16
189-
//LLVM: call void @__cxa_throw(ptr %[[EXCEPTION_ADDR]], ptr @_ZTIZ21throw_enum_class_exprvE4Test, ptr null)
190-
//LLVM: unreachable
191-
192-
//OGCG: %[[EXCEPTION_ADDR:.*]] = call ptr @__cxa_allocate_exception(i64 4)
193-
//OGCG: store i32 0, ptr %[[EXCEPTION_ADDR]], align 16
194-
//OGCG: call void @__cxa_throw(ptr %[[EXCEPTION_ADDR]], ptr @_ZTIZ21throw_enum_class_exprvE4Test, ptr null)
195-
//OGCG: unreachable
180+
// CIR: %[[EXCEPTION_ADDR:.*]] = cir.alloc.exception 4 -> !cir.ptr<!s32i>
181+
// CIR: %[[EXCEPTION_VALUE:.*]] = cir.const #cir.int<0> : !s32i
182+
// CIR: cir.store{{.*}} %[[EXCEPTION_VALUE]], %[[EXCEPTION_ADDR]] : !s32i, !cir.ptr<!s32i>
183+
// CIR: cir.throw %[[EXCEPTION_ADDR]] : !cir.ptr<!s32i>, @_ZTIZ21throw_enum_class_exprvE4Test
184+
// CIR: cir.unreachable
185+
186+
// LLVM: %[[EXCEPTION_ADDR:.*]] = call ptr @__cxa_allocate_exception(i64 4)
187+
// LLVM: store i32 0, ptr %[[EXCEPTION_ADDR]], align 16
188+
// LLVM: call void @__cxa_throw(ptr %[[EXCEPTION_ADDR]], ptr @_ZTIZ21throw_enum_class_exprvE4Test, ptr null)
189+
// LLVM: unreachable
190+
191+
// OGCG: %[[EXCEPTION_ADDR:.*]] = call ptr @__cxa_allocate_exception(i64 4)
192+
// OGCG: store i32 0, ptr %[[EXCEPTION_ADDR]], align 16
193+
// OGCG: call void @__cxa_throw(ptr %[[EXCEPTION_ADDR]], ptr @_ZTIZ21throw_enum_class_exprvE4Test, ptr null)
194+
// OGCG: unreachable

0 commit comments

Comments
 (0)