summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/ObjectYAML/wasm/invalid_global_weak.yaml24
-rw-r--r--llvm/test/tools/llvm-nm/wasm/weak-symbols.yaml17
2 files changed, 27 insertions, 14 deletions
diff --git a/llvm/test/ObjectYAML/wasm/invalid_global_weak.yaml b/llvm/test/ObjectYAML/wasm/invalid_global_weak.yaml
new file mode 100644
index 00000000000..557882dcaab
--- /dev/null
+++ b/llvm/test/ObjectYAML/wasm/invalid_global_weak.yaml
@@ -0,0 +1,24 @@
+# RUN: yaml2obj < %s | not obj2yaml 2>&1 | FileCheck %s
+
+--- !WASM
+FileHeader:
+ Version: 0x00000001
+Sections:
+ - Type: IMPORT
+ Imports:
+ - Module: fiz
+ Field: imported_global
+ Kind: GLOBAL
+ GlobalType: I32
+ GlobalMutable: false
+ - Type: CUSTOM
+ Name: linking
+ SymbolTable:
+ - Index: 0
+ Kind: GLOBAL
+ Name: imported_global
+ Flags: [ BINDING_WEAK, UNDEFINED ]
+ Global: 0
+...
+
+# CHECK: Error reading file: <stdin>: undefined weak global symbol
diff --git a/llvm/test/tools/llvm-nm/wasm/weak-symbols.yaml b/llvm/test/tools/llvm-nm/wasm/weak-symbols.yaml
index 1d0b0d1f6b5..e758194e2ff 100644
--- a/llvm/test/tools/llvm-nm/wasm/weak-symbols.yaml
+++ b/llvm/test/tools/llvm-nm/wasm/weak-symbols.yaml
@@ -18,16 +18,11 @@ Sections:
Field: weak_import_func
Kind: FUNCTION
SigIndex: 0
- - Module: env
- Field: weak_import_global
- Kind: GLOBAL
- GlobalType: I32
- GlobalMutable: false
- Type: FUNCTION
FunctionTypes: [ 0 ]
- Type: GLOBAL
Globals:
- - Index: 1
+ - Index: 0
Type: I32
Mutable: false
InitExpr:
@@ -64,7 +59,7 @@ Sections:
Kind: GLOBAL
Name: weak_defined_global
Flags: [ BINDING_WEAK ]
- Global: 1
+ Global: 0
- Index: 3
Kind: DATA
Name: weak_import_data
@@ -74,11 +69,6 @@ Sections:
Name: weak_import_func
Flags: [ BINDING_WEAK, UNDEFINED ]
Function: 0
- - Index: 5
- Kind: GLOBAL
- Name: weak_import_global
- Flags: [ BINDING_WEAK, UNDEFINED ]
- Global: 0
SegmentInfo:
- Index: 0
Name: .rodata.constantData
@@ -88,7 +78,6 @@ Sections:
# CHECK: 00000000 W weak_defined_data
# CHECK-NEXT: 00000001 W weak_defined_func
-# CHECK-NEXT: 00000001 W weak_defined_global
+# CHECK-NEXT: 00000000 W weak_defined_global
# CHECK-NEXT: w weak_import_data
# CHECK-NEXT: w weak_import_func
-# CHECK-NEXT: w weak_import_global
OpenPOWER on IntegriCloud