diff options
Diffstat (limited to 'lld/test/wasm/import-attribute-mismatch.ll')
-rw-r--r-- | lld/test/wasm/import-attribute-mismatch.ll | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lld/test/wasm/import-attribute-mismatch.ll b/lld/test/wasm/import-attribute-mismatch.ll new file mode 100644 index 00000000000..d3ba294a212 --- /dev/null +++ b/lld/test/wasm/import-attribute-mismatch.ll @@ -0,0 +1,18 @@ +; RUN: llc -filetype=obj %s -o %t1.o +; RUN: llc -filetype=obj %S/Inputs/import-attributes.ll -o %t2.o +; RUN: not wasm-ld --export call_foo --allow-undefined -o %t.wasm %t1.o %t2.o 2>&1 | FileCheck %s + +target triple = "wasm32-unknown-unknown-wasm" + +define void @_start() { + call void @foo(); + ret void +} + +declare void @foo() #0 + +attributes #0 = { "wasm-import-module"="bar" } + +; CHECK: wasm-ld: error: import module mismatch for symbol: foo +; CHECK: >>> defined as bar in {{.*}}1.o +; CHECK: >>> defined as baz in {{.*}}2.o |