summaryrefslogtreecommitdiffstats
path: root/src/input
diff options
context:
space:
mode:
Diffstat (limited to 'src/input')
-rw-r--r--src/input/test.c61
-rw-r--r--src/input/test0.h7
-rw-r--r--src/input/test1.h7
3 files changed, 75 insertions, 0 deletions
diff --git a/src/input/test.c b/src/input/test.c
new file mode 100644
index 0000000..150b759
--- /dev/null
+++ b/src/input/test.c
@@ -0,0 +1,61 @@
+line = __LINE__
+file = __FILE__
+
+#define A a /* a defined */
+#define B b /* b defined */
+#define C c /* c defined */
+
+#define EXPAND(x) x
+EXPAND(a) -> a
+EXPAND(A) -> a
+
+#define _STRINGIFY(x) #x
+_STRINGIFY(A) -> "A"
+
+#define STRINGIFY(x) _STRINGIFY(x)
+STRINGIFY(b) -> "b"
+STRINGIFY(A) -> "a"
+
+#define _CONCAT(x, y) x ## y
+_CONCAT(A, B) -> AB
+
+#define A_CONCAT done_a_concat
+_CONCAT(A, _CONCAT(B, C)) -> done_a_concat(b, c)
+
+#define CONCAT(x, y) _CONCAT(x, y)
+CONCAT(A, CONCAT(B, C)) -> abc
+
+#define _CONCAT3(x, y, z) x ## y ## z
+_CONCAT3(a, b, c) -> abc
+_CONCAT3(A, B, C) -> ABC
+_CONCAT3(A, EXPAND(B), C) -> AEXPAND(b)C
+
+Line is __LINE__
+File is __FILE__
+
+#define two three
+one /* one */
+#define one two
+one /* three */
+#undef two
+#define two five
+one /* five */
+#undef two
+one /* two */
+#undef one
+#define one four
+one /* four */
+#undef one
+#define one one
+one /* one */
+
+/* warning line 57 column 0 */
+#warning arse
+
+#define foo(x) foo(x, b)
+foo(1) -> _foo(1, b) without the _
+foo(foo(2)) -> _foo(_foo(2, b), b) without the _
+foo(y, z)
+
+#define var(x...) a x b
+var(e, f, g) -> a e, f, g b
diff --git a/src/input/test0.h b/src/input/test0.h
new file mode 100644
index 0000000..72db7b7
--- /dev/null
+++ b/src/input/test0.h
@@ -0,0 +1,7 @@
+
+test0start_2
+
+#include <test1.h>
+
+test0end___6
+
diff --git a/src/input/test1.h b/src/input/test1.h
new file mode 100644
index 0000000..0b690f7
--- /dev/null
+++ b/src/input/test1.h
@@ -0,0 +1,7 @@
+
+test1start_2
+
+test1mid___4
+
+test1end___6
+