summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object/wasm-duplicate-name.test
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2018-01-12 02:11:31 +0000
committerSam Clegg <sbc@chromium.org>2018-01-12 02:11:31 +0000
commit4710ed7a8ce3224c0d1fbb43748752513b0b6912 (patch)
tree70ae8555b7736709021f262a6d9f0fc46bf662b5 /llvm/test/Object/wasm-duplicate-name.test
parent1b31eb94148465eecf4bb50b16d8f26ac2dcc701 (diff)
downloadbcm5719-llvm-4710ed7a8ce3224c0d1fbb43748752513b0b6912.tar.gz
bcm5719-llvm-4710ed7a8ce3224c0d1fbb43748752513b0b6912.zip
[WebAssembly] Don't allow functions to be named twice
The spec doesn't allow this. Differential Revision: https://reviews.llvm.org/D41974 llvm-svn: 322343
Diffstat (limited to 'llvm/test/Object/wasm-duplicate-name.test')
-rw-r--r--llvm/test/Object/wasm-duplicate-name.test28
1 files changed, 28 insertions, 0 deletions
diff --git a/llvm/test/Object/wasm-duplicate-name.test b/llvm/test/Object/wasm-duplicate-name.test
new file mode 100644
index 00000000000..1bf20778028
--- /dev/null
+++ b/llvm/test/Object/wasm-duplicate-name.test
@@ -0,0 +1,28 @@
+# RUN: yaml2obj %s | not llvm-objdump -h - 2>&1 | FileCheck %s
+
+--- !WASM
+FileHeader:
+ Version: 0x00000001
+Sections:
+ - Type: TYPE
+ Signatures:
+ - Index: 0
+ ReturnType: I32
+ ParamTypes:
+ - I32
+ - Type: IMPORT
+ Imports:
+ - Module: foo
+ Field: a
+ Kind: FUNCTION
+ SigIndex: 0
+ - Type: CUSTOM
+ Name: name
+ FunctionNames:
+ - Index: 0
+ Name: a
+ - Index: 0
+ Name: b
+...
+
+# CHECK: {{.*}}: Function named more than once
OpenPOWER on IntegriCloud