This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[New file] Add testcase to ensure that #pragma GCC diagnostic push/pop works with -Wtraditional.
- From: Eric Gallager <egall at gwmail dot gwu dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 24 Mar 2017 14:10:09 -0400
- Subject: [New file] Add testcase to ensure that #pragma GCC diagnostic push/pop works with -Wtraditional.
- Authentication-results: sourceware.org; auth=none
The attached test case failed with gcc 4.9 and older, but started
compiling successfully with only the 1 expected warning with gcc 5.
Adding it to the test suite would ensure that this behavior doesn't
regress. Note that I have only tested it by compiling it manually, and
not by actually running it as part of the entire test suite, so please
let me know if I got any of the dejagnu directives wrong.
Thanks,
Eric Gallager
gcc/testsuite/ChangeLog:
2017-03-24 Eric Gallager <egall@gwmail.gwu.edu>
* gcc.dg/pragma-diag-7.c: New test.
/* { dg-do compile } */
unsigned long ok = 0UL;
#pragma GCC diagnostic push
#pragma GCC diagnostic warning "-Wtraditional"
unsigned long bad = 1UL; /* { dg-warning "suffix" } */
/* Note the extra space before the pragma on this next line: */
#pragma GCC diagnostic pop
unsigned long ok_again = 2UL; /* { dg-bogus "suffix" } */