There are various ways for tests to report an execution failure.
Make sure the testing infrastructure can detect all of them, so that
failures don't go silent.
for gcc/testsuite/ChangeLog
* gcc.dg/shouldfail-abort.c: New.
* gcc.dg/shouldfail-exit-neg.c: New.
* gcc.dg/shouldfail-exit-pos.c: New.
* gcc.dg/shouldfail-return-neg.c: New.
* gcc.dg/shouldfail-return-pos.c: New.
--- /dev/null
+/* { dg-do run } */
+/* { dg-shouldfail "" } */
+
+/* Raise red flags if the way programs are meant to flag failures aren't
+ detected as such. This is unlikely to indicate a compiler problem, but
+ maybe a runtime or test infrastructure problem. */
+
+int main() {
+ __builtin_abort();
+}
--- /dev/null
+/* { dg-do run } */
+/* { dg-shouldfail "" } */
+
+/* Raise red flags if the way programs are meant to flag failures aren't
+ detected as such. This is unlikely to indicate a compiler problem, but
+ maybe a runtime or test infrastructure problem. */
+
+int main() {
+ __builtin_exit(-1);
+}
--- /dev/null
+/* { dg-do run } */
+/* { dg-shouldfail "" } */
+
+/* Raise red flags if the way programs are meant to flag failures aren't
+ detected as such. This is unlikely to indicate a compiler problem, but
+ maybe a runtime or test infrastructure problem. */
+
+int main() {
+ __builtin_exit(1);
+}
--- /dev/null
+/* { dg-do run } */
+/* { dg-shouldfail "" } */
+
+/* Raise red flags if the way programs are meant to flag failures aren't
+ detected as such. This is unlikely to indicate a compiler problem, but
+ maybe a runtime or test infrastructure problem. */
+
+int main() {
+ return -1;
+}
--- /dev/null
+/* { dg-do run } */
+/* { dg-shouldfail "" } */
+
+/* Raise red flags if the way programs are meant to flag failures aren't
+ detected as such. This is unlikely to indicate a compiler problem, but
+ maybe a runtime or test infrastructure problem. */
+
+int main() {
+ return 1;
+}