Files
archived-llvm/test/CodeGen/WebAssembly/import.ll
JF Bastien 3aa0189bfe WebAssembly: support imports
C/C++ code can declare an extern function, which will show up as an import in WebAssembly's output. It's expected that the linker will resolve these, and mark unresolved imports as call_import (I have a patch which does this in wasmate).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250875 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-21 02:23:09 +00:00

22 lines
607 B
LLVM

; RUN: llc < %s -asm-verbose=false | FileCheck %s
target datalayout = "e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32-unknown-unknown"
; CHECK-LABEL: .text
; CHECK-LABEL: f:
define void @f(i32 %a, float %b) {
tail call i32 @printi(i32 %a)
tail call float @printf(float %b)
tail call void @printv()
ret void
}
; CHECK-LABEL: .imports
; CHECK-NEXT: .import $printi "" "printi" (param i32) (result i32)
; CHECK-NEXT: .import $printf "" "printf" (param f32) (result f32)
; CHECK-NEXT: .import $printv "" "printv"
declare i32 @printi(i32)
declare float @printf(float)
declare void @printv()