diff options
author | Dan Gohman <dan433584@gmail.com> | 2015-09-15 00:55:19 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2015-09-15 00:55:19 +0000 |
commit | 311b488d767fa33cc370cbaa48df74702e1a8b8e (patch) | |
tree | 93a96f42380774aa15a9340269769574f1f4c9bb /llvm/test/CodeGen/WebAssembly/conv.ll | |
parent | cadbf3dcf84eaa95d5b7785ca6d5b005c6a91757 (diff) | |
download | bcm5719-llvm-311b488d767fa33cc370cbaa48df74702e1a8b8e.tar.gz bcm5719-llvm-311b488d767fa33cc370cbaa48df74702e1a8b8e.zip |
[WebAssembly] Implement int64-to-int32 conversion.
llvm-svn: 247649
Diffstat (limited to 'llvm/test/CodeGen/WebAssembly/conv.ll')
-rw-r--r-- | llvm/test/CodeGen/WebAssembly/conv.ll | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/WebAssembly/conv.ll b/llvm/test/CodeGen/WebAssembly/conv.ll new file mode 100644 index 00000000000..ae82abfe79d --- /dev/null +++ b/llvm/test/CodeGen/WebAssembly/conv.ll @@ -0,0 +1,16 @@ +; RUN: llc < %s -asm-verbose=false | FileCheck %s + +; Test that basic conversion operations assemble as expected. + +target datalayout = "e-p:32:32-i64:64-n32:64-S128" +target triple = "wasm32-unknown-unknown" + +; CHECK-LABEL: $wrap_i64_i32 +; CHECK-NEXT: (param i64) (result i32) +; CHECK-NEXT: (setlocal @0 (argument 0)) +; CHECK-NEXT: (setlocal @1 (wrap_i64 @0)) +; CHECK-NEXT: (return @1) +define i32 @wrap_i64_i32(i64 %x) { + %a = trunc i64 %x to i32 + ret i32 %a +} |