diff --git a/gcc/testsuite/g++.dg/coroutines/coro.h b/gcc/testsuite/g++.dg/coroutines/coro.h
index 02d26602727..491177f0cfd 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro.h
+++ b/gcc/testsuite/g++.dg/coroutines/coro.h
@@ -129,10 +129,6 @@ namespace coro = std;
 
 #endif // __has_include(<experimental/coroutine>)
 
-/* just to avoid cluttering dump files. */
-extern "C" int puts (const char *);
-extern "C" int printf (const char *, ...);
-
 #include <cstdlib> /* for abort () */
 
 #include <utility> /* for std::forward */
@@ -141,6 +137,7 @@ extern "C" int printf (const char *, ...);
 #  define PRINT(X)
 #  define PRINTF (void)
 #else
+#include <stdio.h>
 #  define PRINT(X) puts(X)
 #  define PRINTF printf
 #endif
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95599.C b/gcc/testsuite/g++.dg/coroutines/pr95599.C
index 9376359d378..ec97a4aa165 100644
--- a/gcc/testsuite/g++.dg/coroutines/pr95599.C
+++ b/gcc/testsuite/g++.dg/coroutines/pr95599.C
@@ -64,6 +64,6 @@ int main ()
       PRINTF ("something happened in the wrong order %d, %d, %d, %d, %d, %d, %d\n", a, b, c, d, e, f, g);
       abort ();
     }
-  puts ("main: done");
+  PRINT ("main: done");
   return 0;
 }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/call-00-co-aw-arg.C b/gcc/testsuite/g++.dg/coroutines/torture/call-00-co-aw-arg.C
index ee108072f69..19e3ec1fe68 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/call-00-co-aw-arg.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/call-00-co-aw-arg.C
@@ -68,6 +68,6 @@ int main ()
       abort ();
     }
 
-  puts ("main: done");
+  PRINT ("main: done");
   return 0;
-}
\ No newline at end of file
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/call-01-multiple-co-aw.C b/gcc/testsuite/g++.dg/coroutines/torture/call-01-multiple-co-aw.C
index 0f5785163fc..573f4f86a52 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/call-01-multiple-co-aw.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/call-01-multiple-co-aw.C
@@ -68,6 +68,6 @@ int main ()
       abort ();
     }
 
-  puts ("main: done");
+  PRINT ("main: done");
   return 0;
 }
\ No newline at end of file
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/call-02-temp-co-aw.C b/gcc/testsuite/g++.dg/coroutines/torture/call-02-temp-co-aw.C
index 4982c49d796..8ae07aa7a45 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/call-02-temp-co-aw.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/call-02-temp-co-aw.C
@@ -67,6 +67,6 @@ int main ()
       abort ();
     }
 
-  puts ("main: done");
+  PRINT ("main: done");
   return 0;
 }
\ No newline at end of file
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/call-03-temp-ref-co-aw.C b/gcc/testsuite/g++.dg/coroutines/torture/call-03-temp-ref-co-aw.C
index d0bb4667ac9..967cb1b9baa 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/call-03-temp-ref-co-aw.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/call-03-temp-ref-co-aw.C
@@ -67,6 +67,6 @@ int main ()
       abort ();
     }
 
-  puts ("main: done");
+  PRINT ("main: done");
   return 0;
 }
\ No newline at end of file
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-await-00-trivial.C b/gcc/testsuite/g++.dg/coroutines/torture/co-await-00-trivial.C
index a24c2615997..6de751af53c 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-await-00-trivial.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-await-00-trivial.C
@@ -47,6 +47,6 @@ int main ()
       PRINTF ("main: y is wrong : %d, should be 11\n", y);
       abort ();
     }
-  puts ("main: done");
+  PRINT ("main: done");
   return 0;
 }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-await-01-with-value.C b/gcc/testsuite/g++.dg/coroutines/torture/co-await-01-with-value.C
index db5c90224d2..ddff64530b3 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-await-01-with-value.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-await-01-with-value.C
@@ -52,6 +52,6 @@ int main ()
       PRINTF ("main: y is wrong : %d, should be 15\n", y);
       abort ();
     }
-  puts ("main: done");
+  PRINT ("main: done");
   return 0;
 }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-await-02-xform.C b/gcc/testsuite/g++.dg/coroutines/torture/co-await-02-xform.C
index 79ee6e17146..8d32c73503f 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-await-02-xform.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-await-02-xform.C
@@ -53,6 +53,6 @@ int main ()
       PRINTF ("main: y is wrong : %d, should be 42\n", y);
       abort ();
     }
-  puts ("main: done");
+  PRINT ("main: done");
   return 0;
 }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-await-03-rhs-op.C b/gcc/testsuite/g++.dg/coroutines/torture/co-await-03-rhs-op.C
index 64084325736..29dcc5f7a2c 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-await-03-rhs-op.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-await-03-rhs-op.C
@@ -53,6 +53,6 @@ int main ()
       PRINTF ("main: y is wrong : %d, should be 42\n", y);
       abort ();
     }
-  puts ("main: done");
+  PRINT ("main: done");
   return 0;
 }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-await-04-control-flow.C b/gcc/testsuite/g++.dg/coroutines/torture/co-await-04-control-flow.C
