]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Skip a number of 'g++.dg/compat/' test cases for '-fno-exceptions' testing
authorThomas Schwinge <thomas@codesourcery.com>
Wed, 7 Jun 2023 14:11:11 +0000 (16:11 +0200)
committerThomas Schwinge <thomas@codesourcery.com>
Fri, 3 Nov 2023 10:59:15 +0000 (11:59 +0100)
Running 'make check' with: 'RUNTESTFLAGS=--target_board=unix/-fno-exceptions',
'error: exception handling disabled' is triggered for C++ 'throw' etc. usage,
and per 'gcc/testsuite/lib/gcc-dg.exp:gcc-dg-prune':

    # If exceptions are disabled, mark tests expecting exceptions to be enabled
    # as unsupported.
    if { ![check_effective_target_exceptions_enabled] } {
        if [regexp "(^|\n)\[^\n\]*: error: exception handling disabled" $text] {
          return "::unsupported::exception handling disabled"
        }

..., which generally means:

    -PASS: [...] (test for excess errors)
    +UNSUPPORTED: [...]: exception handling disabled

However, this doesn't work for "split files" test cases.  For example:

    PASS: g++.dg/compat/eh/ctor1 cp_compat_main_tst.o compile
    [-PASS:-]{+UNSUPPORTED:+} g++.dg/compat/eh/ctor1 cp_compat_x_tst.o [-compile-]{+compile: exception handling disabled+}
    [-PASS:-]{+UNSUPPORTED:+} g++.dg/compat/eh/ctor1 cp_compat_y_tst.o [-compile-]{+compile: exception handling disabled+}
    [-PASS:-]{+UNRESOLVED:+} g++.dg/compat/eh/ctor1 cp_compat_x_tst.o-cp_compat_y_tst.o link
    [-PASS:-]{+UNRESOLVED:+} g++.dg/compat/eh/ctor1 cp_compat_x_tst.o-cp_compat_y_tst.o execute

The "compile"/"assemble" tests (either continue to work, or) result in the
expected 'UNSUPPORTED: [...] compile: exception handling disabled', but
dependent "link" and "execute" tests then turn UNRESOLVED.

Specify 'dg-require-effective-target exceptions_enabled' for those test cases.

gcc/testsuite/
* g++.dg/compat/eh/ctor1_main.C: Specify
'dg-require-effective-target exceptions_enabled'.
* g++.dg/compat/eh/ctor2_main.C: Likewise.
* g++.dg/compat/eh/dtor1_main.C: Likewise.
* g++.dg/compat/eh/filter1_main.C: Likewise.
* g++.dg/compat/eh/filter2_main.C: Likewise.
* g++.dg/compat/eh/new1_main.C: Likewise.
* g++.dg/compat/eh/nrv1_main.C: Likewise.
* g++.dg/compat/eh/spec3_main.C: Likewise.
* g++.dg/compat/eh/template1_main.C: Likewise.
* g++.dg/compat/eh/unexpected1_main.C: Likewise.
* g++.dg/compat/init/array5_main.C: Likewise.

gcc/testsuite/g++.dg/compat/eh/ctor1_main.C
gcc/testsuite/g++.dg/compat/eh/ctor2_main.C
gcc/testsuite/g++.dg/compat/eh/dtor1_main.C
gcc/testsuite/g++.dg/compat/eh/filter1_main.C
gcc/testsuite/g++.dg/compat/eh/filter2_main.C
gcc/testsuite/g++.dg/compat/eh/new1_main.C
gcc/testsuite/g++.dg/compat/eh/nrv1_main.C
gcc/testsuite/g++.dg/compat/eh/spec3_main.C
gcc/testsuite/g++.dg/compat/eh/template1_main.C
gcc/testsuite/g++.dg/compat/eh/unexpected1_main.C
gcc/testsuite/g++.dg/compat/init/array5_main.C

index a188b46da867fe80719a89d56b229f477067536d..1598d9db0f8ae58c26979607fc8ce844bb61b00b 100644 (file)
@@ -4,6 +4,8 @@
 
 // Split into pieces for binary compatibility testing October 2002
 
+// Explicit { dg-require-effective-target exceptions_enabled } so that dependent tests don't turn UNRESOLVED for '-fno-exceptions'.
+
 extern void ctor1_x (void);
 
 int
index 58836e26ebae7ba297c587889d88dfd35c009961..f79c8a2e756aca8bd4f0e3ba19d1330e2d7818a5 100644 (file)
@@ -4,6 +4,8 @@
 
 // Split into pieces for binary compatibility testing October 2002
 
+// Explicit { dg-require-effective-target exceptions_enabled } so that dependent tests don't turn UNRESOLVED for '-fno-exceptions'.
+
 extern void ctor2_x (void);
 
 int main ()
index 962fa64274b45611d9da3d832826b8cf104d78d7..1550d7403c64cdec8956c816d881f2d11920eeb1 100644 (file)
@@ -5,6 +5,8 @@
 
 // Split into pieces for binary compatibility testing October 2002
 
+// Explicit { dg-require-effective-target exceptions_enabled } so that dependent tests don't turn UNRESOLVED for '-fno-exceptions'.
+
 extern void dtor1_x (void);
 
 int
index 2a8fca42c31ff497b0ac35d1327f420c43014b64..39eb6e4b66d913ff0a24622bba4e041bed97e6db 100644 (file)
@@ -2,6 +2,8 @@
 
 // Split into pieces for binary compatibility testing October 2002
 
+// Explicit { dg-require-effective-target exceptions_enabled } so that dependent tests don't turn UNRESOLVED for '-fno-exceptions'.
+
 extern void filter1_x (void);
 
 int
index 866199c6b30fa8d695e8f7e770554563e2829951..43ecf8a946b18b47e2a236e9825b2a46a5c2a95a 100644 (file)
@@ -3,6 +3,8 @@
 
 // Split into pieces for binary compatibility testing October 2002
 
+// Explicit { dg-require-effective-target exceptions_enabled } so that dependent tests don't turn UNRESOLVED for '-fno-exceptions'.
+
 extern void filter2_x (void);
 
 int
index ee4cad8e50d4d381ba2904596e63d41371daaf3d..a557c9d18147616f59f4751056721eebe978fbcd 100644 (file)
@@ -4,6 +4,8 @@
 
 // Split into pieces for binary compatibility testing October 2002
 
+// Explicit { dg-require-effective-target exceptions_enabled } so that dependent tests don't turn UNRESOLVED for '-fno-exceptions'.
+
 extern void new1_x (void);
 
 int
index 3b76b5c8824c9b01af909a37291fd0779e02f674..5df3c51f6342d4e7caab464203584cd78264324e 100644 (file)
@@ -3,6 +3,8 @@
 
 // Split into pieces for binary compatibility testing October 2002
 
+// Explicit { dg-require-effective-target exceptions_enabled } so that dependent tests don't turn UNRESOLVED for '-fno-exceptions'.
+
 extern void nrv1_x (void);
 
 int
index 3f0e919b2eab863e6fcc3f6dc73c03a45c60c50d..8255fc19eebfaaaf0391dd645866d08fabc59ebc 100644 (file)
@@ -3,6 +3,8 @@
 
 // Split into pieces for binary compatibility testing October 2002
 
+// Explicit { dg-require-effective-target exceptions_enabled } so that dependent tests don't turn UNRESOLVED for '-fno-exceptions'.
+
 extern void spec3_x (void);
 
 int
index 2d169808c465c6dc608ef86ca2a2e95606d540ea..5ff1327607185b8b18a4430bf03ff1138c19421f 100644 (file)
@@ -3,6 +3,8 @@
 
 // Split into pieces for binary compatibility testing October 2002
 
+// Explicit { dg-require-effective-target exceptions_enabled } so that dependent tests don't turn UNRESOLVED for '-fno-exceptions'.
+
 extern void template1_x (void);
 
 int
index 1658db77e322aaa2c0ef260a57fd7bce8da6ff4f..99e667dedf945a57dcdfce84c4d19e1cd532c7af 100644 (file)
@@ -3,6 +3,8 @@
 
 // Split into pieces for binary compatibility testing October 2002
 
+// Explicit { dg-require-effective-target exceptions_enabled } so that dependent tests don't turn UNRESOLVED for '-fno-exceptions'.
+
 extern void unexpected1_x ();
 
 int
index 96b2cc4b12bdf46a12d8c5d8d2dbeeaa565bddde..814411e66d64a2877c1d0aa2a906f7af4d9923f2 100644 (file)
@@ -5,6 +5,8 @@
 // Incorrect construction and destruction of multi-dimensional
 // array of class.
 
+// Explicit { dg-require-effective-target exceptions_enabled } so that dependent tests don't turn UNRESOLVED for '-fno-exceptions'.
+
 extern void array5_x (void);
 
 int