xref: /llvm-project/llvm/test/CodeGen/RISCV/optnone-store-no-combine.ll (revision 1456b68686808fa7c6ed7327aba65b639f81d5b8)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s | FileCheck %s
3
4; This test verifies that a repeated store is not eliminated with optnone (improves debugging).
5
6define void @foo(ptr %p) noinline optnone {
7; CHECK-LABEL: foo:
8; CHECK:       # %bb.0:
9; CHECK-NEXT:    li a1, 8
10; CHECK-NEXT:    sw a1, 0(a0)
11; CHECK-NEXT:    sw a1, 0(a0)
12; CHECK-NEXT:    ret
13  store i32 8, ptr %p, align 4
14  store i32 8, ptr %p, align 4
15  ret void
16}
17