[committed 12/88] gccrs: testsuite: Handle Windows carriage returns properly

arthur.cohen@embecosm.com arthur.cohen@embecosm.com
Wed Apr 5 14:02:56 GMT 2023


From: Arthur Cohen <arthur.cohen@embecosm.com>

In dg-output, check for \r* carriage returns to make sure execution
tests pass on windows platforms

gcc/testsuite/ChangeLog:

	* rust/execute/torture/builtin_macro_cfg.rs: Handle carriage returns
		properly.
	* rust/execute/torture/builtin_macro_concat.rs: Likewise.
	* rust/execute/torture/builtin_macro_env.rs: Likewise.
	* rust/execute/torture/builtin_macro_include_bytes.rs: Likewise.
	* rust/execute/torture/builtin_macro_include_str.rs: Likewise.
	* rust/execute/torture/builtin_macro_line.rs: Likewise.
	* rust/execute/torture/builtin_macros1.rs: Likewise.
	* rust/execute/torture/builtin_macros3.rs: Likewise.
	* rust/execute/torture/cfg1.rs: Likewise.
	* rust/execute/torture/cfg2.rs: Likewise.
	* rust/execute/torture/cfg3.rs: Likewise.
	* rust/execute/torture/cfg4.rs: Likewise.
	* rust/execute/torture/coercion1.rs: Likewise.
	* rust/execute/torture/coercion2.rs: Likewise.
	* rust/execute/torture/extern_mod4.rs: Likewise.
	* rust/execute/torture/helloworld1.rs: Likewise.
	* rust/execute/torture/helloworld2.rs: Likewise.
	* rust/execute/torture/issue-1198.rs: Likewise.
	* rust/execute/torture/issue-1231.rs: Likewise.
	* rust/execute/torture/issue-1232.rs: Likewise.
	* rust/execute/torture/issue-1249.rs: Likewise.
	* rust/execute/torture/issue-1436.rs: Likewise.
	* rust/execute/torture/issue-1496.rs: Likewise.
	* rust/execute/torture/issue-647.rs: Likewise.
	* rust/execute/torture/issue-845.rs: Likewise.
	* rust/execute/torture/issue-851.rs: Likewise.
	* rust/execute/torture/issue-858.rs: Likewise.
	* rust/execute/torture/issue-976.rs: Likewise.
	* rust/execute/torture/macros10.rs: Likewise.
	* rust/execute/torture/macros11.rs: Likewise.
	* rust/execute/torture/macros12.rs: Likewise.
	* rust/execute/torture/macros13.rs: Likewise.
	* rust/execute/torture/macros14.rs: Likewise.
	* rust/execute/torture/macros2.rs: Likewise.
	* rust/execute/torture/macros22.rs: Likewise.
	* rust/execute/torture/macros29.rs: Likewise.
	* rust/execute/torture/macros3.rs: Likewise.
	* rust/execute/torture/macros30.rs: Likewise.
	* rust/execute/torture/macros31.rs: Likewise.
	* rust/execute/torture/macros7.rs: Likewise.
	* rust/execute/torture/macros8.rs: Likewise.
	* rust/execute/torture/macros9.rs: Likewise.
	* rust/execute/torture/match1.rs: Likewise.
	* rust/execute/torture/match2.rs: Likewise.
	* rust/execute/torture/match3.rs: Likewise.
	* rust/execute/torture/match_bool1.rs: Likewise.
	* rust/execute/torture/match_byte1.rs: Likewise.
	* rust/execute/torture/match_char1.rs: Likewise.
	* rust/execute/torture/match_int1.rs: Likewise.
	* rust/execute/torture/match_loop1.rs: Likewise.
	* rust/execute/torture/match_range1.rs: Likewise.
	* rust/execute/torture/match_range2.rs: Likewise.
	* rust/execute/torture/match_tuple1.rs: Likewise.
	* rust/execute/torture/method1.rs: Likewise.
	* rust/execute/torture/method2.rs: Likewise.
	* rust/execute/torture/method3.rs: Likewise.
	* rust/execute/torture/method4.rs: Likewise.
	* rust/execute/torture/operator_overload_1.rs: Likewise.
	* rust/execute/torture/operator_overload_10.rs: Likewise.
	* rust/execute/torture/operator_overload_11.rs: Likewise.
	* rust/execute/torture/operator_overload_12.rs: Likewise.
	* rust/execute/torture/operator_overload_2.rs: Likewise.
	* rust/execute/torture/operator_overload_4.rs: Likewise.
	* rust/execute/torture/operator_overload_5.rs: Likewise.
	* rust/execute/torture/operator_overload_6.rs: Likewise.
	* rust/execute/torture/operator_overload_7.rs: Likewise.
	* rust/execute/torture/operator_overload_8.rs: Likewise.
	* rust/execute/torture/operator_overload_9.rs: Likewise.
	* rust/execute/torture/str-layout1.rs: Likewise.
	* rust/execute/torture/str-zero.rs: Likewise.
	* rust/execute/torture/trait1.rs: Likewise.
	* rust/execute/torture/trait10.rs: Likewise.
	* rust/execute/torture/trait11.rs: Likewise.
	* rust/execute/torture/trait12.rs: Likewise.
	* rust/execute/torture/trait13.rs: Likewise.
	* rust/execute/torture/trait2.rs: Likewise.
	* rust/execute/torture/trait3.rs: Likewise.
	* rust/execute/torture/trait4.rs: Likewise.
	* rust/execute/torture/trait5.rs: Likewise.
	* rust/execute/torture/trait6.rs: Likewise.
	* rust/execute/torture/trait7.rs: Likewise.
	* rust/execute/torture/trait8.rs: Likewise.
	* rust/execute/torture/trait9.rs: Likewise.
	* rust/execute/torture/closure2.rs: Likewise.
	* rust/execute/torture/closure3.rs: Likewise.
	* rust/execute/torture/loop-condition-eval.rs: Likewise.
	* rust/execute/torture/operator_overload_3.rs: Likewise.
