]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Fix scan-gimple testcases on LE platforms.
authorArthur Cohen <arthur.cohen@embecosm.com>
Tue, 23 Jan 2024 16:19:31 +0000 (17:19 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Fri, 21 Mar 2025 11:56:57 +0000 (12:56 +0100)
gcc/testsuite/ChangeLog:

* rust/compile/macros/builtin/eager1.rs: Switch to scan-assembler directive as the
GIMPLE dump does not contain strings on LE.
* rust/compile/macros/builtin/recurse2.rs: Likewise.

gcc/testsuite/rust/compile/macros/builtin/eager1.rs
gcc/testsuite/rust/compile/macros/builtin/recurse2.rs

index 65a80fda62ef21a1b6488483d2b9f7294b3037be..7c6f6f95d61c8011aa482fa4d56fb1dfbccff403 100644 (file)
@@ -15,7 +15,7 @@ macro_rules! b {
 }
 
 fn main() {
-    // { dg-final { scan-tree-dump-times {"test1canary"} 1 gimple } }
+    // { dg-final { scan-assembler {"test1canary"} } }
     let _ = concat!(a!(), 1, b!());
     // should not error
     concat!(a!(), true, b!(),);
index 2e73ab54fb6032c43cf59421ca84c7afa6861dd6..73e6ab4aa6cd3d74eb6312385bd6b66ea18a6fa7 100644 (file)
@@ -15,7 +15,29 @@ macro_rules! a {
     };
 }
 
+extern "C" {
+    fn printf(fmt: *const i8, ...);
+}
+
+fn print_ptr(s: &str) {
+    unsafe {
+        printf("%p\n\0" as *const str as *const i8, s as *const str);
+    }
+}
+
+fn print_str(s: &str) {
+    unsafe {
+        printf(
+            "%s\n\0" as *const str as *const i8,
+            s as *const str as *const i8,
+        );
+    }
+}
+
+// { dg-final { scan-assembler {"abheyho"} } }
+static S: &str = concat!("a", 'b', a!(), a!(b c d e f a!()), '\0');
+
 fn main() {
-    // { dg-final { scan-tree-dump-times {"abheyho"} 1 gimple } }
-    let _ = concat!("a", 'b', a!(), a!(b c d e f a!()), '\0');
+    print_ptr(S);
+    print_str(S);
 }