Skip to content

Commit dcfe7d4

Browse files
committed
Pre-commit test case
1 parent 2484060 commit dcfe7d4

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2+
; RUN: llc < %s -mtriple=riscv32 -mattr=+a,+experimental-zalasr | FileCheck %s
3+
4+
; FIXME: We should not fold -1920 into the lw instruction because we still
5+
; need it for the sw.rl.
6+
7+
define i32 @test(ptr %p) {
8+
; CHECK-LABEL: test:
9+
; CHECK: # %bb.0: # %entry
10+
; CHECK-NEXT: lui a1, 20
11+
; CHECK-NEXT: add a2, a0, a1
12+
; CHECK-NEXT: addi a1, a1, -1920
13+
; CHECK-NEXT: add a0, a0, a1
14+
; CHECK-NEXT: li a1, 2
15+
; CHECK-NEXT: sw.rl a1, (a0)
16+
; CHECK-NEXT: lw a0, -1920(a2)
17+
; CHECK-NEXT: ret
18+
entry:
19+
%gep0 = getelementptr [65536 x i32], ptr %p, i64 0, i32 20000
20+
store atomic i32 2, ptr %gep0 seq_cst, align 4
21+
%a = load i32, ptr %gep0
22+
ret i32 %a
23+
}

0 commit comments

Comments
 (0)