blob: ef2494bdb08bfe7e6eeb3b6541ac7e2cf9ea0856 [file] [log] [blame]
Wouter van Oortmerssen8a9cb242018-08-27 15:45:51 +00001; RUN: llc < %s -O0 -wasm-keep-registers
Dan Gohman4576dc02018-04-17 20:46:42 +00002; PR36564
Dan Gohmanb8184822018-05-22 04:58:36 +00003; PR37546
Dan Gohman4576dc02018-04-17 20:46:42 +00004
5; Test that fast-isel properly copes with i24 arguments and return types.
6
7target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
Sam Clegga5908002018-05-10 17:49:11 +00008target triple = "wasm32-unknown-unknown"
Dan Gohman4576dc02018-04-17 20:46:42 +00009
Dan Gohmanb8184822018-05-22 04:58:36 +000010; CHECK-LABEL: add:
11; CHECK-NEXT: .param i32, i32{{$}}
12; CHECK-NEXT: .result i32{{$}}
13; CHECK-NEXT: get_local $push2=, 0{{$}}
14; CHECK-NEXT: get_local $push1=, 1{{$}}
15; CHECK-NEXT: i32.add $push0=, $pop2, $pop1{{$}}
16; CHECK-NEXT: end_function
Dan Gohman4576dc02018-04-17 20:46:42 +000017define i24 @add(i24 %x, i24 %y) {
18 %z = add i24 %x, %y
19 ret i24 %z
20}
21
Dan Gohmanb8184822018-05-22 04:58:36 +000022; CHECK-LABEL: return_zero:
23; CHECK-NEXT: .result i32{{$}}
24; CHECK-NEXT: i32.const $push0=, 0{{$}}
25; CHECK-NEXT: end_function
Dan Gohman4576dc02018-04-17 20:46:42 +000026define i24 @return_zero() {
27 ret i24 0
28}