index e8da2d2e2ad..fd201f90481 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-await-04-control-flow.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-await-04-control-flow.C
@@ -47,6 +47,6 @@ int main ()
       PRINTF ("main: y is wrong : %d, should be 42\n", y);
       abort ();
     }
-  puts ("main: done");
+  PRINT ("main: done");
   return 0;
 }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-await-05-loop.C b/gcc/testsuite/g++.dg/coroutines/torture/co-await-05-loop.C
index 34af740c99d..58cdced7313 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-await-05-loop.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-await-05-loop.C
@@ -46,6 +46,6 @@ int main ()
       PRINTF ("main: y is wrong : %d, should be 111\n", y);
       abort ();
     }
-  puts ("main: done");
+  PRINT ("main: done");
   return 0;
 }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-await-06-ovl.C b/gcc/testsuite/g++.dg/coroutines/torture/co-await-06-ovl.C
index 14945faffd0..a3f7fa0083b 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-await-06-ovl.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-await-06-ovl.C
@@ -60,6 +60,6 @@ int main ()
       PRINTF ("main: y is wrong : %d, should be 11\n", y);
       abort ();
     }
-  puts ("main: done");
+  PRINT ("main: done");
   return 0;
 }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-await-07-tmpl.C b/gcc/testsuite/g++.dg/coroutines/torture/co-await-07-tmpl.C
index 17dff0dbbec..8915786dd1e 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-await-07-tmpl.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-await-07-tmpl.C
@@ -127,6 +127,6 @@ int main ()
       PRINTF ("main: y is wrong : %d, should be 42\n", y);
       abort ();
     }
-  puts ("main: done");
+  PRINT ("main: done");
   return 0;
 }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-await-08-cascade.C b/gcc/testsuite/g++.dg/coroutines/torture/co-await-08-cascade.C
index d34619d6b66..51eedc57421 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-await-08-cascade.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-await-08-cascade.C
@@ -58,6 +58,6 @@ int main ()
       PRINTF ("main: y is wrong : %d, should be 14672\n", y);
       abort ();
     }
-  puts ("main: done");
+  PRINT ("main: done");
   return 0;
 }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-await-09-pair.C b/gcc/testsuite/g++.dg/coroutines/torture/co-await-09-pair.C
index 525c6fc4677..e3aba4d56ef 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-await-09-pair.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-await-09-pair.C
@@ -52,6 +52,6 @@ int main ()
       PRINTF ("main: y is wrong : %d, should be 57\n", y);
       abort ();
     }
-  puts ("main: done");
+  PRINT ("main: done");
   return 0;
 }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-await-11-forwarding.C b/gcc/testsuite/g++.dg/coroutines/torture/co-await-11-forwarding.C
index 78c88ed14e9..6e59c88447b 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-await-11-forwarding.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-await-11-forwarding.C
@@ -38,6 +38,6 @@ int main ()
       PRINTF ("main: y is wrong : %d, should be 15\n", y);
       abort ();
     }
-  puts ("main: done");
+  PRINT ("main: done");
   return 0;
 }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-await-12-operator-2.C b/gcc/testsuite/g++.dg/coroutines/torture/co-await-12-operator-2.C
index 189332b78e5..91dd1927bfd 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-await-12-operator-2.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-await-12-operator-2.C
@@ -61,6 +61,6 @@ int main ()
       PRINTF ("main: y is wrong : %d, should be 14\n", y);
       abort ();
     }
-  puts ("main: done");
+  PRINT ("main: done");
   return 0;
 }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-await-13-return-ref.C b/gcc/testsuite/g++.dg/coroutines/torture/co-await-13-return-ref.C
index 339ebe4ff27..78f2d5b9d1b 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-await-13-return-ref.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-await-13-return-ref.C
@@ -53,6 +53,6 @@ int main ()
       PRINTF ("main: y is wrong : %d, should be 15\n", y);
       abort ();
     }
-  puts ("main: done");
+  PRINT ("main: done");
   return 0;
 }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-await-14-return-ref-to-auto.C b/gcc/testsuite/g++.dg/coroutines/torture/co-await-14-return-ref-to-auto.C
index 0a7c035ef2a..6b1d5bf5a43 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-await-14-return-ref-to-auto.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-await-14-return-ref-to-auto.C
@@ -40,6 +40,6 @@ int main ()
       PRINT ("main: we should be 'done' ");
       abort ();
     }
-  puts ("main: done");
+  PRINT ("main: done");
   return 0;
 }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/mid-suspend-destruction-0.C b/gcc/testsuite/g++.dg/coroutines/torture/mid-suspend-destruction-0.C
index 63561ea2ae7..0cbf93ad8af 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/mid-suspend-destruction-0.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/mid-suspend-destruction-0.C
@@ -8,6 +8,7 @@
 // go out of scope.
 
 #include "../coro.h"
+#include <stdio.h>
 
 struct coro1 {
   struct promise_type;
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/pr95003.C b/gcc/testsuite/g++.dg/coroutines/torture/pr95003.C
index eda785827ec..9022dd2b1ed 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/pr95003.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/pr95003.C
@@ -45,6 +45,6 @@ int main ()
       PRINTF ("main: y is wrong : %d, should be 100\n", y);
       abort ();
     }
-  puts ("main: done");
+  PRINT ("main: done");
   return 0;
 }
