Skip to content

Commit 76393d3

Browse files
authored
[WebAssembly] Rename functions in wasm-eh.cpp (#130220)
I think it is generally better for tests have some descriptive function names so that we can insert new tests in the middle and don't have to renumber all tests. Also recently I added a (named) test to this file in #129020 so I think it's consistent for other tests to be named.
1 parent ab87206 commit 76393d3

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

clang/test/CodeGenCXX/wasm-eh.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct Cleanup {
1717
};
1818

1919
// Multiple catch clauses w/o catch-all
20-
void test0() {
20+
void multiple_catches_wo_catch_all() {
2121
try {
2222
may_throw();
2323
} catch (int) {
@@ -27,7 +27,7 @@ void test0() {
2727
}
2828
}
2929

30-
// CHECK-LABEL: define void @_Z5test0v() {{.*}} personality ptr @__gxx_wasm_personality_v0
30+
// CHECK-LABEL: define void @_Z29multiple_catches_wo_catch_allv() {{.*}} personality ptr @__gxx_wasm_personality_v0
3131

3232
// CHECK: %[[INT_ALLOCA:.*]] = alloca i32
3333
// CHECK: invoke void @_Z9may_throwv()
@@ -73,15 +73,15 @@ void test0() {
7373
// CHECK-NEXT: unreachable
7474

7575
// Single catch-all
76-
void test1() {
76+
void single_catch_all() {
7777
try {
7878
may_throw();
7979
} catch (...) {
8080
dont_throw();
8181
}
8282
}
8383

84-
// CATCH-LABEL: @_Z5test1v()
84+
// CATCH-LABEL: @_Z16single_catch_allv()
8585

8686
// CHECK: %[[CATCHSWITCH:.*]] = catchswitch within none [label %[[CATCHSTART_BB:.*]]] unwind to caller
8787

@@ -93,7 +93,7 @@ void test1() {
9393
// CHECK: catchret from %[[CATCHPAD]] to label
9494

9595
// Multiple catch clauses w/ catch-all
96-
void test2() {
96+
void multiple_catches_w_catch_all() {
9797
try {
9898
may_throw();
9999
} catch (int) {
@@ -103,7 +103,7 @@ void test2() {
103103
}
104104
}
105105

106-
// CHECK-LABEL: @_Z5test2v()
106+
// CHECK-LABEL: @_Z28multiple_catches_w_catch_allv()
107107

108108
// CHECK: %[[CATCHSWITCH:.*]] = catchswitch within none [label %[[CATCHSTART_BB:.*]]] unwind to caller
109109

@@ -118,12 +118,12 @@ void test2() {
118118
// CHECK: catchret from %[[CATCHPAD]] to label
119119

120120
// Cleanup
121-
void test3() {
121+
void cleanup() {
122122
Cleanup c;
123123
may_throw();
124124
}
125125

126-
// CHECK-LABEL: @_Z5test3v()
126+
// CHECK-LABEL: @_Z7cleanupv()
127127

128128
// CHECK: invoke void @_Z9may_throwv()
129129
// CHECK-NEXT: to label {{.*}} unwind label %[[EHCLEANUP_BB:.*]]
@@ -134,15 +134,15 @@ void test3() {
134134
// CHECK-NEXT: cleanupret from %[[CLEANUPPAD]] unwind to caller
135135

136136
// Possibly throwing function call within a catch
137-
void test4() {
137+
void catch_int() {
138138
try {
139139
may_throw();
140140
} catch (int) {
141141
may_throw();
142142
}
143143
}
144144

145-
// CHECK-LABEL: @_Z5test4v()
145+
// CHECK-LABEL: @_Z9catch_intv()
146146

147147
// CHECK: %[[CATCHSWITCH]] = catchswitch within none [label %[[CATCHSTART_BB]]] unwind to caller
148148

@@ -162,15 +162,15 @@ void test4() {
162162
// CHECK-NEXT: cleanupret from %[[CLEANUPPAD]] unwind to caller
163163

164164
// Possibly throwing function call within a catch-all
165-
void test5() {
165+
void catch_all() {
166166
try {
167167
may_throw();
168168
} catch (...) {
169169
may_throw();
170170
}
171171
}
172172

173-
// CHECK-LABEL: @_Z5test5v()
173+
// CHECK-LABEL: @_Z9catch_allv()
174174

175175
// CHECK: %[[CATCHSWITCH:.*]] = catchswitch within none [label %[[CATCHSTART_BB]]] unwind to caller
176176

@@ -198,7 +198,7 @@ void test5() {
198198
// CHECK-NEXT: unreachable
199199

200200
// Try-catch with cleanups
201-
void test6() {
201+
void try_catch_w_cleanups() {
202202
Cleanup c1;
203203
try {
204204
Cleanup c2;
@@ -209,7 +209,7 @@ void test6() {
209209
}
210210
}
211211

212-
// CHECK-LABEL: @_Z5test6v()
212+
// CHECK-LABEL: @_Z20try_catch_w_cleanupsv()
213213
// CHECK: invoke void @_Z9may_throwv()
214214
// CHECK-NEXT: to label %{{.*}} unwind label %[[EHCLEANUP_BB0:.*]]
215215

@@ -254,7 +254,7 @@ void test6() {
254254
// CHECK-NEXT: unreachable
255255

256256
// Nested try-catches within a try with cleanups
257-
void test7() {
257+
void nested_try_catches_with_cleanups() {
258258
Cleanup c1;
259259
may_throw();
260260
try {
@@ -275,7 +275,7 @@ void test7() {
275275
}
276276
}
277277

278-
// CHECK-LABEL: @_Z5test7v()
278+
// CHECK-LABEL: @_Z32nested_try_catches_with_cleanupsv()
279279
// CHECK: invoke void @_Z9may_throwv()
280280

281281
// CHECK: invoke void @_Z9may_throwv()
@@ -340,7 +340,7 @@ void test7() {
340340
// CHECK: unreachable
341341

342342
// Nested try-catches within a catch
343-
void test8() {
343+
void nested_try_catch_within_catch() {
344344
try {
345345
may_throw();
346346
} catch (int) {
@@ -352,7 +352,7 @@ void test8() {
352352
}
353353
}
354354

355-
// CHECK-LABEL: @_Z5test8v()
355+
// CHECK-LABEL: @_Z29nested_try_catch_within_catchv()
356356
// CHECK: invoke void @_Z9may_throwv()
357357

358358
// CHECK: %[[CATCHSWITCH0:.*]] = catchswitch within none
@@ -402,19 +402,19 @@ void noexcept_throw() noexcept {
402402
// This is controlled by -Wwasm-exception-spec, which is on by default. This
403403
// warning can be suppressed with -Wno-wasm-exception-spec. Checks if a warning
404404
// message is correctly printed or not printed depending on the options.
405-
void test9() throw(int) {
405+
void exception_spec_warning() throw(int) {
406406
}
407407
// WARNING-DEFAULT: warning: dynamic exception specifications with types are currently ignored in wasm
408408
// WARNING-ON: warning: dynamic exception specifications with types are currently ignored in wasm
409409
// WARNING-OFF-NOT: warning: dynamic exception specifications with types are currently ignored in wasm
410410
// EM-EH-WARNING: warning: dynamic exception specifications with types are currently ignored in wasm
411411

412-
// Wasm curremtly treats 'throw()' in the same way as 'noexept'. Check if the
412+
// Wasm currently treats 'throw()' in the same way as 'noexcept'. Check if the
413413
// same warning message is printed as if when a 'noexcept' function throws.
414-
void test10() throw() {
414+
void exception_spec_throw_empty() throw() {
415415
throw 3;
416416
}
417-
// WARNING-DEFAULT: warning: 'test10' has a non-throwing exception specification but can still throw
417+
// WARNING-DEFAULT: warning: 'exception_spec_throw_empty' has a non-throwing exception specification but can still throw
418418
// WARNING-DEFAULT: function declared non-throwing here
419419

420420
// Here we only check if the command enables wasm exception handling in the

0 commit comments

Comments
 (0)