1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -start-after codegenprepare -mtriple=riscv64 -mattr=-v -o - %s | FileCheck %s
3; RUN: llc -start-after codegenprepare -mtriple=riscv64 -mattr=+v -o - %s | FileCheck %s
4
5; Reproducer for https://github.com/llvm/llvm-project/issues/55168.
6; We should always return 1 (and not -1).
7define i32 @test(i32 %call.i) {
8; CHECK-LABEL: test:
9; CHECK:       # %bb.0:
10; CHECK-NEXT:    li a0, 1
11; CHECK-NEXT:    ret
12  %t2 = insertelement <2 x i32> <i32 poison, i32 -2147483648>, i32 %call.i, i64 0
13  %t3 = icmp slt <2 x i32> %t2, <i32 -2147483646, i32 -2147483646>
14  %t4 = zext <2 x i1> %t3 to <2 x i32>
15  %t6 = extractelement <2 x i32> %t4, i64 1
16  ret i32 %t6
17}
18