aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/preprocessor
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-06-04 13:55:25 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-06-04 23:24:42 +0200
commit1dd127244b7e1908215843d4ebcff465e70f6156 (patch)
tree15862a0985c1bd1167f10558bdcfd2a8181aa15d /validation/preprocessor
parented8ab3d9a92e2a86e05705814a10572dec49ca89 (diff)
downloadsparse-dev-1dd127244b7e1908215843d4ebcff465e70f6156.tar.gz
dyn-macro: add testcase for __LINE__ & friends
GCC considers __LINE__, __FILE__, ... as being defined. Add a testcase for this. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/preprocessor')
-rw-r--r--validation/preprocessor/dynamic.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/validation/preprocessor/dynamic.c b/validation/preprocessor/dynamic.c
new file mode 100644
index 00000000..3622be8d
--- /dev/null
+++ b/validation/preprocessor/dynamic.c
@@ -0,0 +1,30 @@
+#if defined(__LINE__)
+__LINE__
+#endif
+#if defined(__FILE__)
+__FILE__
+#endif
+#if defined(__DATE__)
+date
+#endif
+#if defined(__TIME__)
+time
+#endif
+#if defined(__COUNTER__)
+counter
+#endif
+
+/*
+ * check-name: dynamic-macros
+ * check-command: sparse -E $file
+ * check-known-to-fail
+ *
+ * check-output-start
+
+2
+"preprocessor/dynamic.c"
+date
+time
+counter
+ * check-output-end
+ */