http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53028
Bug #: 53028 Summary: add dg-pedantic Classification: Unclassified Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: testsuite AssignedTo: unassig...@gcc.gnu.org ReportedBy: m...@gcc.gnu.org It would be nice if the testsuite supported a new directive dg-pedantic, to be used like: /* Test for case labels not integer constant expressions but folding to integer constants (used in Linux kernel, PR 39613, 52283). */ /* { dg-do compile } */ /* { dg-options "" } */ extern unsigned int u; void b (int c) { switch (c) { case (int) (2 | ((4 < 8) ? 8 : u)): /* { dg-pedantic "case label is not an integer constant expression" } */ ; } } Then, the testsuite will run this testcase two times, one with dg-options and another with dg-options + -pedantic-errors. In the first case, it should convert dg-pedantic to dg-bogus, in the second case it should convert dg-pedantic to dg-error. This feature will avoid a lot of duplicated testcases, and help to test "-pedantic" much more thoroughly. Unfortunately, my DejaGNU skills are not sharp enough to figure out this.