summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/pr69543-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/c-c++-common/pr69543-2.c')
-rw-r--r--gcc/testsuite/c-c++-common/pr69543-2.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/pr69543-2.c b/gcc/testsuite/c-c++-common/pr69543-2.c
new file mode 100644
index 0000000000..4099fb2555
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr69543-2.c
@@ -0,0 +1,14 @@
+/* { dg-options "-Wuninitialized" } */
+
+/* Verify disabling a warning, where both the _Pragma and the
+ affected code are *not* in a macro. */
+
+void test (char yylval)
+{
+ char *yyvsp;
+ _Pragma ("GCC diagnostic push")
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
+ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+ *++yyvsp = yylval;
+ _Pragma ("GCC diagnostic pop")
+}