---
 .../rust/execute/torture/builtin_macro_cfg.rs |  8 ++---
 .../execute/torture/builtin_macro_concat.rs   |  2 +-
 .../rust/execute/torture/builtin_macro_env.rs |  2 +-
 .../torture/builtin_macro_include_bytes.rs    |  2 +-
 .../torture/builtin_macro_include_str.rs      |  2 +-
 .../execute/torture/builtin_macro_line.rs     |  2 +-
 .../rust/execute/torture/builtin_macros1.rs   |  2 +-
 .../rust/execute/torture/builtin_macros3.rs   |  5 ++-
 gcc/testsuite/rust/execute/torture/cfg1.rs    |  2 +-
 gcc/testsuite/rust/execute/torture/cfg2.rs    |  2 +-
 gcc/testsuite/rust/execute/torture/cfg3.rs    |  2 +-
 gcc/testsuite/rust/execute/torture/cfg4.rs    |  2 +-
 .../rust/execute/torture/closure2.rs          |  2 +-
 .../rust/execute/torture/closure3.rs          |  2 +-
 .../rust/execute/torture/coercion1.rs         |  2 +-
 .../rust/execute/torture/coercion2.rs         |  2 +-
 .../rust/execute/torture/extern_mod4.rs       |  2 +-
 .../rust/execute/torture/helloworld1.rs       |  2 +-
 .../rust/execute/torture/helloworld2.rs       |  2 +-
 .../rust/execute/torture/issue-1198.rs        |  2 +-
 .../rust/execute/torture/issue-1231.rs        |  2 +-
 .../rust/execute/torture/issue-1232.rs        |  2 +-
 .../rust/execute/torture/issue-1249.rs        |  2 +-
 .../rust/execute/torture/issue-1436.rs        |  1 -
 .../rust/execute/torture/issue-1496.rs        |  2 +-
 .../rust/execute/torture/issue-647.rs         |  2 +-
 .../rust/execute/torture/issue-845.rs         |  2 +-
 .../rust/execute/torture/issue-851.rs         |  2 +-
 .../rust/execute/torture/issue-858.rs         |  2 +-
 .../rust/execute/torture/issue-976.rs         |  2 +-
 .../execute/torture/loop-condition-eval.rs    |  2 +-
 .../rust/execute/torture/macros10.rs          |  2 +-
 .../rust/execute/torture/macros11.rs          |  2 +-
 .../rust/execute/torture/macros12.rs          |  2 +-
 .../rust/execute/torture/macros13.rs          |  2 +-
 .../rust/execute/torture/macros14.rs          |  2 +-
 gcc/testsuite/rust/execute/torture/macros2.rs |  2 +-
 .../rust/execute/torture/macros22.rs          |  2 +-
 .../rust/execute/torture/macros29.rs          |  2 +-
 gcc/testsuite/rust/execute/torture/macros3.rs |  2 +-
 .../rust/execute/torture/macros30.rs          |  2 +-
 .../rust/execute/torture/macros31.rs          |  2 +-
 gcc/testsuite/rust/execute/torture/macros7.rs |  2 +-
 gcc/testsuite/rust/execute/torture/macros8.rs |  2 +-
 gcc/testsuite/rust/execute/torture/macros9.rs |  2 +-
 gcc/testsuite/rust/execute/torture/match1.rs  |  2 +-
 gcc/testsuite/rust/execute/torture/match2.rs  |  2 +-
 gcc/testsuite/rust/execute/torture/match3.rs  |  2 +-
 .../rust/execute/torture/match_bool1.rs       |  2 +-
 .../rust/execute/torture/match_byte1.rs       |  2 +-
 .../rust/execute/torture/match_char1.rs       |  2 +-
 .../rust/execute/torture/match_int1.rs        |  2 +-
 .../rust/execute/torture/match_loop1.rs       |  2 +-
 .../rust/execute/torture/match_range1.rs      |  2 +-
 .../rust/execute/torture/match_range2.rs      |  2 +-
 .../rust/execute/torture/match_tuple1.rs      |  2 +-
 gcc/testsuite/rust/execute/torture/method1.rs |  2 +-
 gcc/testsuite/rust/execute/torture/method2.rs |  2 +-
 gcc/testsuite/rust/execute/torture/method3.rs |  2 +-
 gcc/testsuite/rust/execute/torture/method4.rs |  2 +-
 .../execute/torture/operator_overload_1.rs    |  2 +-
 .../execute/torture/operator_overload_10.rs   |  2 +-
 .../execute/torture/operator_overload_11.rs   |  2 +-
 .../execute/torture/operator_overload_12.rs   |  2 +-
 .../execute/torture/operator_overload_2.rs    |  2 +-
 .../execute/torture/operator_overload_3.rs    |  2 +-
 .../execute/torture/operator_overload_4.rs    |  2 +-
 .../execute/torture/operator_overload_5.rs    |  2 +-
 .../execute/torture/operator_overload_6.rs    |  2 +-
 .../execute/torture/operator_overload_7.rs    |  2 +-
 .../execute/torture/operator_overload_8.rs    |  2 +-
 .../execute/torture/operator_overload_9.rs    |  2 +-
 .../rust/execute/torture/str-layout1.rs       |  2 +-
 .../rust/execute/torture/str-zero.rs          | 33 +++++++++----------
 gcc/testsuite/rust/execute/torture/trait1.rs  |  2 +-
 gcc/testsuite/rust/execute/torture/trait10.rs |  2 +-
 gcc/testsuite/rust/execute/torture/trait11.rs |  2 +-
 gcc/testsuite/rust/execute/torture/trait12.rs |  2 +-
 gcc/testsuite/rust/execute/torture/trait13.rs |  2 +-
 gcc/testsuite/rust/execute/torture/trait2.rs  |  2 +-
 gcc/testsuite/rust/execute/torture/trait3.rs  |  2 +-
 gcc/testsuite/rust/execute/torture/trait4.rs  |  2 +-
 gcc/testsuite/rust/execute/torture/trait5.rs  |  2 +-
 gcc/testsuite/rust/execute/torture/trait6.rs  |  2 +-
 gcc/testsuite/rust/execute/torture/trait7.rs  |  2 +-
 gcc/testsuite/rust/execute/torture/trait8.rs  |  2 +-
 gcc/testsuite/rust/execute/torture/trait9.rs  |  2 +-
 87 files changed, 104 insertions(+), 109 deletions(-)

diff --git a/gcc/testsuite/rust/execute/torture/builtin_macro_cfg.rs b/gcc/testsuite/rust/execute/torture/builtin_macro_cfg.rs
index fad2daef6bc..a8d6ae0f7ca 100644
--- a/gcc/testsuite/rust/execute/torture/builtin_macro_cfg.rs
+++ b/gcc/testsuite/rust/execute/torture/builtin_macro_cfg.rs
@@ -1,5 +1,5 @@
 // { dg-additional-options "-w -frust-cfg=A" }
