From 72259e2e76eeb16ec55cb568ed673b2496578d30 Mon Sep 17 00:00:00 2001 From: Augie Fackler Date: Wed, 14 Jan 2026 14:11:05 -0500 Subject: [PATCH] tests: fix loongarch test for new LLVM 23 codegen It looks like the behavior only changed for loongarch32, so maybe the better path would be to split the test into 32 and 64 bit files, and then the 32 bit one could use revisions for LLVM versions, which would obviate the need for the goofy regular expression dancing. I'm not really sure what the best outcome is for this test, so I'm very open to suggestions. --- tests/assembly-llvm/asm/loongarch-type.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/assembly-llvm/asm/loongarch-type.rs b/tests/assembly-llvm/asm/loongarch-type.rs index e0a7940f89a36..076912e8163c8 100644 --- a/tests/assembly-llvm/asm/loongarch-type.rs +++ b/tests/assembly-llvm/asm/loongarch-type.rs @@ -28,8 +28,10 @@ extern "C" { // CHECK-LABEL: sym_fn: // CHECK: #APP -// CHECK: pcalau12i $t0, %got_pc_hi20(extern_func) -// CHECK: ld.{{[wd]}} $t0, $t0, %got_pc_lo12(extern_func) +// loongarch64: pcalau12i $t0, %got_pc_hi20(extern_func) +// loongarch64: ld.d $t0, $t0, %got_pc_lo12(extern_func) +// loongarch32: pca{{(lau|ddu)}}12i $t0, %got_pc{{(add)?}}_hi20(extern_func) +// loongarch32: ld.w $t0, $t0, %got_pc{{(add)?}}_lo12({{(extern_func|\.Lpcadd_hi0)}}) // CHECK: #NO_APP #[no_mangle] pub unsafe fn sym_fn() { @@ -38,8 +40,10 @@ pub unsafe fn sym_fn() { // CHECK-LABEL: sym_static: // CHECK: #APP -// CHECK: pcalau12i $t0, %got_pc_hi20(extern_static) -// CHECK: ld.{{[wd]}} $t0, $t0, %got_pc_lo12(extern_static) +// loongarch64: pcalau12i $t0, %got_pc_hi20(extern_static) +// loongarch64: ld.d $t0, $t0, %got_pc_lo12(extern_static) +// loongarch32: pca{{(lau|ddu)}}12i $t0, %got_pc{{(add)?}}_hi20(extern_static) +// loongarch32: ld.w $t0, $t0, %got_pc{{(add)?}}_lo12({{(extern_static|\.Lpcadd_hi1)}}) // CHECK: #NO_APP #[no_mangle] pub unsafe fn sym_static() {