[Mesa-dev] [PATCH 3/3] glsl: glcpp: Extend testing of #line directives

Carl Worth cworth at cworth.org
Sat Jun 9 16:41:44 PDT 2012


The most recent commit adds support for comments and macro expansion
on #line directives. Add testing to verify the new features.
---
 src/glsl/glcpp/tests/091-hash-line.c          |    6 ++++++
 src/glsl/glcpp/tests/091-hash-line.c.expected |    6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/src/glsl/glcpp/tests/091-hash-line.c b/src/glsl/glcpp/tests/091-hash-line.c
index fea35d3..26d7038 100644
--- a/src/glsl/glcpp/tests/091-hash-line.c
+++ b/src/glsl/glcpp/tests/091-hash-line.c
@@ -6,3 +6,9 @@
 #error source 1, line 0 error
 #line 30 2
 #error source 2, line 30 error
+#line 45 2 /* A line with a comment */
+#define NINETY 90
+#define TWO 2
+#line NINETY TWO /* A #line line with macro expansion */
+#define FUNCTION_LIKE_MACRO(source, line) source line
+#line FUNCTION_LIKE_MACRO(180,2)
diff --git a/src/glsl/glcpp/tests/091-hash-line.c.expected b/src/glsl/glcpp/tests/091-hash-line.c.expected
index ea29149..976d178 100644
--- a/src/glsl/glcpp/tests/091-hash-line.c.expected
+++ b/src/glsl/glcpp/tests/091-hash-line.c.expected
@@ -11,3 +11,9 @@
 
 #line 30 2
 
+#line 45 2
+
+
+#line 90 2
+
+#line 180 2
-- 
1.7.10



More information about the mesa-dev mailing list