[llvm] r369974 - [WebAssembly] Combine emscripten SjLj tests

Heejin Ahn via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 26 14:41:17 PDT 2019


Author: aheejin
Date: Mon Aug 26 14:41:17 2019
New Revision: 369974

URL: http://llvm.org/viewvc/llvm-project?rev=369974&view=rev
Log:
[WebAssembly] Combine emscripten SjLj tests

Summary:
Combine a test in lower-em-sjlj-longjmp-only.ll into lower-em-sjlj.ll,
because the test command is the same and I don't see any reason it
should be a separate file. Also converted tabs into spaces and fixed
indentations in lower-em-sjlj-sret.ll. (lower-em-sjlj.ll uses a
different test command (llc), so it couldn't be combined)

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66728

Removed:
    llvm/trunk/test/CodeGen/WebAssembly/lower-em-sjlj-longjmp-only.ll
Modified:
    llvm/trunk/test/CodeGen/WebAssembly/lower-em-sjlj-sret.ll
    llvm/trunk/test/CodeGen/WebAssembly/lower-em-sjlj.ll

Removed: llvm/trunk/test/CodeGen/WebAssembly/lower-em-sjlj-longjmp-only.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/lower-em-sjlj-longjmp-only.ll?rev=369973&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/lower-em-sjlj-longjmp-only.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/lower-em-sjlj-longjmp-only.ll (removed)
@@ -1,24 +0,0 @@
-; RUN: opt < %s -wasm-lower-em-ehsjlj -S | FileCheck %s
-
-target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
-target triple = "wasm32-unknown-unknown"
-
-%struct.__jmp_buf_tag = type { [6 x i32], i32, %struct.__sigset_t }
-%struct.__sigset_t = type { [32 x i32] }
-
- at buffer = global [1 x %struct.__jmp_buf_tag] zeroinitializer, align 16
-
-; Tests if program does not crash when there's no setjmp function calls in the
-; module.
-
-; CHECK: call void @emscripten_longjmp_jmpbuf
-define void @longjmp_only() {
-entry:
-  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
-  unreachable
-}
-
-; Function Attrs: noreturn nounwind
-declare void @longjmp(%struct.__jmp_buf_tag*, i32) #1
-
-attributes #1 = { noreturn nounwind }

Modified: llvm/trunk/test/CodeGen/WebAssembly/lower-em-sjlj-sret.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/lower-em-sjlj-sret.ll?rev=369974&r1=369973&r2=369974&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/lower-em-sjlj-sret.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/lower-em-sjlj-sret.ll Mon Aug 26 14:41:17 2019
@@ -15,11 +15,11 @@ entry:
   %env = alloca [1 x %struct.__jmp_buf_tag], align 16
   %arraydecay = getelementptr inbounds [1 x %struct.__jmp_buf_tag], [1 x %struct.__jmp_buf_tag]* %env, i32 0, i32 0
   %call = call i32 @setjmp(%struct.__jmp_buf_tag* %arraydecay) #0
-; This is the function pointer to pass to invoke.
-; It needs to be the first argument (that's what we're testing here)
-; CHECK:	i32.const	$push[[FPTR:[0-9]+]]=, returns_struct
-; This is the sret stack region (as an offset from the stack pointer local)
-; CHECK:	call	"__invoke_{i32.i32}", $pop[[FPTR]]
+  ; This is the function pointer to pass to invoke.
+  ; It needs to be the first argument (that's what we're testing here)
+  ; CHECK: i32.const $push[[FPTR:[0-9]+]]=, returns_struct
+  ; This is the sret stack region (as an offset from the stack pointer local)
+  ; CHECK: call "__invoke_{i32.i32}", $pop[[FPTR]]
   %ret = call {i32, i32} @returns_struct()
   ret {i32, i32} %ret
 }

Modified: llvm/trunk/test/CodeGen/WebAssembly/lower-em-sjlj.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/lower-em-sjlj.ll?rev=369974&r1=369973&r2=369974&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/lower-em-sjlj.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/lower-em-sjlj.ll Mon Aug 26 14:41:17 2019
@@ -216,6 +216,16 @@ entry:
   ret i8 *%alloc
 }
 
+; Tests if program does not crash when there's no setjmp function calls in the
+; module.
+ at buffer = global [1 x %struct.__jmp_buf_tag] zeroinitializer, align 16
+define void @longjmp_only() {
+entry:
+  ; CHECK: call void @emscripten_longjmp_jmpbuf
+  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
+  unreachable
+}
+
 declare void @foo()
 ; Function Attrs: returns_twice
 declare i32 @setjmp(%struct.__jmp_buf_tag*) #0




More information about the llvm-commits mailing list