Skip to content

Commit 9c3345a

Browse files
committed
[WebAssembly] Cleanup Emscripten SjLj tests
- Remove a redundant test: there were `longjmp_only` and `only_longjmp`, which do the same thing - Add `CHECK-LABEL` lines for function names Reviewed By: tlively Differential Revision: https://reviews.llvm.org/D107511
1 parent aa0b0fb commit 9c3345a

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

llvm/test/CodeGen/WebAssembly/lower-em-sjlj.ll

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -139,24 +139,14 @@ if.end: ; preds = %if.then, %entry
139139
}
140140

141141
; Test a case when a function only calls other functions that are neither setjmp nor longjmp
142-
define void @only_other_func() {
142+
define void @other_func_only() {
143+
; CHECK-LABEL: @other_func_only
143144
entry:
144145
call void @foo()
145146
ret void
146147
; CHECK: call void @foo()
147148
}
148149

149-
; Test a case when a function only calls longjmp and not setjmp
150-
define void @only_longjmp() {
151-
entry:
152-
%buf = alloca [1 x %struct.__jmp_buf_tag], align 16
153-
%arraydecay = getelementptr inbounds [1 x %struct.__jmp_buf_tag], [1 x %struct.__jmp_buf_tag]* %buf, i32 0, i32 0
154-
call void @longjmp(%struct.__jmp_buf_tag* %arraydecay, i32 5) #1
155-
unreachable
156-
; CHECK: %[[JMPBUF:.*]] = ptrtoint
157-
; CHECK-NEXT: call void @emscripten_longjmp([[PTR]] %[[JMPBUF]], i32 5)
158-
}
159-
160150
; Test inline asm handling
161151
define void @inline_asm() {
162152
; CHECK-LABEL: @inline_asm
@@ -185,10 +175,10 @@ entry:
185175
ret i8 *%alloc
186176
}
187177

188-
; Tests if program does not crash when there's no setjmp function calls in the
189-
; module.
178+
; Test a case when a function only calls longjmp and not setjmp
190179
@buffer = global [1 x %struct.__jmp_buf_tag] zeroinitializer, align 16
191180
define void @longjmp_only() {
181+
; CHECK-LABEL: @longjmp_only
192182
entry:
193183
; CHECK: call void @emscripten_longjmp
194184
call void @longjmp(%struct.__jmp_buf_tag* getelementptr inbounds ([1 x %struct.__jmp_buf_tag], [1 x %struct.__jmp_buf_tag]* @buffer, i32 0, i32 0), i32 1) #1
@@ -197,6 +187,7 @@ entry:
197187

198188
; Tests if SSA rewrite works when a use and its def are within the same BB.
199189
define void @ssa_rewite_in_same_bb() {
190+
; CHECK-LABEL: @ssa_rewite_in_same_bb
200191
entry:
201192
call void @foo()
202193
br label %for.cond

0 commit comments

Comments
 (0)