42 lines · plain
1; RUN: llc < %s -O0 -wasm-disable-explicit-locals -wasm-keep-registers -asm-verbose=false | FileCheck %s2 3target triple = "wasm32-unknown-unknown"4 5declare void @foo(i128)6 7; CHECK-LABEL: test_zext:8; CHECK-NEXT: .functype test_zext (i32) -> (){{$}}9; CHECK-NEXT: i64.extend_i32_u $push[[TMP3:[0-9]+]]=, $0{{$}}10; CHECK-NEXT: i64.const $push[[TMP4:[0-9]+]]=, 1{{$}}11; CHECK-NEXT: i64.and $[[TMP1:[0-9]+]]=, $pop[[TMP3]], $pop[[TMP4]]{{$}}12; CHECK-NEXT: i64.const $[[TMP2:[0-9]+]]=, 0{{$}}13; CHECK-NEXT: call foo, $[[TMP1]], $[[TMP2]]{{$}}14; CHECK-NEXT: return{{$}}15define void @test_zext(i1 %b) nounwind {16 %res = zext i1 %b to i12817 br label %next18 19next: ; preds = %start20 call void @foo(i128 %res)21 ret void22}23 24; CHECK-LABEL: test_sext:25; CHECK-NEXT:.functype test_sext (i32) -> (){{$}}26; CHECK-NEXT: i64.extend_i32_u $push[[TMP3:[0-9]+]]=, $0{{$}}27; CHECK-NEXT: i64.const $push[[TMP4:[0-9]+]]=, 1{{$}}28; CHECK-NEXT: i64.and $[[TMP5:[0-9]+]]=, $pop[[TMP3]], $pop[[TMP4]]{{$}}29; CHECK-NEXT: i64.const $push[[TMP6:[0-9]+]]=, 0{{$}}30; CHECK-NEXT: i64.sub $[[TMP1:[0-9]+]]=, $pop[[TMP6]], $[[TMP5]]{{$}}31; CHECK-NEXT: local.copy $[[TMP2:[0-9]+]]=, $[[TMP1]]{{$}}32; CHECK-NEXT: call foo, $[[TMP1]], $[[TMP2]]{{$}}33; CHECK-NEXT: return{{$}}34define void @test_sext(i1 %b) nounwind {35 %res = sext i1 %b to i12836 br label %next37 38next: ; preds = %start39 call void @foo(i128 %res)40 ret void41}42