aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/preprocessor/expand-redef.c
diff options
context:
space:
mode:
Diffstat (limited to 'validation/preprocessor/expand-redef.c')
-rw-r--r--validation/preprocessor/expand-redef.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/validation/preprocessor/expand-redef.c b/validation/preprocessor/expand-redef.c
new file mode 100644
index 00000000..0ccf0d4c
--- /dev/null
+++ b/validation/preprocessor/expand-redef.c
@@ -0,0 +1,20 @@
+#define f(x) x x
+f(1
+#undef f
+#define f 2
+ f)
+
+/*
+ * check-name: expand-redef
+ * check-command: sparse -E $file
+ *
+ * check-output-start
+
+1 2 1 2
+ * check-output-end
+ *
+ * check-error-start
+preprocessor/expand-redef.c:3:1: warning: directive in macro's argument list
+preprocessor/expand-redef.c:4:1: warning: directive in macro's argument list
+ * check-error-end
+ */