aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/c-c++-common')
-rw-r--r--gcc/testsuite/c-c++-common/cpp/pragma-diagnostic-loc-2.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/cpp/pragma-diagnostic-loc-2.c b/gcc/testsuite/c-c++-common/cpp/pragma-diagnostic-loc-2.c
new file mode 100644
index 0000000..734da21
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cpp/pragma-diagnostic-loc-2.c
@@ -0,0 +1,15 @@
+/* PR c/118838 */
+/* { dg-do compile } */
+/* { dg-additional-options "-Wunknown-pragmas" } */
+
+/* Make sure the warnings are suppressed as expected. */
+
+/* The tokens need to be all on the same line here. */
+_Pragma ("GCC diagnostic push") _Pragma ("GCC diagnostic ignored \"-Wunknown-pragmas\"") _Pragma ("__unknown__") _Pragma ("GCC diagnostic pop")
+
+#define MACRO \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wunknown-pragmas\"") \
+ _Pragma ("__unknown__") \
+ _Pragma ("GCC diagnostic pop")
+MACRO