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 triple = "wasm32-unknown-unknown"
8 ; CHECK: i32.const $push0=, 0
9 define hidden i32 @a() #0 {
11 ret i32 zext (i1 icmp eq (void (...)* inttoptr (i32 10 to void (...)*), void (...)* null) to i32)
14 ; CHECK: i32.const $push0=, 1
15 ; CHECK: br_if 0, $pop0
16 define hidden i32 @b() #0 {
18 br i1 icmp eq (void (...)* inttoptr (i32 10 to void (...)*), void (...)* null), label %a, label %b
25 ; CHECK: i32.const $push1=, 0
26 ; CHECK: i32.const $push2=, 0
27 ; CHECK: i32.store 0($pop1), $pop2
28 define hidden i32 @c() #0 {
30 store i32 zext (i1 icmp eq (void (...)* inttoptr (i32 10 to void (...)*), void (...)* null) to i32), i32* inttoptr (i32 0 to i32 *)
34 ; CHECK: i32.const {{.*}}, addr
35 ; CHECK: i32.const {{.*}}, 24
37 ; CHECK: i32.const {{.*}}, 24
39 ; CHECK: i32.const {{.*}}, 64
41 ; CHECK: i32.const {{.*}}, 1
44 ; CHECK: br_if 0, $pop{{[0-9]+}}
45 define hidden i32 @d() #0 {
47 %t = icmp slt i8 ptrtoint (void ()* @addr to i8), 64
48 br i1 %t, label %a, label %b
55 ; CHECK: i32.const {{.*}}, addr
56 ; CHECK: i32.const {{.*}}, 255
58 ; CHECK: i32.const {{.*}}, 64
60 ; CHECK: i32.const {{.*}}, 1
63 ; CHECK: br_if 0, $pop{{[0-9]+}}
64 define hidden i32 @e() #0 {
66 %t = icmp ult i8 ptrtoint (void ()* @addr to i8), 64
67 br i1 %t, label %a, label %b
74 ; CHECK: i32.const {{.*}}, addr
75 ; CHECK: i32.const {{.*}}, 24
77 ; CHECK: i32.const {{.*}}, 24
79 define hidden i32 @f() #0 {
81 %t = sext i8 ptrtoint (void ()* @addr to i8) to i32
85 ; CHECK: i32.const {{.*}}, addr
86 ; CHECK: i32.const {{.*}}, 255
88 define hidden i32 @g() #0 {
90 %t = zext i8 ptrtoint (void ()* @addr to i8) to i32
96 attributes #0 = { noinline optnone }