Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WebAssembly] Support imports from custom module names
Fixes: https://bugs.llvm.org/show_bug.cgi?id=37168 This is only a first pass at supporting these custom import modules. In the long run we most likely want to treat these kinds of symbols very differently. For example, it should not be possible to resolve such as symbol at static link type. Differential Revision: https://reviews.llvm.org/D45796 llvm-svn: 352828
- Loading branch information
Showing
9 changed files
with
48 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters