summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-06-18 23:04:44 -0700
committerKenneth Graunke <kenneth@whitecape.org>2010-06-21 12:41:05 -0700
commitbac0e371e373bc51b1b3c575d0a46e324c36bc4f (patch)
tree38c1238e63d45d568e308c3583eb31a5016f66b7
parent65875743542fd1388b18a1a3c1c2bec4a6a3007e (diff)
glcpp/tests: Add a test for #if defined (identifier)
Previously we only tested #if defined identifier (without parenthesis).
-rw-r--r--glcpp/tests/065-if-defined-parens.c17
-rw-r--r--glcpp/tests/065-if-defined-parens.c.expected18
2 files changed, 35 insertions, 0 deletions
diff --git a/glcpp/tests/065-if-defined-parens.c b/glcpp/tests/065-if-defined-parens.c
new file mode 100644
index 0000000000..48aa0f8c3e
--- /dev/null
+++ b/glcpp/tests/065-if-defined-parens.c
@@ -0,0 +1,17 @@
+#if defined(foo)
+failure_1
+#else
+success_1
+#endif
+#define foo
+#if defined ( foo )
+success_2
+#else
+failure_2
+#endif
+#undef foo
+#if defined (foo)
+failure_3
+#else
+success_3
+#endif
diff --git a/glcpp/tests/065-if-defined-parens.c.expected b/glcpp/tests/065-if-defined-parens.c.expected
new file mode 100644
index 0000000000..3f01955ee4
--- /dev/null
+++ b/glcpp/tests/065-if-defined-parens.c.expected
@@ -0,0 +1,18 @@
+
+
+
+success_1
+
+
+
+success_2
+
+
+
+
+
+
+
+success_3
+
+