about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-04-17 21:53:26 +0200
committerGitHub <noreply@github.com>2025-04-17 21:53:26 +0200
commit18f6c595ee3efeefe9be08f70bea53c899471e7b (patch)
tree29fc45a90ac10643bd1e32c4fa189da1dddc5cae
parent4c92186f21c6ec14ed4c3977df326913fc9fdb91 (diff)
parent7a5a884275b0bdbd28397c814b45f71d10b45439 (diff)
downloadrust-18f6c595ee3efeefe9be08f70bea53c899471e7b.tar.gz
rust-18f6c595ee3efeefe9be08f70bea53c899471e7b.zip
Rollup merge of #139971 - LukasWoodtli:gardena/lw/fix-cstring-merging-test, r=wesleywiser
Make C string merging test work on MIPS

Assembly for MIPS uses, by convention, a different prefix for local anonymous variables.
-rw-r--r--tests/assembly/cstring-merging.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/assembly/cstring-merging.rs b/tests/assembly/cstring-merging.rs
index b5c530ac35d..f7d0775f7af 100644
--- a/tests/assembly/cstring-merging.rs
+++ b/tests/assembly/cstring-merging.rs
@@ -1,3 +1,5 @@
+// MIPS assembler uses the label prefix `$anon.` for local anonymous variables
+// other architectures (including ARM and x86-64) use the prefix `.Lanon.`
 //@ only-linux
 //@ assembly-output: emit-asm
 //@ compile-flags: --crate-type=lib -Copt-level=3
@@ -6,13 +8,13 @@
 use std::ffi::CStr;
 
 // CHECK: .section .rodata.str1.{{[12]}},"aMS"
-// CHECK: .Lanon.{{.+}}:
+// CHECK: {{(\.L|\$)}}anon.{{.+}}:
 // CHECK-NEXT: .asciz "foo"
 #[unsafe(no_mangle)]
 static CSTR: &[u8; 4] = b"foo\0";
 
 // CHECK-NOT: .section
-// CHECK: .Lanon.{{.+}}:
+// CHECK: {{(\.L|\$)}}anon.{{.+}}:
 // CHECK-NEXT: .asciz "bar"
 #[unsafe(no_mangle)]
 pub fn cstr() -> &'static CStr {
@@ -20,7 +22,7 @@ pub fn cstr() -> &'static CStr {
 }
 
 // CHECK-NOT: .section
-// CHECK: .Lanon.{{.+}}:
+// CHECK: {{(\.L|\$)}}anon.{{.+}}:
 // CHECK-NEXT: .asciz "baz"
 #[unsafe(no_mangle)]
 pub fn manual_cstr() -> &'static str {