Index: test/wasm/Inputs/start.ll =================================================================== --- /dev/null +++ test/wasm/Inputs/start.ll @@ -0,0 +1,6 @@ +target triple = "wasm32-unknown-unknown-wasm" + +define void @_start() local_unnamed_addr { +entry: + ret void +} Index: test/wasm/import-memory.test =================================================================== --- test/wasm/import-memory.test +++ test/wasm/import-memory.test @@ -1,5 +1,5 @@ -# RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o -# RUN: lld -flavor wasm -entry ret32 --import-memory -o %t.wasm %t.ret32.o +# RUN: llc -filetype=obj %p/Inputs/start.ll -o %t.start.o +# RUN: lld -flavor wasm --import-memory -o %t.wasm %t.start.o # RUN: obj2yaml %t.wasm | FileCheck %s # Verify the --import-memory flag creates a memory import Index: test/wasm/invalid-stack-size.ll =================================================================== --- test/wasm/invalid-stack-size.ll +++ /dev/null @@ -1,11 +0,0 @@ -; RUN: llc -filetype=obj %s -o %t.o -; RUN: not lld -flavor wasm -o %t.wasm -z stack-size=1 %t.o 2>&1 | FileCheck %s - -target triple = "wasm32-unknown-unknown-wasm" - -define i32 @_start() local_unnamed_addr #1 { -entry: - ret i32 0 -} - -; CHECK: error: stack size must be 16-byte aligned Index: test/wasm/invalid-stack-size.test =================================================================== --- /dev/null +++ test/wasm/invalid-stack-size.test @@ -0,0 +1,4 @@ +; RUN: llc -filetype=obj %p/Inputs/start.ll -o %t.o +; RUN: not lld -flavor wasm -o %t.wasm -z stack-size=1 %t.o 2>&1 | FileCheck %s + +; CHECK: error: stack size must be 16-byte aligned Index: test/wasm/load-undefined.test =================================================================== --- test/wasm/load-undefined.test +++ test/wasm/load-undefined.test @@ -3,18 +3,11 @@ ; ; RUN: llc -filetype=obj %S/Inputs/ret64.ll -o %t.o ; RUN: llc -filetype=obj %S/Inputs/ret32.ll -o %t2.o -; RUN: llc -filetype=obj %s -o %t3.o +; RUN: llc -filetype=obj %S/Inputs/start.ll -o %t.start.o ; RUN: llvm-ar rcs %t2.a %t2.o -; RUN: lld -flavor wasm %t3.o %t2.a %t.o -o %t.wasm -u ret32 --undefined ret64 +; RUN: lld -flavor wasm %t.start.o %t2.a %t.o -o %t.wasm -u ret32 --undefined ret64 ; RUN: obj2yaml %t.wasm | FileCheck %s -target triple = "wasm32-unknown-unknown-wasm" - -define i32 @_start() local_unnamed_addr { -entry: - ret i32 1 -} - ; CHECK: - Type: EXPORT ; CHECK-NEXT: Exports: ; CHECK-NEXT: - Name: memory @@ -36,8 +29,8 @@ ; Verify that referencing a symbol that doesn't exist won't work -; RUN: not lld -flavor wasm %t3.o -o %t.wasm -u symboldoesnotexist 2>&1 | FileCheck -check-prefix=CHECK-UNDEFINED1 %s +; RUN: not lld -flavor wasm %t.start.o -o %t.wasm -u symboldoesnotexist 2>&1 | FileCheck -check-prefix=CHECK-UNDEFINED1 %s ; CHECK-UNDEFINED1: error: undefined symbol: symboldoesnotexist -; RUN: not lld -flavor wasm %t3.o -o %t.wasm --undefined symboldoesnotexist --allow-undefined 2>&1 | FileCheck -check-prefix=CHECK-UNDEFINED2 %s +; RUN: not lld -flavor wasm %t.start.o -o %t.wasm --undefined symboldoesnotexist --allow-undefined 2>&1 | FileCheck -check-prefix=CHECK-UNDEFINED2 %s ; CHECK-UNDEFINED2: function forced with --undefined not found: symboldoesnotexist Index: test/wasm/strip-debug.test =================================================================== --- test/wasm/strip-debug.test +++ test/wasm/strip-debug.test @@ -1,5 +1,5 @@ -RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o -RUN: lld -flavor wasm --strip-debug --entry=ret32 -o %t.wasm %t.ret32.o +RUN: llc -filetype=obj %p/Inputs/start.ll -o %t.start.o +RUN: lld -flavor wasm --strip-debug -o %t.wasm %t.start.o RUN: obj2yaml %t.wasm | FileCheck %s # Check that there is no name section