[Piglit] [PATCH] Add a test to reject semicolons after #extension.

Kenneth Graunke kenneth at whitecape.org
Wed Jun 11 22:03:30 PDT 2014


Mesa's main GLSL lexer currently falls through to flex's fantastic
"print unknown tokens to the screen" case in the PP start condition,
resulting in random semicolons in your output when you compile shaders.

These semicolons are not legal, as far as I can tell, so we should
reject them.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 tests/spec/glsl-1.10/compiler/extension-semicolon.frag | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 tests/spec/glsl-1.10/compiler/extension-semicolon.frag

diff --git a/tests/spec/glsl-1.10/compiler/extension-semicolon.frag b/tests/spec/glsl-1.10/compiler/extension-semicolon.frag
new file mode 100644
index 0000000..1f5d473
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/extension-semicolon.frag
@@ -0,0 +1,11 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * [end config]
+ *
+ * #extension directives do not include semicolons, and specifying bogus
+ * extra symbols at the end of the line should be rejected.
+ */
+
+#extension GL_ARB_fragment_coord_conventions : enable;
+void main() { }
-- 
2.0.0



More information about the Piglit mailing list