summaryrefslogtreecommitdiffstats
path: root/lld/test/wasm/import-name.ll
diff options
context:
space:
mode:
Diffstat (limited to 'lld/test/wasm/import-name.ll')
-rw-r--r--lld/test/wasm/import-name.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/lld/test/wasm/import-name.ll b/lld/test/wasm/import-name.ll
new file mode 100644
index 00000000000..a3953d33561
--- /dev/null
+++ b/lld/test/wasm/import-name.ll
@@ -0,0 +1,27 @@
+; RUN: llc -filetype=obj %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"
+
+declare void @f0() #0
+
+define void @_start() {
+ call void @f0()
+ ret void
+}
+
+attributes #0 = { "wasm-import-module"="somewhere" "wasm-import-name"="something" }
+
+; CHECK: - Type: IMPORT
+; CHECK-NEXT: Imports:
+; CHECK-NEXT: - Module: somewhere
+; CHECK-NEXT: Field: something
+; CHECK-NEXT: Kind: FUNCTION
+; CHECK-NEXT: SigIndex: 0
+
+; CHECK: - Type: CUSTOM
+; CHECK-NEXT: Name: name
+; CHECK-NEXT: FunctionNames:
+; CHECK-NEXT: - Index: 0
+; CHECK-NEXT: Name: f0
OpenPOWER on IntegriCloud