summaryrefslogtreecommitdiffstats
path: root/test/MC/WebAssembly/import-module.ll
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2019-02-12 12:27:08 +0000
committerHans Wennborg <hans@hanshq.net>2019-02-12 12:27:08 +0000
commit831b2047290f564ff3f07acb77e9ea72910e70ed (patch)
tree6ae44f0d1b7eb5932f6744025e2d6bc834542867 /test/MC/WebAssembly/import-module.ll
parentd1ca490a0d7ca03a6e2e0f3aa5aae6701d887a90 (diff)
[WebAssembly] Backport custom import name changes for LLVM to 8.0.
Specifically, this backports r352479, r352931, r353474, and r353476 to the 8.0 branch. The trunk patches don't apply cleanly to 8.0 due to some contemporaneous mass-rename and mass-clang-tidy patches, so this merges them to simplify rebasing. r352479 [WebAssembly] Re-enable main-function signature rewriting r352931 [WebAssembly] Add codegen support for the import_field attribute r353474 [WebAssembly] Fix imported function symbol names that differ from their import names in the .o format r353476 [WebAssembly] Update test output after rL353474. NFC. By Dan Gohman! git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_80@353835 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/WebAssembly/import-module.ll')
-rw-r--r--test/MC/WebAssembly/import-module.ll31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/MC/WebAssembly/import-module.ll b/test/MC/WebAssembly/import-module.ll
new file mode 100644
index 000000000000..461d5c20ae9b
--- /dev/null
+++ b/test/MC/WebAssembly/import-module.ll
@@ -0,0 +1,31 @@
+; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
+
+target triple = "wasm32-unknown-unknown"
+
+define void @test() {
+ call void @foo()
+ call void @plain()
+ ret void
+}
+
+declare void @foo() #0
+declare void @plain()
+
+attributes #0 = { "wasm-import-module"="bar" "wasm-import-name"="qux" }
+
+; CHECK: - Type: IMPORT
+; CHECK-NEXT: Imports:
+; CHECK: - Module: bar
+; CHECK-NEXT: Field: qux
+; CHECK-NEXT: Kind: FUNCTION
+
+; CHECK: - Module: env
+; CHECK-NEXT: Field: plain
+; CHECK-NEXT: Kind: FUNCTION
+
+; CHECK: - Type: CUSTOM
+; CHECK: Name: foo
+; CHECK-NEXT: Flags: [ UNDEFINED ]
+
+; CHECK: Name: plain
+; CHECK-NEXT: Flags: [ UNDEFINED ]