aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp/pr65238-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp/pr65238-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/cpp/pr65238-2.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/pr65238-2.c b/gcc/testsuite/gcc.dg/cpp/pr65238-2.c
new file mode 100644
index 00000000000..c6a7aecddeb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/pr65238-2.c
@@ -0,0 +1,18 @@
+/* PR preprocessor/65238 */
+/* { dg-do preprocess } */
+
+#if __has_attribute(
+#endif
+#if __has_attribute(unused
+#endif
+#if __has_attribute(unused, unused)
+#endif
+#if __has_attribute(__has_attribute(unused))
+#endif
+
+/* { dg-error "macro .__has_attribute. requires an identifier" "" {target "*-*-*"} 4 } */
+/* { dg-error "missing ... after .__has_attribute." "" {target "*-*-*"} 6 } */
+/* { dg-error "missing ... after .__has_attribute." "" {target "*-*-*"} 8 } */
+/* { dg-error "missing binary operator before token .unused." "" {target "*-*-*"} 8 } */
+/* { dg-error "macro .__has_attribute. requires an identifier" "" {target "*-*-*"} 10 } */
+/* { dg-error "missing ... in expression" "" {target "*-*-*"} 10 } */