WebAssembly: support imports
[oota-llvm.git] / test / CodeGen / WebAssembly / import.ll
1 ; RUN: llc < %s -asm-verbose=false | FileCheck %s
2
3 target datalayout = "e-p:32:32-i64:64-n32:64-S128"
4 target triple = "wasm32-unknown-unknown"
5
6 ; CHECK-LABEL: .text
7 ; CHECK-LABEL: f:
8 define void @f(i32 %a, float %b) {
9   tail call i32 @printi(i32 %a)
10   tail call float @printf(float %b)
11   tail call void @printv()
12   ret void
13 }
14
15 ; CHECK-LABEL: .imports
16 ; CHECK-NEXT:  .import $printi "" "printi" (param i32) (result i32)
17 ; CHECK-NEXT:  .import $printf "" "printf" (param f32) (result f32)
18 ; CHECK-NEXT:  .import $printv "" "printv"
19 declare i32 @printi(i32)
20 declare float @printf(float)
21 declare void @printv()