]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++/reflection: make p3394-1.C dg-run
authorMarek Polacek <polacek@redhat.com>
Thu, 5 Feb 2026 21:38:19 +0000 (16:38 -0500)
committerMarek Polacek <polacek@redhat.com>
Thu, 5 Feb 2026 22:18:16 +0000 (17:18 -0500)
This test now links now so we should make it a dg-run.  The output
checking isn't very pretty.

gcc/testsuite/ChangeLog:

* g++.dg/reflect/p3394-1.C: Make dg-run.  Add dg-output.

Reviewed-by: Jakub Jelinek <jakub@redhat.com>
gcc/testsuite/g++.dg/reflect/p3394-1.C

index 23e676f8b7c3420f905900f301b3c5562276a1ac..763bc7f8835174974c7a24e9c4d1d80465a60d05 100644 (file)
@@ -1,9 +1,7 @@
-// { dg-do compile { target c++26 } }
+// { dg-do run { target c++26 } }
 // { dg-additional-options "-freflection" }
 // Slightly tweaked test from P3394R4 3.2
 // https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3394r4.html#test-parametrization
-// TODO: Doesn't link currently, once it does, it should be dg-do run test
-// with output checking or something like that.
 
 #include <meta>
 #include <array>
@@ -172,3 +170,15 @@ main ()
 {
   invoke_all <^^N> ();
 }
+
+// { dg-output "Called test_sum \\\(x=1, y=1, z=2\\\)(\n|\r\n|\r)" }
+// { dg-output "\[^\n\r]*Called test_sum \\\(x=1, y=2, z=3\\\)(\n|\r\n|\r)" }
+// { dg-output "\[^\n\r]*setup fixture(\n|\r\n|\r)" }
+// { dg-output "\[^\n\r]*test one\\\(1\\\)(\n|\r\n|\r)" }
+// { dg-output "\[^\n\r]*teardown fixture(\n|\r\n|\r)" }
+// { dg-output "\[^\n\r]*setup fixture(\n|\r\n|\r)" }
+// { dg-output "\[^\n\r]*test one\\\(2\\\)(\n|\r\n|\r)" }
+// { dg-output "\[^\n\r]*teardown fixture(\n|\r\n|\r)" }
+// { dg-output "\[^\n\r]*setup fixture(\n|\r\n|\r)" }
+// { dg-output "\[^\n\r]*test two(\n|\r\n|\r)" }
+// { dg-output "\[^\n\r]*teardown fixture" }