-// { dg-output "A\n" }
+// { dg-output "A\r*\n" }
 #[rustc_builtin_macro]
 macro_rules! cfg {
     () => {{}};
@@ -12,7 +12,7 @@ extern "C" {
 fn print(s: &str) {
     unsafe {
         printf(
-            "%s\n" as *const str as *const i8,
+            "%s\n\0" as *const str as *const i8,
             s as *const str as *const i8,
         );
     }
@@ -21,11 +21,11 @@ fn print(s: &str) {
 fn main() -> i32 {
     let cfg = cfg!(A);
     if cfg {
-        print("A");
+        print("A\0");
     }
     let cfg = cfg!(B);
     if cfg {
-        print("B");
+        print("B\0");
     }
 
     0
diff --git a/gcc/testsuite/rust/execute/torture/builtin_macro_concat.rs b/gcc/testsuite/rust/execute/torture/builtin_macro_concat.rs
index 9b33924f5a1..a9d68e0cd35 100644
--- a/gcc/testsuite/rust/execute/torture/builtin_macro_concat.rs
+++ b/gcc/testsuite/rust/execute/torture/builtin_macro_concat.rs
@@ -1,4 +1,4 @@
-// { dg-output "\ntest10btrue2.15\ntest10bfalse2.151\n" }
+// { dg-output "\r*\ntest10btrue2.15\r*\ntest10bfalse2.151\r*\n" }
 #[rustc_builtin_macro]
 macro_rules! concat {
     () => {{}};
diff --git a/gcc/testsuite/rust/execute/torture/builtin_macro_env.rs b/gcc/testsuite/rust/execute/torture/builtin_macro_env.rs
index a5c80b25728..d64e2a00097 100644
--- a/gcc/testsuite/rust/execute/torture/builtin_macro_env.rs
+++ b/gcc/testsuite/rust/execute/torture/builtin_macro_env.rs
@@ -1,4 +1,4 @@
-// { dg-output "VALUE\nVALUE\n" }
+// { dg-output "VALUE\r*\nVALUE\r*\n" }
 // { dg-set-compiler-env-var ENV_MACRO_TEST "VALUE" }
 #[rustc_builtin_macro]
 macro_rules! env {
diff --git a/gcc/testsuite/rust/execute/torture/builtin_macro_include_bytes.rs b/gcc/testsuite/rust/execute/torture/builtin_macro_include_bytes.rs
index 087f0220de5..8be55773036 100644
--- a/gcc/testsuite/rust/execute/torture/builtin_macro_include_bytes.rs
+++ b/gcc/testsuite/rust/execute/torture/builtin_macro_include_bytes.rs
@@ -1,4 +1,4 @@
-// { dg-output "104\n33\n1\n" }
+// { dg-output "104\r*\n33\r*\n1\r*\n" }
 #[rustc_builtin_macro]
 macro_rules! include_bytes {
     () => {{}};
diff --git a/gcc/testsuite/rust/execute/torture/builtin_macro_include_str.rs b/gcc/testsuite/rust/execute/torture/builtin_macro_include_str.rs
index 6f9871d379c..43d40c9c0df 100644
--- a/gcc/testsuite/rust/execute/torture/builtin_macro_include_str.rs
+++ b/gcc/testsuite/rust/execute/torture/builtin_macro_include_str.rs
@@ -1,4 +1,4 @@
-// { dg-output "hello, include!\n" }
+// { dg-output "hello, include!\r*\n" }
 #[rustc_builtin_macro]
 macro_rules! include_str {
     () => {{}};
diff --git a/gcc/testsuite/rust/execute/torture/builtin_macro_line.rs b/gcc/testsuite/rust/execute/torture/builtin_macro_line.rs
index 02541ed52e2..9998de1402d 100644
--- a/gcc/testsuite/rust/execute/torture/builtin_macro_line.rs
+++ b/gcc/testsuite/rust/execute/torture/builtin_macro_line.rs
@@ -1,4 +1,4 @@
-// { dg-output "18\n21\n" }
+// { dg-output "18\r*\n21\r*\n" }
 extern "C" {
     fn printf(fmt: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/builtin_macros1.rs b/gcc/testsuite/rust/execute/torture/builtin_macros1.rs
index 5976478e426..5bccb16e0f9 100644
--- a/gcc/testsuite/rust/execute/torture/builtin_macros1.rs
+++ b/gcc/testsuite/rust/execute/torture/builtin_macros1.rs
@@ -1,4 +1,4 @@
-// { dg-output "rust/execute/torture/builtin_macros1.rs" }
+// { dg-output "rust/execute/torture/builtin_macros1.rs\r*" }
 #[rustc_builtin_macro]
 macro_rules! file {
     () => {{}};
diff --git a/gcc/testsuite/rust/execute/torture/builtin_macros3.rs b/gcc/testsuite/rust/execute/torture/builtin_macros3.rs
index 24555cbdb8a..5a024fa0e24 100644
--- a/gcc/testsuite/rust/execute/torture/builtin_macros3.rs
+++ b/gcc/testsuite/rust/execute/torture/builtin_macros3.rs
@@ -1,4 +1,4 @@
-// { dg-output "14\n42\n" }
+// { dg-output "14\r*\n42\r*\n" }
 #[rustc_builtin_macro]
 macro_rules! column {
     () => {{}};
@@ -19,10 +19,9 @@ fn main() -> i32 {
 
     print(c0);
 
-    let c1 =                             column!();
+    let c1 = /* --------------------- */ column!();
 
     print(c1);
 
     0
 }
-
diff --git a/gcc/testsuite/rust/execute/torture/cfg1.rs b/gcc/testsuite/rust/execute/torture/cfg1.rs
index d3c56295503..648d1f1ff72 100644
--- a/gcc/testsuite/rust/execute/torture/cfg1.rs
+++ b/gcc/testsuite/rust/execute/torture/cfg1.rs
@@ -1,5 +1,5 @@
 // { dg-additional-options "-w -frust-cfg=A" }
-// { dg-output "test1\n" }
+// { dg-output "test1\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/cfg2.rs b/gcc/testsuite/rust/execute/torture/cfg2.rs
index 5048bcb2791..7b75ac6962f 100644
--- a/gcc/testsuite/rust/execute/torture/cfg2.rs
+++ b/gcc/testsuite/rust/execute/torture/cfg2.rs
@@ -1,5 +1,5 @@
 // { dg-additional-options "-w -frust-cfg=A" }
-// { dg-output "test1\n" }
+// { dg-output "test1\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/cfg3.rs b/gcc/testsuite/rust/execute/torture/cfg3.rs
index 89312344b23..97a8fb8e461 100644
--- a/gcc/testsuite/rust/execute/torture/cfg3.rs
+++ b/gcc/testsuite/rust/execute/torture/cfg3.rs
@@ -1,5 +1,5 @@
 // { dg-additional-options "-w -frust-cfg=A" }
-// { dg-output "test1\n" }
+// { dg-output "test1\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/cfg4.rs b/gcc/testsuite/rust/execute/torture/cfg4.rs
index d1c2a22a0ff..97026d902d0 100644
--- a/gcc/testsuite/rust/execute/torture/cfg4.rs
+++ b/gcc/testsuite/rust/execute/torture/cfg4.rs
@@ -1,5 +1,5 @@
 // { dg-additional-options "-w -frust-cfg=A" }
-// { dg-output "test1\ntest2\n" }
+// { dg-output "test1\r*\ntest2\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/closure2.rs b/gcc/testsuite/rust/execute/torture/closure2.rs
index 45b3b5ce8b4..8e1502dfa43 100644
--- a/gcc/testsuite/rust/execute/torture/closure2.rs
+++ b/gcc/testsuite/rust/execute/torture/closure2.rs
@@ -1,4 +1,4 @@
-// { dg-output "3\n" }
+// { dg-output "3\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/closure3.rs b/gcc/testsuite/rust/execute/torture/closure3.rs
index 62cf3a082cf..8fa9445ab62 100644
--- a/gcc/testsuite/rust/execute/torture/closure3.rs
+++ b/gcc/testsuite/rust/execute/torture/closure3.rs
@@ -1,4 +1,4 @@
-// { dg-output "3\n" }
+// { dg-output "3\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/coercion1.rs b/gcc/testsuite/rust/execute/torture/coercion1.rs
index 2cdb9bbca38..6ca28233d60 100644
--- a/gcc/testsuite/rust/execute/torture/coercion1.rs
+++ b/gcc/testsuite/rust/execute/torture/coercion1.rs
@@ -1,4 +1,4 @@
-/* { dg-output "123\n123\n" } */
+/* { dg-output "123\r*\n123\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/coercion2.rs b/gcc/testsuite/rust/execute/torture/coercion2.rs
index 12dd68ff5f7..047fd536dca 100644
--- a/gcc/testsuite/rust/execute/torture/coercion2.rs
+++ b/gcc/testsuite/rust/execute/torture/coercion2.rs
@@ -1,4 +1,4 @@
-/* { dg-output "123\n123\n" } */
+/* { dg-output "123\r*\n123\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/extern_mod4.rs b/gcc/testsuite/rust/execute/torture/extern_mod4.rs
index 99b6fb5c9ba..55be2b8115f 100644
--- a/gcc/testsuite/rust/execute/torture/extern_mod4.rs
+++ b/gcc/testsuite/rust/execute/torture/extern_mod4.rs
@@ -1,5 +1,5 @@
 // { dg-additional-options "-w" }
-// { dg-output "12" }
+// { dg-output "12\r*" }
 mod modules;
 
 extern "C" {
diff --git a/gcc/testsuite/rust/execute/torture/helloworld1.rs b/gcc/testsuite/rust/execute/torture/helloworld1.rs
index d416efa33af..8803156b5fd 100644
--- a/gcc/testsuite/rust/execute/torture/helloworld1.rs
+++ b/gcc/testsuite/rust/execute/torture/helloworld1.rs
@@ -1,4 +1,4 @@
-/* { dg-output "Hello World" }*/
+/* { dg-output "Hello World\r*" }*/
 extern "C" {
     fn puts(s: *const i8);
 }
diff --git a/gcc/testsuite/rust/execute/torture/helloworld2.rs b/gcc/testsuite/rust/execute/torture/helloworld2.rs
index cc05f3798fa..912301bcb26 100644
--- a/gcc/testsuite/rust/execute/torture/helloworld2.rs
+++ b/gcc/testsuite/rust/execute/torture/helloworld2.rs
@@ -1,4 +1,4 @@
-/* { dg-output "Hello World 123\n" }*/
+/* { dg-output "Hello World 123\r*\n" }*/
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/issue-1198.rs b/gcc/testsuite/rust/execute/torture/issue-1198.rs
index fce44ad1994..bbc58f0f370 100644
--- a/gcc/testsuite/rust/execute/torture/issue-1198.rs
+++ b/gcc/testsuite/rust/execute/torture/issue-1198.rs
@@ -1,4 +1,4 @@
-/* { dg-output "foo_deref\nimm_deref\n123\n" } */
+/* { dg-output "foo_deref\r*\nimm_deref\r*\n123\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/issue-1231.rs b/gcc/testsuite/rust/execute/torture/issue-1231.rs
index 970e86f917a..321df5fec55 100644
--- a/gcc/testsuite/rust/execute/torture/issue-1231.rs
+++ b/gcc/testsuite/rust/execute/torture/issue-1231.rs
@@ -1,5 +1,5 @@
 // { dg-additional-options "-w" }
-// { dg-output "outer\ninner\n" }
+// { dg-output "outer\r*\ninner\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/issue-1232.rs b/gcc/testsuite/rust/execute/torture/issue-1232.rs
index c56d5c18695..9215efdba6c 100644
--- a/gcc/testsuite/rust/execute/torture/issue-1232.rs
+++ b/gcc/testsuite/rust/execute/torture/issue-1232.rs
@@ -1,5 +1,5 @@
 // { dg-additional-options "-w" }
-// { dg-output "slice_access=3\n" }
+// { dg-output "slice_access=3\r*\n" }
 extern "rust-intrinsic" {
     #[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")]
     fn offset<T>(dst: *const T, offset: isize) -> *const T;
diff --git a/gcc/testsuite/rust/execute/torture/issue-1249.rs b/gcc/testsuite/rust/execute/torture/issue-1249.rs
index 072204ea877..06911074c30 100644
--- a/gcc/testsuite/rust/execute/torture/issue-1249.rs
+++ b/gcc/testsuite/rust/execute/torture/issue-1249.rs
@@ -1,5 +1,5 @@
 // { dg-options "-w" }
-// { dg-output "1\n2\n" }
+// { dg-output "1\r*\n2\r*\n" }
 
 extern "C" {
     fn printf(s: *const i8, ...);
diff --git a/gcc/testsuite/rust/execute/torture/issue-1436.rs b/gcc/testsuite/rust/execute/torture/issue-1436.rs
index 5c079a61f07..96de5d69194 100644
--- a/gcc/testsuite/rust/execute/torture/issue-1436.rs
+++ b/gcc/testsuite/rust/execute/torture/issue-1436.rs
@@ -1,5 +1,4 @@
 // { dg-options "-w" }
-// { dg-output "" }
 mod intrinsics {
     extern "rust-intrinsic" {
         #[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")]
diff --git a/gcc/testsuite/rust/execute/torture/issue-1496.rs b/gcc/testsuite/rust/execute/torture/issue-1496.rs
index 9f08b2ae98a..af4201b7d3e 100644
--- a/gcc/testsuite/rust/execute/torture/issue-1496.rs
+++ b/gcc/testsuite/rust/execute/torture/issue-1496.rs
@@ -1,4 +1,4 @@
-/* { dg-output "foo_deref\nimm_deref\n123\n" } */
+/* { dg-output "foo_deref\r*\nimm_deref\r*\n123\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/issue-647.rs b/gcc/testsuite/rust/execute/torture/issue-647.rs
index 3f427ccb785..d76d43b6110 100644
--- a/gcc/testsuite/rust/execute/torture/issue-647.rs
+++ b/gcc/testsuite/rust/execute/torture/issue-647.rs
@@ -1,4 +1,4 @@
-/* { dg-output "Hello World 123\n" }*/
+/* { dg-output "Hello World 123\r*\n" }*/
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/issue-845.rs b/gcc/testsuite/rust/execute/torture/issue-845.rs
index 4c689e3b6c8..f96714d4bae 100644
--- a/gcc/testsuite/rust/execute/torture/issue-845.rs
+++ b/gcc/testsuite/rust/execute/torture/issue-845.rs
@@ -1,4 +1,4 @@
-// { dg-output "Foo::bar\n" }
+// { dg-output "Foo::bar\r*\n" }
 // { dg-additional-options "-w" }
 extern "C" {
     fn printf(s: *const i8, ...);
diff --git a/gcc/testsuite/rust/execute/torture/issue-851.rs b/gcc/testsuite/rust/execute/torture/issue-851.rs
index 3881c7a2ada..b3b2b480ec2 100644
--- a/gcc/testsuite/rust/execute/torture/issue-851.rs
+++ b/gcc/testsuite/rust/execute/torture/issue-851.rs
@@ -1,4 +1,4 @@
-/* { dg-output "Result: 123\n" } */
+/* { dg-output "Result: 123\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/issue-858.rs b/gcc/testsuite/rust/execute/torture/issue-858.rs
index 5a43f3e1b1a..51a15613844 100644
--- a/gcc/testsuite/rust/execute/torture/issue-858.rs
+++ b/gcc/testsuite/rust/execute/torture/issue-858.rs
@@ -1,4 +1,4 @@
-/* { dg-output "Result: 123\n" } */
+/* { dg-output "Result: 123\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/issue-976.rs b/gcc/testsuite/rust/execute/torture/issue-976.rs
index 42cf596fb7d..cf6cfa66cd1 100644
--- a/gcc/testsuite/rust/execute/torture/issue-976.rs
+++ b/gcc/testsuite/rust/execute/torture/issue-976.rs
@@ -1,4 +1,4 @@
-/* { dg-output "hi" } */
+/* { dg-output "hi\r*" } */
 fn main() -> i32 {
     {
         extern "C" {
diff --git a/gcc/testsuite/rust/execute/torture/loop-condition-eval.rs b/gcc/testsuite/rust/execute/torture/loop-condition-eval.rs
index 008965917ab..67ac00ced59 100644
--- a/gcc/testsuite/rust/execute/torture/loop-condition-eval.rs
+++ b/gcc/testsuite/rust/execute/torture/loop-condition-eval.rs
@@ -1,4 +1,4 @@
-// { dg-output "1\n" }
+// { dg-output "1\r*\n" }
 pub fn test() -> u64 {
     let mut n = 113383; // #20 in https://oeis.org/A006884
     while n != 1 {
diff --git a/gcc/testsuite/rust/execute/torture/macros10.rs b/gcc/testsuite/rust/execute/torture/macros10.rs
index 155a440ee04..4f976f0b317 100644
--- a/gcc/testsuite/rust/execute/torture/macros10.rs
+++ b/gcc/testsuite/rust/execute/torture/macros10.rs
@@ -1,4 +1,4 @@
-// { dg-output "18\n" }
+// { dg-output "18\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/macros11.rs b/gcc/testsuite/rust/execute/torture/macros11.rs
index 5bde97d3dd4..70e5f25cf71 100644
--- a/gcc/testsuite/rust/execute/torture/macros11.rs
+++ b/gcc/testsuite/rust/execute/torture/macros11.rs
@@ -1,4 +1,4 @@
-// { dg-output "2" }
+// { dg-output "2\r*" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/macros12.rs b/gcc/testsuite/rust/execute/torture/macros12.rs
index d310dff9ba8..deb424ffdbc 100644
--- a/gcc/testsuite/rust/execute/torture/macros12.rs
+++ b/gcc/testsuite/rust/execute/torture/macros12.rs
@@ -1,4 +1,4 @@
-// { dg-output "0\n" }
+// { dg-output "0\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/macros13.rs b/gcc/testsuite/rust/execute/torture/macros13.rs
index afb20264625..ec36a21f26e 100644
--- a/gcc/testsuite/rust/execute/torture/macros13.rs
+++ b/gcc/testsuite/rust/execute/torture/macros13.rs
@@ -1,4 +1,4 @@
-// { dg-output "18\n" }
+// { dg-output "18\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/macros14.rs b/gcc/testsuite/rust/execute/torture/macros14.rs
index 00656546d4c..189fadd9861 100644
--- a/gcc/testsuite/rust/execute/torture/macros14.rs
+++ b/gcc/testsuite/rust/execute/torture/macros14.rs
@@ -1,4 +1,4 @@
-// { dg-output "15\n" }
+// { dg-output "15\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/macros2.rs b/gcc/testsuite/rust/execute/torture/macros2.rs
index ba5098710ea..aca528a08aa 100644
--- a/gcc/testsuite/rust/execute/torture/macros2.rs
+++ b/gcc/testsuite/rust/execute/torture/macros2.rs
@@ -1,4 +1,4 @@
-// { dg-output "arg\narg\narg\n" }
+// { dg-output "arg\r*\narg\r*\narg\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/macros22.rs b/gcc/testsuite/rust/execute/torture/macros22.rs
index 3f291ace98e..60ffae145ed 100644
--- a/gcc/testsuite/rust/execute/torture/macros22.rs
+++ b/gcc/testsuite/rust/execute/torture/macros22.rs
@@ -1,4 +1,4 @@
-// { dg-output "1\n2\nNaN\n3\n" }
+// { dg-output "1\r*\n2\r*\nNaN\r*\n3\r*\n" }
 
 macro_rules! print_num {
     ($l:literal) => {{
diff --git a/gcc/testsuite/rust/execute/torture/macros29.rs b/gcc/testsuite/rust/execute/torture/macros29.rs
index 306979b9b5b..9c2cc0e6a1b 100644
--- a/gcc/testsuite/rust/execute/torture/macros29.rs
+++ b/gcc/testsuite/rust/execute/torture/macros29.rs
@@ -1,4 +1,4 @@
-// { dg-output "1\n" }
+// { dg-output "1\r*\n" }
 #[rustc_builtin_macro]
 macro_rules! concat {
     () => {{}};
diff --git a/gcc/testsuite/rust/execute/torture/macros3.rs b/gcc/testsuite/rust/execute/torture/macros3.rs
index 00f6d253f50..91936c1ca83 100644
--- a/gcc/testsuite/rust/execute/torture/macros3.rs
+++ b/gcc/testsuite/rust/execute/torture/macros3.rs
@@ -1,4 +1,4 @@
-// { dg-output "invok\ninvok\ninvok\ninvok\ninvok\n" }
+// { dg-output "invok\r*\ninvok\r*\ninvok\r*\ninvok\r*\ninvok\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/macros30.rs b/gcc/testsuite/rust/execute/torture/macros30.rs
index ab36f5e78af..7ec77d06982 100644
--- a/gcc/testsuite/rust/execute/torture/macros30.rs
+++ b/gcc/testsuite/rust/execute/torture/macros30.rs
@@ -1,4 +1,4 @@
-// { dg-output "1\n" }
+// { dg-output "1\r*\n" }
 #[rustc_builtin_macro]
 macro_rules! concat {
     () => {{}};
diff --git a/gcc/testsuite/rust/execute/torture/macros31.rs b/gcc/testsuite/rust/execute/torture/macros31.rs
index 483f897a92b..4c6378a68c2 100644
--- a/gcc/testsuite/rust/execute/torture/macros31.rs
+++ b/gcc/testsuite/rust/execute/torture/macros31.rs
@@ -1,5 +1,5 @@
 // { dg-additional-options "-w -frust-cfg=A" }
-// { dg-output "A\nB\n" }
+// { dg-output "A\r*\nB\r*\n" }
 #[rustc_builtin_macro]
 macro_rules! cfg {
     () => {{}};
diff --git a/gcc/testsuite/rust/execute/torture/macros7.rs b/gcc/testsuite/rust/execute/torture/macros7.rs
index ed1f922f581..b8af009aed4 100644
--- a/gcc/testsuite/rust/execute/torture/macros7.rs
+++ b/gcc/testsuite/rust/execute/torture/macros7.rs
@@ -1,4 +1,4 @@
-// { dg-output "any\nany\nany\n" }
+// { dg-output "any\r*\nany\r*\nany\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/macros8.rs b/gcc/testsuite/rust/execute/torture/macros8.rs
index a12aca4910e..e532237ecde 100644
--- a/gcc/testsuite/rust/execute/torture/macros8.rs
+++ b/gcc/testsuite/rust/execute/torture/macros8.rs
@@ -1,4 +1,4 @@
-// { dg-output "zo1\nzo1\n" }
+// { dg-output "zo1\r*\nzo1\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/macros9.rs b/gcc/testsuite/rust/execute/torture/macros9.rs
index 0e3fd24e8a9..81aa3683bb3 100644
--- a/gcc/testsuite/rust/execute/torture/macros9.rs
+++ b/gcc/testsuite/rust/execute/torture/macros9.rs
@@ -1,4 +1,4 @@
-// { dg-output "oom\noom\noom\n" }
+// { dg-output "oom\r*\noom\r*\noom\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/match1.rs b/gcc/testsuite/rust/execute/torture/match1.rs
index e5af512f15d..66a5be3792a 100644
--- a/gcc/testsuite/rust/execute/torture/match1.rs
+++ b/gcc/testsuite/rust/execute/torture/match1.rs
@@ -1,4 +1,4 @@
-// { dg-output "Foo::A\nFoo::B\nFoo::C x\nFoo::D 20 80\n" }
+// { dg-output "Foo::A\r*\nFoo::B\r*\nFoo::C x\r*\nFoo::D 20 80\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/match2.rs b/gcc/testsuite/rust/execute/torture/match2.rs
index 02cedf29b3c..3c9fbde262a 100644
--- a/gcc/testsuite/rust/execute/torture/match2.rs
+++ b/gcc/testsuite/rust/execute/torture/match2.rs
@@ -1,4 +1,4 @@
-// { dg-output "123\n80\n" }
+// { dg-output "123\r*\n80\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/match3.rs b/gcc/testsuite/rust/execute/torture/match3.rs
index 8cded3044df..3dda9a35db3 100644
--- a/gcc/testsuite/rust/execute/torture/match3.rs
+++ b/gcc/testsuite/rust/execute/torture/match3.rs
@@ -1,4 +1,4 @@
-// { dg-output "Foo::A\nwildcard\nwildcard\nFoo::D 20 80\n" }
+// { dg-output "Foo::A\r*\nwildcard\r*\nwildcard\r*\nFoo::D 20 80\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/match_bool1.rs b/gcc/testsuite/rust/execute/torture/match_bool1.rs
index 101dbb58571..2fb5e02b273 100644
--- a/gcc/testsuite/rust/execute/torture/match_bool1.rs
+++ b/gcc/testsuite/rust/execute/torture/match_bool1.rs
@@ -1,4 +1,4 @@
-// { dg-output "182 is more than 100\n55 is less than 100\n" }
+// { dg-output "182 is more than 100\r*\n55 is less than 100\r*\n" }
 
 extern "C" {
     fn printf(s: *const i8, ...);
diff --git a/gcc/testsuite/rust/execute/torture/match_byte1.rs b/gcc/testsuite/rust/execute/torture/match_byte1.rs
index 3546cfb9d8b..4261b2b9f5e 100644
--- a/gcc/testsuite/rust/execute/torture/match_byte1.rs
+++ b/gcc/testsuite/rust/execute/torture/match_byte1.rs
@@ -1,4 +1,4 @@
-// { dg-output "a\nseven\nquote\nelse" }
+// { dg-output "a\r*\nseven\r*\nquote\r*\nelse" }
 
 extern "C" {
     fn printf(s: *const i8, ...);
diff --git a/gcc/testsuite/rust/execute/torture/match_char1.rs b/gcc/testsuite/rust/execute/torture/match_char1.rs
index fa65876a907..1584b419daa 100644
--- a/gcc/testsuite/rust/execute/torture/match_char1.rs
+++ b/gcc/testsuite/rust/execute/torture/match_char1.rs
@@ -1,4 +1,4 @@
-// { dg-output "amazing\nwildcard\ncompiler\nproductivity\n" }
+// { dg-output "amazing\r*\nwildcard\r*\ncompiler\r*\nproductivity\r*\n" }
 
 extern "C" {
     fn printf(s: *const i8, ...);
diff --git a/gcc/testsuite/rust/execute/torture/match_int1.rs b/gcc/testsuite/rust/execute/torture/match_int1.rs
index 209429added..a7deefbaa02 100644
--- a/gcc/testsuite/rust/execute/torture/match_int1.rs
+++ b/gcc/testsuite/rust/execute/torture/match_int1.rs
@@ -1,4 +1,4 @@
-// { dg-output "other!\nother!\nother!\nfifteen!\nfifteen!\nother!\nother!\nfifteen!\n" }
+// { dg-output "other!\r*\nother!\r*\nother!\r*\nfifteen!\r*\nfifteen!\r*\nother!\r*\nother!\r*\nfifteen!\r*\n" }
 
 extern "C" {
     fn printf(s: *const i8, ...);
diff --git a/gcc/testsuite/rust/execute/torture/match_loop1.rs b/gcc/testsuite/rust/execute/torture/match_loop1.rs
index bb6aee946f6..578712fa7f5 100644
--- a/gcc/testsuite/rust/execute/torture/match_loop1.rs
+++ b/gcc/testsuite/rust/execute/torture/match_loop1.rs
@@ -1,4 +1,4 @@
-// { dg-output "E::One\nE::Two\nbreak!\n" }
+// { dg-output "E::One\r*\nE::Two\r*\nbreak!\r*\n" }
 
 extern "C" {
     fn printf(s: *const i8, ...);
diff --git a/gcc/testsuite/rust/execute/torture/match_range1.rs b/gcc/testsuite/rust/execute/torture/match_range1.rs
index 82e9e34a989..3b705407fb2 100644
--- a/gcc/testsuite/rust/execute/torture/match_range1.rs
+++ b/gcc/testsuite/rust/execute/torture/match_range1.rs
@@ -1,4 +1,4 @@
-// { dg-output "zero to END_RANGE\nzero to END_RANGE\nelse\n" }
+// { dg-output "zero to END_RANGE\r*\nzero to END_RANGE\r*\nelse\r*\n" }
 
 extern "C" {
     fn printf(s: *const i8, ...);
diff --git a/gcc/testsuite/rust/execute/torture/match_range2.rs b/gcc/testsuite/rust/execute/torture/match_range2.rs
index 8153f9e1c7e..517f2bbeb84 100644
--- a/gcc/testsuite/rust/execute/torture/match_range2.rs
+++ b/gcc/testsuite/rust/execute/torture/match_range2.rs
@@ -1,4 +1,4 @@
-// { dg-output "lowercase\nuppercase\nother\n" }
+// { dg-output "lowercase\r*\nuppercase\r*\nother\r*\n" }
 
 extern "C" {
     fn printf(s: *const i8, ...);
diff --git a/gcc/testsuite/rust/execute/torture/match_tuple1.rs b/gcc/testsuite/rust/execute/torture/match_tuple1.rs
index cb61cc0847c..2ae3ca7db4e 100644
--- a/gcc/testsuite/rust/execute/torture/match_tuple1.rs
+++ b/gcc/testsuite/rust/execute/torture/match_tuple1.rs
@@ -1,4 +1,4 @@
-// { dg-output "x:15\ny:20\n" }
+// { dg-output "x:15\r*\ny:20\r*\n" }
 
 extern "C" {
     fn printf(s: *const i8, ...);
diff --git a/gcc/testsuite/rust/execute/torture/method1.rs b/gcc/testsuite/rust/execute/torture/method1.rs
index 6af6133939b..c57944b93eb 100644
--- a/gcc/testsuite/rust/execute/torture/method1.rs
+++ b/gcc/testsuite/rust/execute/torture/method1.rs
@@ -1,4 +1,4 @@
-/* { dg-output "124\n458" } */
+/* { dg-output "124\r*\n458" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/method2.rs b/gcc/testsuite/rust/execute/torture/method2.rs
index f532b4488c6..79a35eb53d8 100644
--- a/gcc/testsuite/rust/execute/torture/method2.rs
+++ b/gcc/testsuite/rust/execute/torture/method2.rs
@@ -1,5 +1,5 @@
 // { dg-additional-options "-w" }
-// { dg-output "foo_deref\nimm_deref\n" }
+// { dg-output "foo_deref\r*\nimm_deref\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/method3.rs b/gcc/testsuite/rust/execute/torture/method3.rs
index 0e9e8ff42a0..7217d35c4b3 100644
--- a/gcc/testsuite/rust/execute/torture/method3.rs
+++ b/gcc/testsuite/rust/execute/torture/method3.rs
@@ -1,5 +1,5 @@
 // { dg-additional-options "-w" }
-// { dg-output "mut_deref\nfoobar: 123\n" }
+// { dg-output "mut_deref\r*\nfoobar: 123\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/method4.rs b/gcc/testsuite/rust/execute/torture/method4.rs
index 5c6fdfe02c3..ba1ffd1da36 100644
--- a/gcc/testsuite/rust/execute/torture/method4.rs
+++ b/gcc/testsuite/rust/execute/torture/method4.rs
@@ -1,5 +1,5 @@
 // { dg-additional-options "-w" }
-// { dg-output "mut_deref\nfoobar: 123\n" }
+// { dg-output "mut_deref\r*\nfoobar: 123\r*\n" }
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_1.rs b/gcc/testsuite/rust/execute/torture/operator_overload_1.rs
index 5a28c5f4e93..064a77651ad 100644
--- a/gcc/testsuite/rust/execute/torture/operator_overload_1.rs
+++ b/gcc/testsuite/rust/execute/torture/operator_overload_1.rs
@@ -1,4 +1,4 @@
-/* { dg-output "3\n" } */
+/* { dg-output "3\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_10.rs b/gcc/testsuite/rust/execute/torture/operator_overload_10.rs
index f5d45db5338..3fa5afd01f3 100644
--- a/gcc/testsuite/rust/execute/torture/operator_overload_10.rs
+++ b/gcc/testsuite/rust/execute/torture/operator_overload_10.rs
@@ -1,4 +1,4 @@
-/* { dg-output "foo_deref\n123\n" } */
+/* { dg-output "foo_deref\r*\n123\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_11.rs b/gcc/testsuite/rust/execute/torture/operator_overload_11.rs
index 1919941c486..94bc1cd9d96 100644
--- a/gcc/testsuite/rust/execute/torture/operator_overload_11.rs
+++ b/gcc/testsuite/rust/execute/torture/operator_overload_11.rs
@@ -1,4 +1,4 @@
-// { dg-output "1\n" }
+// { dg-output "1\r*\n" }
 // { dg-additional-options "-w" }
 extern "C" {
     fn printf(s: *const i8, ...);
diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_12.rs b/gcc/testsuite/rust/execute/torture/operator_overload_12.rs
index 7433330fa31..d525ec44e8f 100644
--- a/gcc/testsuite/rust/execute/torture/operator_overload_12.rs
+++ b/gcc/testsuite/rust/execute/torture/operator_overload_12.rs
@@ -1,4 +1,4 @@
-// { dg-output "1\n" }
+// { dg-output "1\r*\n" }
 // { dg-additional-options "-w" }
 extern "C" {
     fn printf(s: *const i8, ...);
diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_2.rs b/gcc/testsuite/rust/execute/torture/operator_overload_2.rs
index a577718451d..fab3a83b7f5 100644
--- a/gcc/testsuite/rust/execute/torture/operator_overload_2.rs
+++ b/gcc/testsuite/rust/execute/torture/operator_overload_2.rs
@@ -1,4 +1,4 @@
-/* { dg-output "3\n" } */
+/* { dg-output "3\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_3.rs b/gcc/testsuite/rust/execute/torture/operator_overload_3.rs
index 57f58076c3e..2bcb1c4267c 100644
--- a/gcc/testsuite/rust/execute/torture/operator_overload_3.rs
+++ b/gcc/testsuite/rust/execute/torture/operator_overload_3.rs
@@ -1,4 +1,4 @@
-/* { dg-output "3\n3\n" } */
+/* { dg-output "3\r*\n3\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_4.rs b/gcc/testsuite/rust/execute/torture/operator_overload_4.rs
index ce9887b2ead..e1fcbac1c77 100644
--- a/gcc/testsuite/rust/execute/torture/operator_overload_4.rs
+++ b/gcc/testsuite/rust/execute/torture/operator_overload_4.rs
@@ -1,4 +1,4 @@
-/* { dg-output "neg\n" } */
+/* { dg-output "neg\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_5.rs b/gcc/testsuite/rust/execute/torture/operator_overload_5.rs
index a525f743680..2ba87285ef1 100644
--- a/gcc/testsuite/rust/execute/torture/operator_overload_5.rs
+++ b/gcc/testsuite/rust/execute/torture/operator_overload_5.rs
@@ -1,4 +1,4 @@
-/* { dg-output "not\n" } */
+/* { dg-output "not\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_6.rs b/gcc/testsuite/rust/execute/torture/operator_overload_6.rs
index fbd2a8fa9d3..50463e74761 100644
--- a/gcc/testsuite/rust/execute/torture/operator_overload_6.rs
+++ b/gcc/testsuite/rust/execute/torture/operator_overload_6.rs
@@ -1,4 +1,4 @@
-/* { dg-output "add_assign\n3\n" } */
+/* { dg-output "add_assign\r*\n3\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_7.rs b/gcc/testsuite/rust/execute/torture/operator_overload_7.rs
index 886a7010efc..50107bb4324 100644
--- a/gcc/testsuite/rust/execute/torture/operator_overload_7.rs
+++ b/gcc/testsuite/rust/execute/torture/operator_overload_7.rs
@@ -1,4 +1,4 @@
-/* { dg-output "imm_deref\n123\n" } */
+/* { dg-output "imm_deref\r*\n123\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_8.rs b/gcc/testsuite/rust/execute/torture/operator_overload_8.rs
index 862e29a4bc6..e0338b917f5 100644
--- a/gcc/testsuite/rust/execute/torture/operator_overload_8.rs
+++ b/gcc/testsuite/rust/execute/torture/operator_overload_8.rs
@@ -1,4 +1,4 @@
-/* { dg-output "imm_deref\n123\n" } */
+/* { dg-output "imm_deref\r*\n123\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_9.rs b/gcc/testsuite/rust/execute/torture/operator_overload_9.rs
index fd972e28ab3..608ad0fe94e 100644
--- a/gcc/testsuite/rust/execute/torture/operator_overload_9.rs
+++ b/gcc/testsuite/rust/execute/torture/operator_overload_9.rs
@@ -1,4 +1,4 @@
-/* { dg-output "mut_deref\n123\n" } */
+/* { dg-output "mut_deref\r*\n123\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/str-layout1.rs b/gcc/testsuite/rust/execute/torture/str-layout1.rs
index 80bdc2a9c9f..39c1e38d77b 100644
--- a/gcc/testsuite/rust/execute/torture/str-layout1.rs
+++ b/gcc/testsuite/rust/execute/torture/str-layout1.rs
@@ -1,5 +1,5 @@
 // { dg-additional-options "-w" }
-// { dg-output "t1sz=5 t2sz=10" }
+// { dg-output "t1sz=5 t2sz=10\r*" }
 mod mem {
     extern "rust-intrinsic" {
         #[rustc_const_stable(feature = "const_transmute", since = "1.46.0")]
diff --git a/gcc/testsuite/rust/execute/torture/str-zero.rs b/gcc/testsuite/rust/execute/torture/str-zero.rs
index e7fba0d1372..9042f54436e 100644
--- a/gcc/testsuite/rust/execute/torture/str-zero.rs
+++ b/gcc/testsuite/rust/execute/torture/str-zero.rs
@@ -1,26 +1,23 @@
-/* { dg-output "bar foo baz foobar\n" } */
-extern "C"
-{
-  fn printf(s: *const i8, ...);
-  fn memchr(s: *const i8, c: u8, n: usize) -> *const i8;
+/* { dg-output "bar foo baz foobar\r*\n" } */
+extern "C" {
+    fn printf(s: *const i8, ...);
+    fn memchr(s: *const i8, c: u8, n: usize) -> *const i8;
 }
 
-pub fn main () -> i32
-{
-  let f = "%s %s %s %s\n\0";
-  let s = "bar\0\
+pub fn main() -> i32 {
+    let f = "%s %s %s %s\n\0";
+    let s = "bar\0\
            foo\
            \x00\
            baz\u{0000}\
            foobar\0";
-  let cf = f as *const str as *const i8;
-  let cs = s as *const str as *const i8;
-  unsafe
-    {
-      let cs2 = memchr (cs, b'f', 5);
-      let cs3 = memchr (cs2, b'b', 5);
-      let cs4 = memchr (cs3, b'f', 5);
-      printf (cf, cs, cs2, cs3, cs4);
+    let cf = f as *const str as *const i8;
+    let cs = s as *const str as *const i8;
+    unsafe {
+        let cs2 = memchr(cs, b'f', 5);
+        let cs3 = memchr(cs2, b'b', 5);
+        let cs4 = memchr(cs3, b'f', 5);
+        printf(cf, cs, cs2, cs3, cs4);
     }
-  0
+    0
 }
diff --git a/gcc/testsuite/rust/execute/torture/trait1.rs b/gcc/testsuite/rust/execute/torture/trait1.rs
index dc3cc471c33..d4f5878ef18 100644
--- a/gcc/testsuite/rust/execute/torture/trait1.rs
+++ b/gcc/testsuite/rust/execute/torture/trait1.rs
@@ -1,4 +1,4 @@
-/* { dg-output "S::f\nT1::f\nT2::f\n" } */
+/* { dg-output "S::f\r*\nT1::f\r*\nT2::f\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/trait10.rs b/gcc/testsuite/rust/execute/torture/trait10.rs
index e581e324bbf..b0bdeab9091 100644
--- a/gcc/testsuite/rust/execute/torture/trait10.rs
+++ b/gcc/testsuite/rust/execute/torture/trait10.rs
@@ -1,4 +1,4 @@
-/* { dg-output "123\n" } */
+/* { dg-output "123\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/trait11.rs b/gcc/testsuite/rust/execute/torture/trait11.rs
index 283c9ecd0ed..ed7b7c9d6ee 100644
--- a/gcc/testsuite/rust/execute/torture/trait11.rs
+++ b/gcc/testsuite/rust/execute/torture/trait11.rs
@@ -1,4 +1,4 @@
-/* { dg-output "3\n" } */
+/* { dg-output "3\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/trait12.rs b/gcc/testsuite/rust/execute/torture/trait12.rs
index 68b0a4014ad..a4ba5be116e 100644
--- a/gcc/testsuite/rust/execute/torture/trait12.rs
+++ b/gcc/testsuite/rust/execute/torture/trait12.rs
@@ -1,4 +1,4 @@
-/* { dg-output "3\n" } */
+/* { dg-output "3\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/trait13.rs b/gcc/testsuite/rust/execute/torture/trait13.rs
index 3071da27a6a..49befb8fbb1 100644
--- a/gcc/testsuite/rust/execute/torture/trait13.rs
+++ b/gcc/testsuite/rust/execute/torture/trait13.rs
@@ -1,4 +1,4 @@
-/* { dg-output "123\n456\n" } */
+/* { dg-output "123\r*\n456\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/trait2.rs b/gcc/testsuite/rust/execute/torture/trait2.rs
index c96615fa891..9974f70da8c 100644
--- a/gcc/testsuite/rust/execute/torture/trait2.rs
+++ b/gcc/testsuite/rust/execute/torture/trait2.rs
@@ -1,4 +1,4 @@
-/* { dg-output "Bar::A = 456\n<Foo as Bar>::A = 456\n" } */
+/* { dg-output "Bar::A = 456\r*\n<Foo as Bar>::A = 456\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/trait3.rs b/gcc/testsuite/rust/execute/torture/trait3.rs
index accfa9d0a36..6fe92ef70f9 100644
--- a/gcc/testsuite/rust/execute/torture/trait3.rs
+++ b/gcc/testsuite/rust/execute/torture/trait3.rs
@@ -1,4 +1,4 @@
-/* { dg-output "123, 777" } */
+/* { dg-output "123, 777\r*" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/trait4.rs b/gcc/testsuite/rust/execute/torture/trait4.rs
index 8c0d257cd7e..3b2d000780a 100644
--- a/gcc/testsuite/rust/execute/torture/trait4.rs
+++ b/gcc/testsuite/rust/execute/torture/trait4.rs
@@ -1,4 +1,4 @@
-/* { dg-output "123\n" }*/
+/* { dg-output "123\r*\n" }*/
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/trait5.rs b/gcc/testsuite/rust/execute/torture/trait5.rs
index 49f11a6085a..f9c0dfdae74 100644
--- a/gcc/testsuite/rust/execute/torture/trait5.rs
+++ b/gcc/testsuite/rust/execute/torture/trait5.rs
@@ -1,4 +1,4 @@
-/* { dg-output "123\n123\n" } */
+/* { dg-output "123\r*\n123\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/trait6.rs b/gcc/testsuite/rust/execute/torture/trait6.rs
index c83d6666c87..74363c2ddac 100644
--- a/gcc/testsuite/rust/execute/torture/trait6.rs
+++ b/gcc/testsuite/rust/execute/torture/trait6.rs
@@ -1,4 +1,4 @@
-/* { dg-output "123\n" } */
+/* { dg-output "123\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/trait7.rs b/gcc/testsuite/rust/execute/torture/trait7.rs
index 064f88d5de9..fc1bbe87170 100644
--- a/gcc/testsuite/rust/execute/torture/trait7.rs
+++ b/gcc/testsuite/rust/execute/torture/trait7.rs
@@ -1,4 +1,4 @@
-/* { dg-output "123\n" } */
+/* { dg-output "123\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/trait8.rs b/gcc/testsuite/rust/execute/torture/trait8.rs
index 14392ff0cca..c26737f58e6 100644
--- a/gcc/testsuite/rust/execute/torture/trait8.rs
+++ b/gcc/testsuite/rust/execute/torture/trait8.rs
@@ -1,4 +1,4 @@
-/* { dg-output "123\n" } */
+/* { dg-output "123\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
diff --git a/gcc/testsuite/rust/execute/torture/trait9.rs b/gcc/testsuite/rust/execute/torture/trait9.rs
index c0e6d36f183..738d1935291 100644
--- a/gcc/testsuite/rust/execute/torture/trait9.rs
+++ b/gcc/testsuite/rust/execute/torture/trait9.rs
@@ -1,4 +1,4 @@
-/* { dg-output "3\n" } */
+/* { dg-output "3\r*\n" } */
 extern "C" {
     fn printf(s: *const i8, ...);
 }
-- 
2.40.0



More information about the Gcc-rust mailing list