[prev in list] [next in list] [prev in thread] [next in thread]
List: mesa3d-dev
Subject: [Mesa-dev] [PATCH 6/6] glcpp: Add a test for #elif with an
From: Carl Worth <cworth () cworth ! org>
Date: 2011-09-30 6:00:30
Message-ID: 1317362430-2271-7-git-send-email-cworth () cworth ! org
[Download RAW message or body]
As written, this test correctly raises an error for #elif being used
with an undefined macro (and not as an argument to "defined"). If the
preceding #if were '#if 1' then this diagnositc would correctly be
hidden. That allows code such as the following to not raise an error:
#ifndef MAYBE_UNDEFINED
#elif MAYBE_UNDEFINED < 5
...
#endif
So this test case is working as expected already. We add it here just
to improve test coverage.
---
src/glsl/glcpp/tests/098-elif-undefined.c | 3 +++
src/glsl/glcpp/tests/098-elif-undefined.c.expected | 5 +++++
2 files changed, 8 insertions(+), 0 deletions(-)
create mode 100644 src/glsl/glcpp/tests/098-elif-undefined.c
create mode 100644 src/glsl/glcpp/tests/098-elif-undefined.c.expected
diff --git a/src/glsl/glcpp/tests/098-elif-undefined.c \
b/src/glsl/glcpp/tests/098-elif-undefined.c new file mode 100644
index 0000000..52a331c
--- /dev/null
+++ b/src/glsl/glcpp/tests/098-elif-undefined.c
@@ -0,0 +1,3 @@
+#if 0
+#elif UNDEFINED_MACRO
+#endif
diff --git a/src/glsl/glcpp/tests/098-elif-undefined.c.expected \
b/src/glsl/glcpp/tests/098-elif-undefined.c.expected new file mode 100644
index 0000000..de967ea
--- /dev/null
+++ b/src/glsl/glcpp/tests/098-elif-undefined.c.expected
@@ -0,0 +1,5 @@
+0:2(22): preprocessor error: syntax error, unexpected IDENTIFIER
+0:1(7): preprocessor error: Unterminated #if
+
+
+
--
1.7.6.3
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic