[PATCH 1/4] dyn-macro: add testcase for __LINE__ & friends

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



GCC considers __LINE__, __FILE__, ... as being defined.
Add a testcase for this.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 validation/preprocessor/dynamic.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 validation/preprocessor/dynamic.c

diff --git a/validation/preprocessor/dynamic.c b/validation/preprocessor/dynamic.c
new file mode 100644
index 000000000..3622be8d1
--- /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
+ */
-- 
2.17.1

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux