summaryrefslogtreecommitdiffstats
path: root/lld/test/wasm/lto/import-attributes.ll
diff options
context:
space:
mode:
Diffstat (limited to 'lld/test/wasm/lto/import-attributes.ll')
-rw-r--r--lld/test/wasm/lto/import-attributes.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/lld/test/wasm/lto/import-attributes.ll b/lld/test/wasm/lto/import-attributes.ll
new file mode 100644
index 00000000000..afbb8e15c00
--- /dev/null
+++ b/lld/test/wasm/lto/import-attributes.ll
@@ -0,0 +1,22 @@
+; RUN: llvm-as %s -o %t.o
+; RUN: wasm-ld --allow-undefined -o %t.wasm %t.o
+; RUN: obj2yaml %t.wasm | FileCheck %s
+
+target triple = "wasm32-unknown-unknown-wasm"
+target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
+
+define void @_start() {
+ call void @foo();
+ ret void
+}
+
+declare void @foo() #0
+
+attributes #0 = { "wasm-import-module"="bar" "wasm-import-name"="customfoo" }
+
+; CHECK: - Type: IMPORT
+; CHECK-NEXT: Imports:
+; CHECK-NEXT: - Module: bar
+; CHECK-NEXT: Field: customfoo
+; CHECK-NEXT: Kind: FUNCTION
+; CHECK-NEXT: SigIndex: 0
OpenPOWER on IntegriCloud