@@ -17,7 +17,7 @@ struct Cleanup {
17
17
};
18
18
19
19
// Multiple catch clauses w/o catch-all
20
- void test0 () {
20
+ void multiple_catches_wo_catch_all () {
21
21
try {
22
22
may_throw ();
23
23
} catch (int ) {
@@ -27,7 +27,7 @@ void test0() {
27
27
}
28
28
}
29
29
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
31
31
32
32
// CHECK: %[[INT_ALLOCA:.*]] = alloca i32
33
33
// CHECK: invoke void @_Z9may_throwv()
@@ -73,15 +73,15 @@ void test0() {
73
73
// CHECK-NEXT: unreachable
74
74
75
75
// Single catch-all
76
- void test1 () {
76
+ void single_catch_all () {
77
77
try {
78
78
may_throw ();
79
79
} catch (...) {
80
80
dont_throw ();
81
81
}
82
82
}
83
83
84
- // CATCH-LABEL: @_Z5test1v ()
84
+ // CATCH-LABEL: @_Z16single_catch_allv ()
85
85
86
86
// CHECK: %[[CATCHSWITCH:.*]] = catchswitch within none [label %[[CATCHSTART_BB:.*]]] unwind to caller
87
87
@@ -93,7 +93,7 @@ void test1() {
93
93
// CHECK: catchret from %[[CATCHPAD]] to label
94
94
95
95
// Multiple catch clauses w/ catch-all
96
- void test2 () {
96
+ void multiple_catches_w_catch_all () {
97
97
try {
98
98
may_throw ();
99
99
} catch (int ) {
@@ -103,7 +103,7 @@ void test2() {
103
103
}
104
104
}
105
105
106
- // CHECK-LABEL: @_Z5test2v ()
106
+ // CHECK-LABEL: @_Z28multiple_catches_w_catch_allv ()
107
107
108
108
// CHECK: %[[CATCHSWITCH:.*]] = catchswitch within none [label %[[CATCHSTART_BB:.*]]] unwind to caller
109
109
@@ -118,12 +118,12 @@ void test2() {
118
118
// CHECK: catchret from %[[CATCHPAD]] to label
119
119
120
120
// Cleanup
121
- void test3 () {
121
+ void cleanup () {
122
122
Cleanup c;
123
123
may_throw ();
124
124
}
125
125
126
- // CHECK-LABEL: @_Z5test3v ()
126
+ // CHECK-LABEL: @_Z7cleanupv ()
127
127
128
128
// CHECK: invoke void @_Z9may_throwv()
129
129
// CHECK-NEXT: to label {{.*}} unwind label %[[EHCLEANUP_BB:.*]]
@@ -134,15 +134,15 @@ void test3() {
134
134
// CHECK-NEXT: cleanupret from %[[CLEANUPPAD]] unwind to caller
135
135
136
136
// Possibly throwing function call within a catch
137
- void test4 () {
137
+ void catch_int () {
138
138
try {
139
139
may_throw ();
140
140
} catch (int ) {
141
141
may_throw ();
142
142
}
143
143
}
144
144
145
- // CHECK-LABEL: @_Z5test4v ()
145
+ // CHECK-LABEL: @_Z9catch_intv ()
146
146
147
147
// CHECK: %[[CATCHSWITCH]] = catchswitch within none [label %[[CATCHSTART_BB]]] unwind to caller
148
148
@@ -162,15 +162,15 @@ void test4() {
162
162
// CHECK-NEXT: cleanupret from %[[CLEANUPPAD]] unwind to caller
163
163
164
164
// Possibly throwing function call within a catch-all
165
- void test5 () {
165
+ void catch_all () {
166
166
try {
167
167
may_throw ();
168
168
} catch (...) {
169
169
may_throw ();
170
170
}
171
171
}
172
172
173
- // CHECK-LABEL: @_Z5test5v ()
173
+ // CHECK-LABEL: @_Z9catch_allv ()
174
174
175
175
// CHECK: %[[CATCHSWITCH:.*]] = catchswitch within none [label %[[CATCHSTART_BB]]] unwind to caller
176
176
@@ -198,7 +198,7 @@ void test5() {
198
198
// CHECK-NEXT: unreachable
199
199
200
200
// Try-catch with cleanups
201
- void test6 () {
201
+ void try_catch_w_cleanups () {
202
202
Cleanup c1;
203
203
try {
204
204
Cleanup c2;
@@ -209,7 +209,7 @@ void test6() {
209
209
}
210
210
}
211
211
212
- // CHECK-LABEL: @_Z5test6v ()
212
+ // CHECK-LABEL: @_Z20try_catch_w_cleanupsv ()
213
213
// CHECK: invoke void @_Z9may_throwv()
214
214
// CHECK-NEXT: to label %{{.*}} unwind label %[[EHCLEANUP_BB0:.*]]
215
215
@@ -254,7 +254,7 @@ void test6() {
254
254
// CHECK-NEXT: unreachable
255
255
256
256
// Nested try-catches within a try with cleanups
257
- void test7 () {
257
+ void nested_try_catches_with_cleanups () {
258
258
Cleanup c1;
259
259
may_throw ();
260
260
try {
@@ -275,7 +275,7 @@ void test7() {
275
275
}
276
276
}
277
277
278
- // CHECK-LABEL: @_Z5test7v ()
278
+ // CHECK-LABEL: @_Z32nested_try_catches_with_cleanupsv ()
279
279
// CHECK: invoke void @_Z9may_throwv()
280
280
281
281
// CHECK: invoke void @_Z9may_throwv()
@@ -340,7 +340,7 @@ void test7() {
340
340
// CHECK: unreachable
341
341
342
342
// Nested try-catches within a catch
343
- void test8 () {
343
+ void nested_try_catch_within_catch () {
344
344
try {
345
345
may_throw ();
346
346
} catch (int ) {
@@ -352,7 +352,7 @@ void test8() {
352
352
}
353
353
}
354
354
355
- // CHECK-LABEL: @_Z5test8v ()
355
+ // CHECK-LABEL: @_Z29nested_try_catch_within_catchv ()
356
356
// CHECK: invoke void @_Z9may_throwv()
357
357
358
358
// CHECK: %[[CATCHSWITCH0:.*]] = catchswitch within none
@@ -402,19 +402,19 @@ void noexcept_throw() noexcept {
402
402
// This is controlled by -Wwasm-exception-spec, which is on by default. This
403
403
// warning can be suppressed with -Wno-wasm-exception-spec. Checks if a warning
404
404
// message is correctly printed or not printed depending on the options.
405
- void test9 () throw(int ) {
405
+ void exception_spec_warning () throw(int ) {
406
406
}
407
407
// WARNING-DEFAULT: warning: dynamic exception specifications with types are currently ignored in wasm
408
408
// WARNING-ON: warning: dynamic exception specifications with types are currently ignored in wasm
409
409
// WARNING-OFF-NOT: warning: dynamic exception specifications with types are currently ignored in wasm
410
410
// EM-EH-WARNING: warning: dynamic exception specifications with types are currently ignored in wasm
411
411
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
413
413
// same warning message is printed as if when a 'noexcept' function throws.
414
- void test10 () throw() {
414
+ void exception_spec_throw_empty () throw() {
415
415
throw 3 ;
416
416
}
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
418
418
// WARNING-DEFAULT: function declared non-throwing here
419
419
420
420
// Here we only check if the command enables wasm exception handling in the
0 commit comments