diff --git a/llvm/test/CodeGen/RISCV/rv64i-shift-sext.ll b/llvm/test/CodeGen/RISCV/rv64i-shift-sext.ll index ab6e1127b90709..6d0a59980f01d0 100644 --- a/llvm/test/CodeGen/RISCV/rv64i-shift-sext.ll +++ b/llvm/test/CodeGen/RISCV/rv64i-shift-sext.ll @@ -158,3 +158,16 @@ define i64 @test11(i32* %0, i64 %1) { %5 = ashr exact i64 %4, 32 ret i64 %5 } + +; TODO: We should use slli+srai to enable the possibility of compressed +; instructions. +define i32 @test12(i32 signext %0) { +; RV64I-LABEL: test12: +; RV64I: # %bb.0: +; RV64I-NEXT: slliw a0, a0, 17 +; RV64I-NEXT: sraiw a0, a0, 15 +; RV64I-NEXT: ret + %2 = shl i32 %0, 17 + %3 = ashr i32 %2, 15 + ret i32 %3 +}