summaryrefslogtreecommitdiffstats
path: root/lld
diff options
context:
space:
mode:
Diffstat (limited to 'lld')
-rw-r--r--lld/test/wasm/alias.ll17
-rw-r--r--lld/test/wasm/archive.ll10
-rw-r--r--lld/test/wasm/call-indirect.ll10
-rw-r--r--lld/test/wasm/comdats.ll2
-rw-r--r--lld/test/wasm/conflict.test2
-rw-r--r--lld/test/wasm/data-layout.ll4
-rw-r--r--lld/test/wasm/entry.ll6
-rw-r--r--lld/test/wasm/export.ll8
-rw-r--r--lld/test/wasm/function-imports-first.ll2
-rw-r--r--lld/test/wasm/function-imports.ll2
-rw-r--r--lld/test/wasm/function-index.test2
-rw-r--r--lld/test/wasm/import-memory.test2
-rw-r--r--lld/test/wasm/init-fini.ll4
-rw-r--r--lld/test/wasm/invalid-stack-size.test2
-rw-r--r--lld/test/wasm/load-undefined.test6
-rw-r--r--lld/test/wasm/local-symbols.ll10
-rw-r--r--lld/test/wasm/locals-duplicate.test4
-rw-r--r--lld/test/wasm/many-functions.ll2
-rw-r--r--lld/test/wasm/relocatable.ll2
-rw-r--r--lld/test/wasm/signature-mismatch.ll2
-rw-r--r--lld/test/wasm/stack-pointer.ll2
-rw-r--r--lld/test/wasm/strip-debug.test2
-rw-r--r--lld/test/wasm/symbol-type-mismatch.ll2
-rw-r--r--lld/test/wasm/undefined-entry.test6
-rw-r--r--lld/test/wasm/undefined.ll6
-rw-r--r--lld/test/wasm/version.ll2
-rw-r--r--lld/test/wasm/visibility-hidden.ll6
-rw-r--r--lld/test/wasm/weak-alias-overide.ll2
-rw-r--r--lld/test/wasm/weak-alias.ll47
-rw-r--r--lld/test/wasm/weak-symbols.ll14
-rw-r--r--lld/test/wasm/weak-undefined.ll12
31 files changed, 100 insertions, 100 deletions
diff --git a/lld/test/wasm/alias.ll b/lld/test/wasm/alias.ll
index 8fe6847d2a7..794c115d688 100644
--- a/lld/test/wasm/alias.ll
+++ b/lld/test/wasm/alias.ll
@@ -1,15 +1,15 @@
; RUN: llc -filetype=obj -o %t.o %s
-; RUN: lld -flavor wasm %t.o -o %t.wasm
+; RUN: lld -flavor wasm --check-signatures %t.o -o %t.wasm
; RUN: obj2yaml %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
-@start_alias = alias i32 (), i32 ()* @_start
+@start_alias = alias void (), void ()* @_start
; Function Attrs: nounwind uwtable
-define i32 @_start() local_unnamed_addr #1 {
+define void @_start() local_unnamed_addr #1 {
entry:
- ret i32 0
+ ret void
}
; CHECK: --- !WASM
@@ -19,13 +19,10 @@ entry:
; CHECK-NEXT: - Type: TYPE
; CHECK-NEXT: Signatures:
; CHECK-NEXT: - Index: 0
-; CHECK-NEXT: ReturnType: I32
+; CHECK-NEXT: ReturnType: NORESULT
; CHECK-NEXT: ParamTypes:
-; CHECK-NEXT: - Index: 1
-; CHECK-NEXT: ReturnType: NORESULT
-; CHECK-NEXT: ParamTypes:
; CHECK-NEXT: - Type: FUNCTION
-; CHECK-NEXT: FunctionTypes: [ 0, 1 ]
+; CHECK-NEXT: FunctionTypes: [ 0, 0 ]
; CHECK-NEXT: - Type: TABLE
; CHECK-NEXT: Tables:
; CHECK-NEXT: - ElemType: ANYFUNC
@@ -68,7 +65,7 @@ entry:
; CHECK-NEXT: Functions:
; CHECK-NEXT: - Index: 0
; CHECK-NEXT: Locals:
-; CHECK-NEXT: Body: 41000B
+; CHECK-NEXT: Body: 0B
; CHECK-NEXT: - Index: 1
; CHECK-NEXT: Locals:
; CHECK-NEXT: Body: 0B
diff --git a/lld/test/wasm/archive.ll b/lld/test/wasm/archive.ll
index e65eddd45b1..6cb4fba9288 100644
--- a/lld/test/wasm/archive.ll
+++ b/lld/test/wasm/archive.ll
@@ -4,12 +4,12 @@
; RUN: llc -filetype=obj %S/Inputs/hello.ll -o %t.a3.o
; RUN: llvm-ar rcs %t.a %t.a1.o %t.a2.o %t.a3.o
; RUN: rm -f %t.imports
-; RUN: not lld -flavor wasm %t.a %t.o -o %t.wasm 2>&1 | FileCheck -check-prefix=CHECK-UNDEFINED %s
+; RUN: not lld -flavor wasm --check-signatures %t.a %t.o -o %t.wasm 2>&1 | FileCheck -check-prefix=CHECK-UNDEFINED %s
; CHECK-UNDEFINED: undefined symbol: missing_func
; RUN: echo 'missing_func' > %t.imports
-; RUN: lld -flavor wasm %t.a %t.o -o %t.wasm
+; RUN: lld -flavor wasm --check-signatures %t.a %t.o -o %t.wasm
; RUN: llvm-nm -a %t.wasm | FileCheck %s
@@ -18,11 +18,11 @@ target triple = "wasm32-unknown-unknown-wasm"
declare i32 @foo() local_unnamed_addr #1
declare i32 @missing_func() local_unnamed_addr #1
-define i32 @_start() local_unnamed_addr #0 {
+define void @_start() local_unnamed_addr #0 {
entry:
%call1 = call i32 @foo() #2
%call2 = call i32 @missing_func() #2
- ret i32 %call2
+ ret void
}
; Verify that multually dependant object files in an archive is handled
@@ -36,4 +36,4 @@ entry:
; CHECK-NOT: hello
; Specifying the same archive twice is allowed.
-; RUN: lld -flavor wasm %t.a %t.a %t.o -o %t.wasm
+; RUN: lld -flavor wasm --check-signatures %t.a %t.a %t.o -o %t.wasm
diff --git a/lld/test/wasm/call-indirect.ll b/lld/test/wasm/call-indirect.ll
index ea814dec0eb..13417dbae53 100644
--- a/lld/test/wasm/call-indirect.ll
+++ b/lld/test/wasm/call-indirect.ll
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj %p/Inputs/call-indirect.ll -o %t2.o
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: lld -flavor wasm -no-gc-sections -o %t.wasm %t2.o %t.o
+; RUN: lld -flavor wasm -no-gc-sections --check-signatures -o %t.wasm %t2.o %t.o
; RUN: obj2yaml %t.wasm | FileCheck %s
; bitcode generated from the following C code:
@@ -19,11 +19,11 @@ entry:
}
; Function Attrs: nounwind
-define i32 @_start() local_unnamed_addr #1 {
+define void @_start() local_unnamed_addr #1 {
entry:
%0 = load i32 ()*, i32 ()** @indirect_func, align 4
%call = call i32 %0() #2
- ret i32 0
+ ret void
}
; Indirect function call where no function actually has this type.
@@ -57,7 +57,7 @@ define void @call_ptr(i64 (i64)* %arg) {
; CHECK-NEXT: ParamTypes:
; CHECK-NEXT: - I32
; CHECK-NEXT: - Type: FUNCTION
-; CHECK-NEXT: FunctionTypes: [ 0, 3, 1, 1, 4, 3 ]
+; CHECK-NEXT: FunctionTypes: [ 0, 3, 1, 3, 4, 3 ]
; CHECK-NEXT: - Type: TABLE
; CHECK-NEXT: Tables:
; CHECK-NEXT: - ElemType: ANYFUNC
@@ -126,7 +126,7 @@ define void @call_ptr(i64 (i64)* %arg) {
; CHECK-NEXT: Body: 41020B
; CHECK-NEXT: - Index: 3
; CHECK-NEXT: Locals:
-; CHECK-NEXT: Body: 410028028888808000118180808000001A41000B
+; CHECK-NEXT: Body: 410028028888808000118180808000001A0B
; CHECK-NEXT: - Index: 4
; CHECK-NEXT: Locals:
; CHECK-NEXT: Body: 42012000118280808000001A0B
diff --git a/lld/test/wasm/comdats.ll b/lld/test/wasm/comdats.ll
index 6871c02b1b7..367fb958d4d 100644
--- a/lld/test/wasm/comdats.ll
+++ b/lld/test/wasm/comdats.ll
@@ -1,7 +1,7 @@
; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/comdat1.ll -o %t1.o
; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/comdat2.ll -o %t2.o
; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %s -o %t.o
-; RUN: lld -flavor wasm -no-gc-sections -o %t.wasm %t.o %t1.o %t2.o
+; RUN: lld -flavor wasm -no-gc-sections --check-signatures -o %t.wasm %t.o %t1.o %t2.o
; RUN: obj2yaml %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/conflict.test b/lld/test/wasm/conflict.test
index 64ed3844a82..502678c74bf 100644
--- a/lld/test/wasm/conflict.test
+++ b/lld/test/wasm/conflict.test
@@ -1,5 +1,5 @@
# RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o
-# RUN: not lld -flavor wasm -o %t.wasm %t.ret32.o %t.ret32.o 2>&1 | FileCheck %s
+# RUN: not lld -flavor wasm --check-signatures -o %t.wasm %t.ret32.o %t.ret32.o 2>&1 | FileCheck %s
# CHECK: duplicate symbol: ret32
# CHECK-NEXT: >>> defined in {{.*}}conflict.test.tmp.ret32.o
diff --git a/lld/test/wasm/data-layout.ll b/lld/test/wasm/data-layout.ll
index efd4e087070..461876cabdd 100644
--- a/lld/test/wasm/data-layout.ll
+++ b/lld/test/wasm/data-layout.ll
@@ -9,7 +9,7 @@ target triple = "wasm32-unknown-unknown-wasm"
@hello_str = external global i8*
@external_ref = global i8** @hello_str, align 8
-; RUN: lld -flavor wasm -no-gc-sections --allow-undefined -o %t.wasm %t.o %t.hello.o
+; RUN: lld -flavor wasm -no-gc-sections --check-signatures --allow-undefined -o %t.wasm %t.o %t.hello.o
; RUN: obj2yaml %t.wasm | FileCheck %s
; CHECK: - Type: GLOBAL
@@ -43,7 +43,7 @@ target triple = "wasm32-unknown-unknown-wasm"
; CHECK-NEXT: Content: 68656C6C6F0A00
-; RUN: lld -flavor wasm --relocatable -o %t_reloc.wasm %t.o %t.hello.o
+; RUN: lld -flavor wasm --check-signatures --relocatable -o %t_reloc.wasm %t.o %t.hello.o
; RUN: obj2yaml %t_reloc.wasm | FileCheck %s -check-prefix=RELOC
; RELOC: - Type: GLOBAL
diff --git a/lld/test/wasm/entry.ll b/lld/test/wasm/entry.ll
index a84d37c4bf3..ba165c0d1e3 100644
--- a/lld/test/wasm/entry.ll
+++ b/lld/test/wasm/entry.ll
@@ -7,9 +7,9 @@ entry:
ret void
}
-; RUN: lld -flavor wasm -e entry -o %t1.wasm %t.o
+; RUN: lld -flavor wasm --check-signatures -e entry -o %t1.wasm %t.o
; RUN: obj2yaml %t1.wasm | FileCheck %s
-; RUN: lld -flavor wasm --entry=entry -o %t2.wasm %t.o
+; RUN: lld -flavor wasm --check-signatures --entry=entry -o %t2.wasm %t.o
; RUN: obj2yaml %t2.wasm | FileCheck %s
; CHECK: - Type: EXPORT
@@ -23,7 +23,7 @@ entry:
; The __wasm_call_ctors is somewhat special. Make sure we can use it
; as the entry point if we choose
-; RUN: lld -flavor wasm --entry=__wasm_call_ctors -o %t3.wasm %t.o
+; RUN: lld -flavor wasm --check-signatures --entry=__wasm_call_ctors -o %t3.wasm %t.o
; RUN: obj2yaml %t3.wasm | FileCheck %s -check-prefix=CHECK-CTOR
; CHECK-CTOR: - Type: EXPORT
diff --git a/lld/test/wasm/export.ll b/lld/test/wasm/export.ll
index 664ae80d444..be143da1a06 100644
--- a/lld/test/wasm/export.ll
+++ b/lld/test/wasm/export.ll
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: not lld -flavor wasm --export=missing -o %t.wasm %t.o 2>&1 | FileCheck -check-prefix=CHECK-ERROR %s
-; RUN: lld -flavor wasm --export=hidden_function -o %t.wasm %t.o
+; RUN: not lld -flavor wasm --check-signatures --export=missing -o %t.wasm %t.o 2>&1 | FileCheck -check-prefix=CHECK-ERROR %s
+; RUN: lld -flavor wasm --check-signatures --export=hidden_function -o %t.wasm %t.o
; RUN: obj2yaml %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
@@ -10,9 +10,9 @@ entry:
ret i32 0
}
-define i32 @_start() local_unnamed_addr {
+define void @_start() local_unnamed_addr {
entry:
- ret i32 0
+ ret void
}
; CHECK-ERROR: error: symbol exported via --export not found: missing
diff --git a/lld/test/wasm/function-imports-first.ll b/lld/test/wasm/function-imports-first.ll
index c62c9619421..4a25ef086e6 100644
--- a/lld/test/wasm/function-imports-first.ll
+++ b/lld/test/wasm/function-imports-first.ll
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: lld -flavor wasm -o %t.wasm %t.o %t.ret32.o
+; RUN: lld -flavor wasm --check-signatures -o %t.wasm %t.o %t.ret32.o
; RUN: obj2yaml %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/function-imports.ll b/lld/test/wasm/function-imports.ll
index 53d3bedda5d..16b177f34c2 100644
--- a/lld/test/wasm/function-imports.ll
+++ b/lld/test/wasm/function-imports.ll
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: lld -flavor wasm -o %t.wasm %t.ret32.o %t.o
+; RUN: lld -flavor wasm --check-signatures -o %t.wasm %t.ret32.o %t.o
; RUN: obj2yaml %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/function-index.test b/lld/test/wasm/function-index.test
index 546da30ede0..5cc3a5b1d98 100644
--- a/lld/test/wasm/function-index.test
+++ b/lld/test/wasm/function-index.test
@@ -1,6 +1,6 @@
# RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o
# RUN: llc -filetype=obj %p/Inputs/ret64.ll -o %t.ret64.o
-# RUN: lld -flavor wasm -r -o %t.wasm %t.ret32.o %t.ret64.o
+# RUN: lld -flavor wasm --check-signatures -r -o %t.wasm %t.ret32.o %t.ret64.o
# RUN: obj2yaml %t.wasm | FileCheck %s
CHECK: Sections:
diff --git a/lld/test/wasm/import-memory.test b/lld/test/wasm/import-memory.test
index 5bd40d6522f..95daa2f446d 100644
--- a/lld/test/wasm/import-memory.test
+++ b/lld/test/wasm/import-memory.test
@@ -1,5 +1,5 @@
# 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: lld -flavor wasm --check-signatures --import-memory -o %t.wasm %t.start.o
# RUN: obj2yaml %t.wasm | FileCheck %s
# Verify the --import-memory flag creates a memory import
diff --git a/lld/test/wasm/init-fini.ll b/lld/test/wasm/init-fini.ll
index 39059a1e709..d83e3b95e75 100644
--- a/lld/test/wasm/init-fini.ll
+++ b/lld/test/wasm/init-fini.ll
@@ -44,7 +44,7 @@ entry:
{ i32, void ()*, i8* } { i32 101, void ()* @func4, i8* null }
]
-; RUN: lld -flavor wasm %t.o %t.global-ctor-dtor.o -o %t.wasm
+; RUN: lld -flavor wasm --check-signatures %t.o %t.global-ctor-dtor.o -o %t.wasm
; RUN: obj2yaml %t.wasm | FileCheck %s
; CHECK: - Type: ELEM
@@ -104,7 +104,7 @@ entry:
; CHECK-NEXT: ...
-; RUN: lld -flavor wasm -r %t.o %t.global-ctor-dtor.o -o %t.reloc.wasm
+; RUN: lld -flavor wasm --check-signatures -r %t.o %t.global-ctor-dtor.o -o %t.reloc.wasm
; RUN: obj2yaml %t.reloc.wasm | FileCheck -check-prefix=RELOC %s
; RELOC: Name: linking
diff --git a/lld/test/wasm/invalid-stack-size.test b/lld/test/wasm/invalid-stack-size.test
index 898941b87bf..e8487c8b392 100644
--- a/lld/test/wasm/invalid-stack-size.test
+++ b/lld/test/wasm/invalid-stack-size.test
@@ -1,4 +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
+; RUN: not lld -flavor wasm --check-signatures -o %t.wasm -z stack-size=1 %t.o 2>&1 | FileCheck %s
; CHECK: error: stack size must be 16-byte aligned
diff --git a/lld/test/wasm/load-undefined.test b/lld/test/wasm/load-undefined.test
index 34b9383a156..9964a9b20fb 100644
--- a/lld/test/wasm/load-undefined.test
+++ b/lld/test/wasm/load-undefined.test
@@ -5,7 +5,7 @@
; RUN: llc -filetype=obj %S/Inputs/ret32.ll -o %t2.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 %t.start.o %t2.a %t.o -o %t.wasm -u ret32 --undefined ret64
+; RUN: lld -flavor wasm --check-signatures %t.start.o %t2.a %t.o -o %t.wasm -u ret32 --undefined ret64
; RUN: obj2yaml %t.wasm | FileCheck %s
; CHECK: - Type: EXPORT
@@ -29,8 +29,8 @@
; Verify that referencing a symbol that doesn't exist won't work
-; RUN: not lld -flavor wasm %t.start.o -o %t.wasm -u symboldoesnotexist 2>&1 | FileCheck -check-prefix=CHECK-UNDEFINED1 %s
+; RUN: not lld -flavor wasm --check-signatures %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 %t.start.o -o %t.wasm --undefined symboldoesnotexist --allow-undefined 2>&1 | FileCheck -check-prefix=CHECK-UNDEFINED2 %s
+; RUN: not lld -flavor wasm --check-signatures %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
diff --git a/lld/test/wasm/local-symbols.ll b/lld/test/wasm/local-symbols.ll
index 65bf1348285..9c2bbf1b0f7 100644
--- a/lld/test/wasm/local-symbols.ll
+++ b/lld/test/wasm/local-symbols.ll
@@ -1,5 +1,5 @@
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: lld -flavor wasm -o %t.wasm %t.o
+; RUN: lld -flavor wasm --check-signatures -o %t.wasm %t.o
; RUN: obj2yaml %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
@@ -13,10 +13,10 @@ entry:
ret i32 %0
}
-define i32 @_start() local_unnamed_addr {
+define void @_start() local_unnamed_addr {
entry:
call i32 @baz()
- ret i32 1
+ ret void
}
; CHECK: --- !WASM
@@ -32,7 +32,7 @@ entry:
; CHECK-NEXT: ReturnType: NORESULT
; CHECK-NEXT: ParamTypes:
; CHECK-NEXT: - Type: FUNCTION
-; CHECK-NEXT: FunctionTypes: [ 0, 0, 1 ]
+; CHECK-NEXT: FunctionTypes: [ 0, 1, 1 ]
; CHECK-NEXT: - Type: TABLE
; CHECK-NEXT: Tables:
; CHECK-NEXT: - ElemType: ANYFUNC
@@ -75,7 +75,7 @@ entry:
; CHECK-NEXT: Body: 4100280284888080000B
; CHECK-NEXT: - Index: 1
; CHECK-NEXT: Locals:
-; CHECK-NEXT: Body: 1080808080001A41010B
+; CHECK-NEXT: Body: 1080808080001A0B
; CHECK-NEXT: - Index: 2
; CHECK-NEXT: Locals:
; CHECK-NEXT: Body: 0B
diff --git a/lld/test/wasm/locals-duplicate.test b/lld/test/wasm/locals-duplicate.test
index f797631d6c6..ee26f2abaa2 100644
--- a/lld/test/wasm/locals-duplicate.test
+++ b/lld/test/wasm/locals-duplicate.test
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj %p/Inputs/locals-duplicate1.ll -o %t1.o
; RUN: llc -filetype=obj %p/Inputs/locals-duplicate2.ll -o %t2.o
-; RUN: lld -flavor wasm --no-entry -o %t.wasm %t1.o %t2.o
+; RUN: lld -flavor wasm --check-signatures --no-entry -o %t.wasm %t1.o %t2.o
; RUN: obj2yaml %t.wasm | FileCheck %s
; CHECK: --- !WASM
@@ -212,7 +212,7 @@
; CHECK-NEXT: ...
-; RUN: lld -flavor wasm -r --no-entry -o %t.reloc.wasm %t1.o %t2.o
+; RUN: lld -flavor wasm --check-signatures -r --no-entry -o %t.reloc.wasm %t1.o %t2.o
; RUN: obj2yaml %t.reloc.wasm | FileCheck -check-prefix=RELOC %s
; RELOC: --- !WASM
diff --git a/lld/test/wasm/many-functions.ll b/lld/test/wasm/many-functions.ll
index 4d23f531032..8bc18bad0a1 100644
--- a/lld/test/wasm/many-functions.ll
+++ b/lld/test/wasm/many-functions.ll
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj %p/Inputs/many-funcs.ll -o %t.many.o
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: lld -flavor wasm -r -o %t.wasm %t.many.o %t.o
+; RUN: lld -flavor wasm --check-signatures -r -o %t.wasm %t.many.o %t.o
; RUN: obj2yaml %t.wasm | FileCheck %s
; Test that relocations within the CODE section correctly handle
diff --git a/lld/test/wasm/relocatable.ll b/lld/test/wasm/relocatable.ll
index b543b5e47b4..bf52774fd8e 100644
--- a/lld/test/wasm/relocatable.ll
+++ b/lld/test/wasm/relocatable.ll
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj %p/Inputs/hello.ll -o %t.hello.o
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: lld -flavor wasm -r -o %t.wasm %t.hello.o %t.o
+; RUN: lld -flavor wasm --check-signatures -r -o %t.wasm %t.hello.o %t.o
; RUN: obj2yaml %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/signature-mismatch.ll b/lld/test/wasm/signature-mismatch.ll
index b3cfd1382b7..ed7bc6ba09c 100644
--- a/lld/test/wasm/signature-mismatch.ll
+++ b/lld/test/wasm/signature-mismatch.ll
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o
; RUN: llc -filetype=obj %s -o %t.main.o
-; RUN: not lld -flavor wasm --check-signatures -o %t.wasm %t.main.o %t.ret32.o 2>&1 | FileCheck %s
+; RUN: not lld -flavor wasm --check-signatures --check-signatures -o %t.wasm %t.main.o %t.ret32.o 2>&1 | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/stack-pointer.ll b/lld/test/wasm/stack-pointer.ll
index f9d2a18eb31..e97f13e259b 100644
--- a/lld/test/wasm/stack-pointer.ll
+++ b/lld/test/wasm/stack-pointer.ll
@@ -1,5 +1,5 @@
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: lld -flavor wasm --relocatable -o %t.wasm %t.o
+; RUN: lld -flavor wasm --check-signatures --relocatable -o %t.wasm %t.o
; RUN: obj2yaml %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/strip-debug.test b/lld/test/wasm/strip-debug.test
index 26329161596..f32e95c471c 100644
--- a/lld/test/wasm/strip-debug.test
+++ b/lld/test/wasm/strip-debug.test
@@ -1,5 +1,5 @@
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: lld -flavor wasm --check-signatures --strip-debug -o %t.wasm %t.start.o
RUN: obj2yaml %t.wasm | FileCheck %s
# Check that there is no name section
diff --git a/lld/test/wasm/symbol-type-mismatch.ll b/lld/test/wasm/symbol-type-mismatch.ll
index a8cbf5239aa..0408d2da1e0 100644
--- a/lld/test/wasm/symbol-type-mismatch.ll
+++ b/lld/test/wasm/symbol-type-mismatch.ll
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj %s -o %t.o
; RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o
-; RUN: not lld -flavor wasm -o %t.wasm %t.o %t.ret32.o 2>&1 | FileCheck %s
+; RUN: not lld -flavor wasm --check-signatures -o %t.wasm %t.o %t.ret32.o 2>&1 | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/undefined-entry.test b/lld/test/wasm/undefined-entry.test
index 49c495b3325..194d550968c 100644
--- a/lld/test/wasm/undefined-entry.test
+++ b/lld/test/wasm/undefined-entry.test
@@ -1,10 +1,10 @@
RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o
-RUN: not lld -flavor wasm -o %t.wasm %t.ret32.o 2>&1 | FileCheck %s
+RUN: not lld -flavor wasm --check-signatures -o %t.wasm %t.ret32.o 2>&1 | FileCheck %s
CHECK: error: undefined symbol: _start
-RUN: not lld -flavor wasm -entry=foo -o %t.wasm %t.ret32.o 2>&1 | FileCheck %s -check-prefix=CHECK-CUSTOM
+RUN: not lld -flavor wasm --check-signatures -entry=foo -o %t.wasm %t.ret32.o 2>&1 | FileCheck %s -check-prefix=CHECK-CUSTOM
CHECK-CUSTOM: error: undefined symbol: foo
-RUN: lld -flavor wasm -entry=foo --allow-undefined -o %t.wasm %t.ret32.o
+RUN: lld -flavor wasm --check-signatures -entry=foo --allow-undefined -o %t.wasm %t.ret32.o
diff --git a/lld/test/wasm/undefined.ll b/lld/test/wasm/undefined.ll
index 485862ca340..aabee79c7e2 100644
--- a/lld/test/wasm/undefined.ll
+++ b/lld/test/wasm/undefined.ll
@@ -1,13 +1,13 @@
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: lld -flavor wasm --allow-undefined -o %t.wasm %t.o
+; RUN: lld -flavor wasm --check-signatures --allow-undefined -o %t.wasm %t.o
; Fails due to undefined 'foo'
-; RUN: not lld -flavor wasm -o %t.wasm %t.o 2>&1 | FileCheck %s
+; RUN: not lld -flavor wasm --check-signatures -o %t.wasm %t.o 2>&1 | FileCheck %s
; CHECK: error: {{.*}}.o: undefined symbol: foo
; But succeeds if we pass a file containing 'foo' as --allow-undefined-file.
; RUN: echo 'foo' > %t.txt
-; RUN: lld -flavor wasm --allow-undefined-file=%t.txt -o %t.wasm %t.o
+; RUN: lld -flavor wasm --check-signatures --allow-undefined-file=%t.txt -o %t.wasm %t.o
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/version.ll b/lld/test/wasm/version.ll
index 473930067ef..9ebaebc5300 100644
--- a/lld/test/wasm/version.ll
+++ b/lld/test/wasm/version.ll
@@ -1,5 +1,5 @@
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: lld -flavor wasm -o %t.wasm %t.o
+; RUN: lld -flavor wasm --check-signatures -o %t.wasm %t.o
; RUN: llvm-readobj -file-headers %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/visibility-hidden.ll b/lld/test/wasm/visibility-hidden.ll
index d51c550ab5b..d377dcc377d 100644
--- a/lld/test/wasm/visibility-hidden.ll
+++ b/lld/test/wasm/visibility-hidden.ll
@@ -1,7 +1,7 @@
; RUN: llc -filetype=obj -o %t.o %s
; RUN: llc -filetype=obj %S/Inputs/hidden.ll -o %t2.o
; RUN: llvm-ar rcs %t2.a %t2.o
-; RUN: lld -flavor wasm %t.o %t2.a -o %t.wasm
+; RUN: lld -flavor wasm --check-signatures %t.o %t2.a -o %t.wasm
; RUN: obj2yaml %t.wasm | FileCheck %s
; Test that hidden symbols are not exported, whether pulled in from an archive
@@ -22,13 +22,13 @@ entry:
declare i32 @archiveHidden()
declare i32 @archiveDefault()
-define i32 @_start() {
+define void @_start() {
entry:
%call1 = call i32 @objectHidden()
%call2 = call i32 @objectDefault()
%call3 = call i32 @archiveHidden()
%call4 = call i32 @archiveDefault()
- ret i32 0
+ ret void
}
; CHECK: - Type: EXPORT
diff --git a/lld/test/wasm/weak-alias-overide.ll b/lld/test/wasm/weak-alias-overide.ll
index d1ee8dce234..fd2475e8b8c 100644
--- a/lld/test/wasm/weak-alias-overide.ll
+++ b/lld/test/wasm/weak-alias-overide.ll
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj -o %t.o %s
; RUN: llc -filetype=obj %S/Inputs/weak-alias.ll -o %t2.o
-; RUN: lld -flavor wasm %t.o %t2.o -o %t.wasm
+; RUN: lld -flavor wasm --check-signatures %t.o %t2.o -o %t.wasm
; RUN: obj2yaml %t.wasm | FileCheck %s
; Test that the strongly defined alias_fn from this file is used both here
diff --git a/lld/test/wasm/weak-alias.ll b/lld/test/wasm/weak-alias.ll
index 9e0a1fbf212..9ce2ff37865 100644
--- a/lld/test/wasm/weak-alias.ll
+++ b/lld/test/wasm/weak-alias.ll
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj -o %t.o %s
; RUN: llc -filetype=obj %S/Inputs/weak-alias.ll -o %t2.o
-; RUN: lld -flavor wasm %t.o %t2.o -o %t.wasm
+; RUN: lld -flavor wasm --check-signatures %t.o %t2.o -o %t.wasm
; RUN: obj2yaml %t.wasm | FileCheck %s
; Test that weak aliases (alias_fn is a weak alias of direct_fn) are linked correctly
@@ -10,10 +10,10 @@ target triple = "wasm32-unknown-unknown-wasm"
declare i32 @alias_fn() local_unnamed_addr #1
; Function Attrs: nounwind uwtable
-define i32 @_start() local_unnamed_addr #1 {
+define void @_start() local_unnamed_addr #1 {
entry:
%call = tail call i32 @alias_fn() #2
- ret i32 %call
+ ret void
}
; CHECK: --- !WASM
@@ -23,13 +23,13 @@ entry:
; CHECK-NEXT: - Type: TYPE
; CHECK-NEXT: Signatures:
; CHECK-NEXT: - Index: 0
-; CHECK-NEXT: ReturnType: I32
+; CHECK-NEXT: ReturnType: NORESULT
; CHECK-NEXT: ParamTypes:
; CHECK-NEXT: - Index: 1
-; CHECK-NEXT: ReturnType: NORESULT
+; CHECK-NEXT: ReturnType: I32
; CHECK-NEXT: ParamTypes:
; CHECK-NEXT: - Type: FUNCTION
-; CHECK-NEXT: FunctionTypes: [ 0, 0, 0, 0, 0, 0, 1 ]
+; CHECK-NEXT: FunctionTypes: [ 0, 1, 1, 1, 1, 1, 0 ]
; CHECK-NEXT: - Type: TABLE
; CHECK-NEXT: Tables:
; CHECK-NEXT: - ElemType: ANYFUNC
@@ -93,7 +93,7 @@ entry:
; CHECK-NEXT: Functions:
; CHECK-NEXT: - Index: 0
; CHECK-NEXT: Locals:
-; CHECK-NEXT: Body: 1081808080000B
+; CHECK-NEXT: Body: 1081808080001A0B
; CHECK-NEXT: - Index: 1
; CHECK-NEXT: Locals:
; CHECK-NEXT: Body: 41000B
@@ -138,7 +138,7 @@ entry:
; CHECK-NEXT: Name: __wasm_call_ctors
; CHECK-NEXT: ...
-; RUN: lld -flavor wasm --relocatable %t.o %t2.o -o %t.reloc.o
+; RUN: lld -flavor wasm --check-signatures --relocatable %t.o %t2.o -o %t.reloc.o
; RUN: obj2yaml %t.reloc.o | FileCheck %s -check-prefix=RELOC
; RELOC: --- !WASM
@@ -148,6 +148,9 @@ entry:
; RELOC-NEXT: - Type: TYPE
; RELOC-NEXT: Signatures:
; RELOC-NEXT: - Index: 0
+; RELOC-NEXT: ReturnType: NORESULT
+; RELOC-NEXT: ParamTypes:
+; RELOC-NEXT: - Index: 1
; RELOC-NEXT: ReturnType: I32
; RELOC-NEXT: ParamTypes:
; RELOC-NEXT: - Type: IMPORT
@@ -158,7 +161,7 @@ entry:
; RELOC-NEXT: GlobalType: I32
; RELOC-NEXT: GlobalMutable: false
; RELOC-NEXT: - Type: FUNCTION
-; RELOC-NEXT: FunctionTypes: [ 0, 0, 0, 0, 0, 0 ]
+; RELOC-NEXT: FunctionTypes: [ 0, 1, 1, 1, 1, 1 ]
; RELOC-NEXT: - Type: TABLE
; RELOC-NEXT: Tables:
; RELOC-NEXT: - ElemType: ANYFUNC
@@ -205,44 +208,44 @@ entry:
; RELOC-NEXT: Offset: 0x00000004
; RELOC-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB
; RELOC-NEXT: Index: 1
-; RELOC-NEXT: Offset: 0x00000012
+; RELOC-NEXT: Offset: 0x00000013
; RELOC-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB
; RELOC-NEXT: Index: 1
-; RELOC-NEXT: Offset: 0x0000001B
+; RELOC-NEXT: Offset: 0x0000001C
; RELOC-NEXT: - Type: R_WEBASSEMBLY_GLOBAL_INDEX_LEB
; RELOC-NEXT: Index: 0
-; RELOC-NEXT: Offset: 0x00000026
+; RELOC-NEXT: Offset: 0x00000027
; RELOC-NEXT: - Type: R_WEBASSEMBLY_GLOBAL_INDEX_LEB
; RELOC-NEXT: Index: 0
-; RELOC-NEXT: Offset: 0x00000031
+; RELOC-NEXT: Offset: 0x00000032
; RELOC-NEXT: - Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB
; RELOC-NEXT: Index: 1
-; RELOC-NEXT: Offset: 0x00000039
+; RELOC-NEXT: Offset: 0x0000003A
; RELOC-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB
; RELOC-NEXT: Index: 1
-; RELOC-NEXT: Offset: 0x00000042
+; RELOC-NEXT: Offset: 0x00000043
; RELOC-NEXT: - Type: R_WEBASSEMBLY_GLOBAL_INDEX_LEB
; RELOC-NEXT: Index: 0
-; RELOC-NEXT: Offset: 0x0000004F
+; RELOC-NEXT: Offset: 0x00000050
; RELOC-NEXT: - Type: R_WEBASSEMBLY_GLOBAL_INDEX_LEB
; RELOC-NEXT: Index: 0
-; RELOC-NEXT: Offset: 0x0000005C
+; RELOC-NEXT: Offset: 0x0000005D
; RELOC-NEXT: - Type: R_WEBASSEMBLY_GLOBAL_INDEX_LEB
; RELOC-NEXT: Index: 0
-; RELOC-NEXT: Offset: 0x00000067
+; RELOC-NEXT: Offset: 0x00000068
; RELOC-NEXT: - Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB
; RELOC-NEXT: Index: 1
-; RELOC-NEXT: Offset: 0x0000006F
+; RELOC-NEXT: Offset: 0x00000070
; RELOC-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB
; RELOC-NEXT: Index: 1
-; RELOC-NEXT: Offset: 0x00000078
+; RELOC-NEXT: Offset: 0x00000079
; RELOC-NEXT: - Type: R_WEBASSEMBLY_GLOBAL_INDEX_LEB
; RELOC-NEXT: Index: 0
-; RELOC-NEXT: Offset: 0x00000085
+; RELOC-NEXT: Offset: 0x00000086
; RELOC-NEXT: Functions:
; RELOC-NEXT: - Index: 0
; RELOC-NEXT: Locals:
-; RELOC-NEXT: Body: 1081808080000B
+; RELOC-NEXT: Body: 1081808080001A0B
; RELOC-NEXT: - Index: 1
; RELOC-NEXT: Locals:
; RELOC-NEXT: Body: 41000B
diff --git a/lld/test/wasm/weak-symbols.ll b/lld/test/wasm/weak-symbols.ll
index b2925730289..3ecb47a572e 100644
--- a/lld/test/wasm/weak-symbols.ll
+++ b/lld/test/wasm/weak-symbols.ll
@@ -1,7 +1,7 @@
; RUN: llc -filetype=obj %p/Inputs/weak-symbol1.ll -o %t1.o
; RUN: llc -filetype=obj %p/Inputs/weak-symbol2.ll -o %t2.o
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: lld -flavor wasm -no-gc-sections -o %t.wasm %t.o %t1.o %t2.o
+; RUN: lld -flavor wasm -no-gc-sections --check-signatures -o %t.wasm %t.o %t1.o %t2.o
; RUN: obj2yaml %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
@@ -9,11 +9,11 @@ target triple = "wasm32-unknown-unknown-wasm"
declare i32 @weakFn() local_unnamed_addr
@weakGlobal = external global i32
-define i32 @_start() local_unnamed_addr {
+define void @_start() local_unnamed_addr {
entry:
%call = call i32 @weakFn()
%val = load i32, i32* @weakGlobal, align 4
- ret i32 %val
+ ret void
}
; CHECK: --- !WASM
@@ -23,13 +23,13 @@ entry:
; CHECK-NEXT: - Type: TYPE
; CHECK-NEXT: Signatures:
; CHECK-NEXT: - Index: 0
-; CHECK-NEXT: ReturnType: I32
+; CHECK-NEXT: ReturnType: NORESULT
; CHECK-NEXT: ParamTypes:
; CHECK-NEXT: - Index: 1
-; CHECK-NEXT: ReturnType: NORESULT
+; CHECK-NEXT: ReturnType: I32
; CHECK-NEXT: ParamTypes:
; CHECK-NEXT: - Type: FUNCTION
-; CHECK-NEXT: FunctionTypes: [ 0, 0, 0, 0, 0, 1 ]
+; CHECK-NEXT: FunctionTypes: [ 0, 1, 1, 1, 1, 0 ]
; CHECK-NEXT: - Type: TABLE
; CHECK-NEXT: Tables:
; CHECK-NEXT: - ElemType: ANYFUNC
@@ -84,7 +84,7 @@ entry:
; CHECK-NEXT: Functions:
; CHECK-NEXT: - Index: 0
; CHECK-NEXT: Locals:
-; CHECK-NEXT: Body: 1081808080001A4100280280888080000B
+; CHECK-NEXT: Body: 1081808080001A0B
; CHECK-NEXT: - Index: 1
; CHECK-NEXT: Locals:
; CHECK-NEXT: Body: 41010B
diff --git a/lld/test/wasm/weak-undefined.ll b/lld/test/wasm/weak-undefined.ll
index fab4cd31dac..9205cf4232a 100644
--- a/lld/test/wasm/weak-undefined.ll
+++ b/lld/test/wasm/weak-undefined.ll
@@ -1,5 +1,5 @@
; RUN: llc -filetype=obj -o %t.o %s
-; RUN: lld -flavor wasm -strip-debug %t.o -o %t.wasm
+; RUN: lld -flavor wasm --check-signatures -strip-debug %t.o -o %t.wasm
; RUN: obj2yaml %t.wasm | FileCheck %s
; Test that undefined weak externals (global_var) and (foo) don't cause
@@ -20,10 +20,10 @@ define i32* @get_address_of_global_var() #0 {
ret i32* @global_var
}
-define i32 @_start() #0 {
+define void @_start() #0 {
entry:
- %0 = load i32, i32* @global_var, align 4
- ret i32 %0
+ %call = call i32* @get_address_of_global_var()
+ ret void
}
; CHECK: --- !WASM
@@ -39,7 +39,7 @@ entry:
; CHECK-NEXT: ReturnType: NORESULT
; CHECK-NEXT: ParamTypes:
; CHECK-NEXT: - Type: FUNCTION
-; CHECK-NEXT: FunctionTypes: [ 0, 0, 0, 1 ]
+; CHECK-NEXT: FunctionTypes: [ 0, 0, 1, 1 ]
; CHECK-NEXT: - Type: TABLE
; CHECK-NEXT: Tables:
; CHECK-NEXT: - ElemType: ANYFUNC
@@ -91,7 +91,7 @@ entry:
; CHECK-NEXT: Body: 4180808080000B
; CHECK-NEXT: - Index: 2
; CHECK-NEXT: Locals:
-; CHECK-NEXT: Body: 4100280280808080000B
+; CHECK-NEXT: Body: 1081808080001A0B
; CHECK-NEXT: - Index: 3
; CHECK-NEXT: Locals:
; CHECK-NEXT: Body: 0B
OpenPOWER on IntegriCloud