summaryrefslogtreecommitdiffstats
path: root/llvm/test/ObjectYAML
diff options
context:
space:
mode:
authorNicholas Wilson <nicholas@nicholaswilson.me.uk>2018-03-09 16:30:44 +0000
committerNicholas Wilson <nicholas@nicholaswilson.me.uk>2018-03-09 16:30:44 +0000
commit15f349f76f076202a8569ffdf15db153168bf4a2 (patch)
treeb7861b14e64ee98d74c8a5d50d7438f48a8ae39b /llvm/test/ObjectYAML
parent69df838b5298eb33b7f94c826e714f91abeafa53 (diff)
downloadbcm5719-llvm-15f349f76f076202a8569ffdf15db153168bf4a2.tar.gz
bcm5719-llvm-15f349f76f076202a8569ffdf15db153168bf4a2.zip
[WebAssembly] Disallow weak undefined globals in the object format
This implements https://github.com/WebAssembly/tool-conventions/pull/47 Differential Revision: https://reviews.llvm.org/D44201 llvm-svn: 327146
Diffstat (limited to 'llvm/test/ObjectYAML')
-rw-r--r--llvm/test/ObjectYAML/wasm/invalid_global_weak.yaml24
1 files changed, 24 insertions, 0 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
OpenPOWER on IntegriCloud