This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[New file] Add testcase to ensure that #pragma GCC diagnostic push/pop works with -Wtraditional.


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" } */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]