summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMomtchil Momtchev <momtchil@momtchev.com>2023-04-14 10:02:02 +0200
committerMomtchil Momtchev <momtchil@momtchev.com>2023-04-14 10:02:02 +0200
commitace985ce44655785eb0b4ae94d5b3662b986fc2a (patch)
tree6479463ea9a6189aa7dfa8e25aaaf23e37500b93
parent24756d1bf98eb8d5489c80c6a2f6b4d00a9b56d7 (diff)
downloadswig-ace985ce44655785eb0b4ae94d5b3662b986fc2a.tar.gz
move the unit tests
-rw-r--r--Examples/test-suite/preproc_defined.h21
-rw-r--r--Examples/test-suite/preproc_predefined.h11
2 files changed, 21 insertions, 11 deletions
diff --git a/Examples/test-suite/preproc_defined.h b/Examples/test-suite/preproc_defined.h
new file mode 100644
index 000000000..1e60ca116
--- /dev/null
+++ b/Examples/test-suite/preproc_defined.h
@@ -0,0 +1,21 @@
+/*
+ * This should not compile in when this bug is present
+ * https://github.com/swig/swig/issues/2525
+ */
+
+#define my_bad_attr __attribute__
+#define my_good_attr(x) __attribute__(x)
+
+int bad my_bad_attr((used));
+int good my_good_attr((used));
+
+/*
+ * The behaviour of Self-Referential Macros is defined
+ * https://gcc.gnu.org/onlinedocs/gcc-4.8.5/cpp/Self-Referential-Macros.html
+ */
+int y = 0;
+
+#define x (4 + y)
+#define y (2 * x)
+
+int z = y;
diff --git a/Examples/test-suite/preproc_predefined.h b/Examples/test-suite/preproc_predefined.h
index 2eb4cb6f1..8d6b6ee28 100644
--- a/Examples/test-suite/preproc_predefined.h
+++ b/Examples/test-suite/preproc_predefined.h
@@ -25,14 +25,3 @@
# error Did not detect exactly one target-language-specific macro defined in the generated wrapper.
# endif
#endif
-
-/*
- * This should not compile in when this bug is present
- * https://github.com/swig/swig/issues/2525
- */
-
-#define my_bad_attr __attribute__
-#define my_good_attr(x) __attribute__(x)
-
-int bad my_bad_attr((used));
-int good my_good_attr((used));