Skip to content

Commit 37cf39f

Browse files
committed
[AArch64] Add test for incorrect stxp register allocation (NFC)
This is a variant of #106380 without inline assembly.
1 parent a71407e commit 37cf39f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

llvm/test/CodeGen/AArch64/arm64-ldxr-stxr.ll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,18 @@ define dso_local i32 @test_store_release_i64(i32, i64 %val, ptr %addr) {
353353
ret i32 %res
354354
}
355355

356+
; The stxp result cannot be allocated to the same register as the inputs.
357+
; FIXME: This is a miscompile.
358+
define dso_local i32 @test_stxp_undef(ptr %p, i64 %x) nounwind {
359+
; CHECK-LABEL: test_stxp_undef:
360+
; CHECK: // %bb.0:
361+
; CHECK-NEXT: stxp w8, x8, x1, [x0]
362+
; CHECK-NEXT: mov w0, w8
363+
; CHECK-NEXT: ret
364+
%res = call i32 @llvm.aarch64.stxp(i64 undef, i64 %x, ptr %p)
365+
ret i32 %res
366+
}
367+
356368
declare i32 @llvm.aarch64.stlxr.p0(i64, ptr) nounwind
357369
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
358370
; FALLBACK: {{.*}}

0 commit comments

Comments
 (0)