1 ; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers -verify-machineinstrs | FileCheck %s
2 ; RUN: llc < %s -asm-verbose=false -wasm-keep-registers -fast-isel -verify-machineinstrs | FileCheck %s
4 ; Test that FastISel does not generate instructions with NoReg
6 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
7 target triple = "wasm32-unknown-unknown"
9 ; CHECK: i32.const $push0=, 0
10 define hidden i32 @a() #0 {
12 ret i32 zext (i1 icmp eq (void (...)* inttoptr (i32 10 to void (...)*), void (...)* null) to i32)
15 ; CHECK: i32.const $push0=, 1
16 ; CHECK: br_if 0, $pop0
17 define hidden i32 @b() #0 {
19 br i1 icmp eq (void (...)* inttoptr (i32 10 to void (...)*), void (...)* null), label %a, label %b
26 ; CHECK: i32.const $push1=, 0
27 ; CHECK: i32.const $push2=, 0
28 ; CHECK: i32.store 0($pop1), $pop2
29 define hidden i32 @c() #0 {
31 store i32 zext (i1 icmp eq (void (...)* inttoptr (i32 10 to void (...)*), void (...)* null) to i32), i32* inttoptr (i32 0 to i32 *)
35 ; CHECK: i32.const {{.*}}, addr
36 ; CHECK: i32.const {{.*}}, 24
38 ; CHECK: i32.const {{.*}}, 24
40 ; CHECK: i32.const {{.*}}, 64
42 ; CHECK: i32.const {{.*}}, 1
45 ; CHECK: br_if 0, $pop{{[0-9]+}}
46 define hidden i32 @d() #0 {
48 %t = icmp slt i8 ptrtoint (void ()* @addr to i8), 64
49 br i1 %t, label %a, label %b
56 ; CHECK: i32.const {{.*}}, addr
57 ; CHECK: i32.const {{.*}}, 255
59 ; CHECK: i32.const {{.*}}, 64
61 ; CHECK: i32.const {{.*}}, 1
64 ; CHECK: br_if 0, $pop{{[0-9]+}}
65 define hidden i32 @e() #0 {
67 %t = icmp ult i8 ptrtoint (void ()* @addr to i8), 64
68 br i1 %t, label %a, label %b
75 ; CHECK: i32.const {{.*}}, addr
76 ; CHECK: i32.const {{.*}}, 24
78 ; CHECK: i32.const {{.*}}, 24
80 define hidden i32 @f() #0 {
82 %t = sext i8 ptrtoint (void ()* @addr to i8) to i32
86 ; CHECK: i32.const {{.*}}, addr
87 ; CHECK: i32.const {{.*}}, 255
89 define hidden i32 @g() #0 {
91 %t = zext i8 ptrtoint (void ()* @addr to i8) to i32
97 attributes #0 = { noinline optnone }