1 ; RUN: llc < %s -march=sparc | FileCheck %s
2 ; RUN: llc -O0 < %s -march=sparc | FileCheck %s
4 ;; llc -O0 used to try to spill Y to the stack, which isn't possible,
5 ;; and then crashed. Additionally, in -O1, it would omit the second
6 ;; apparently-redundant wr to %y, which is not actually redundant
7 ;; because the spec says to treat %y as potentially-written by udiv.
9 ; CHECK-LABEL: two_divides:
10 ; CHECK: wr %g0, %g0, %y
12 ; CHECK: wr %g0, %g0, %y
16 define i32 @two_divides(i32 %a, i32 %b) {