Add testcase to ensure that #pragma GCC diagnostic push/pop works with -Wtraditional
authorEric Gallager <egall@gwmail.gwu.edu>
Thu, 18 May 2017 18:55:33 +0000 (18:55 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Thu, 18 May 2017 18:55:33 +0000 (18:55 +0000)
2017-05-18  Eric Gallager  <egall@gwmail.gwu.edu>

* gcc.dg/pragma-diag-7.c: New test.

From-SVN: r248253

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pragma-diag-7.c [new file with mode: 0644]

index 60299f2c8c1c2a4465c1cf6284d303ec656669a0..0ea8444d590fd0fed101481dcc0148178f8bf1e1 100644 (file)
@@ -1,3 +1,7 @@
+2017-05-18  Eric Gallager  <egall@gwmail.gwu.edu>
+
+       * gcc.dg/pragma-diag-7.c: New test.
+
 2017-05-18  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/80799
diff --git a/gcc/testsuite/gcc.dg/pragma-diag-7.c b/gcc/testsuite/gcc.dg/pragma-diag-7.c
new file mode 100644 (file)
index 0000000..402ee56
--- /dev/null
@@ -0,0 +1,9 @@
+/* { 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" } */