867db778aaef407cda258d3de532ba73a74e6ad6
[oota-llvm.git] / test / CodeGen / WebAssembly / conv.ll
1 ; RUN: llc < %s -asm-verbose=false | FileCheck %s
2
3 ; Test that basic conversion operations assemble as expected.
4
5 target datalayout = "e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown"
7
8 ; CHECK-LABEL: $wrap_i64_i32
9 ; CHECK-NEXT: (param i64) (result i32)
10 ; CHECK-NEXT: (set_local @0 (argument 0))
11 ; CHECK-NEXT: (set_local @1 (wrap_i64 @0))
12 ; CHECK-NEXT: (return @1)
13 define i32 @wrap_i64_i32(i64 %x) {
14   %a = trunc i64 %x to i32
15   ret i32 %a
16 }