aboutsummaryrefslogtreecommitdiff
path: root/test/wasm/import-module.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/wasm/import-module.ll')
-rw-r--r--test/wasm/import-module.ll21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/wasm/import-module.ll b/test/wasm/import-module.ll
new file mode 100644
index 000000000000..9a473194ce2c
--- /dev/null
+++ b/test/wasm/import-module.ll
@@ -0,0 +1,21 @@
+; 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-wasm"
+
+define void @_start() {
+ call void @foo();
+ ret void
+}
+
+declare void @foo() #0
+
+attributes #0 = { "wasm-import-module"="bar" }
+
+; CHECK: - Type: IMPORT
+; CHECK-NEXT: Imports:
+; CHECK-NEXT: - Module: bar
+; CHECK-NEXT: Field: foo
+; CHECK-NEXT: Kind: FUNCTION
+; CHECK-NEXT: SigIndex: 0