summaryrefslogtreecommitdiffstats
path: root/src/glsl/glcpp/tests/127-pragma-empty.c
diff options
context:
space:
mode:
authorCarl Worth <[email protected]>2014-06-13 15:53:39 -0700
committerCarl Worth <[email protected]>2014-07-09 12:05:14 -0700
commit0e12cd795474fcc38bae7f92b870f71fe47ca0bb (patch)
treea185952e35166142f13cdfcdff456361ae04e6e9 /src/glsl/glcpp/tests/127-pragma-empty.c
parent43047384c331a9240339563704fe5d97ebe599d7 (diff)
glsl/glcpp: Don't choke on an empty pragma
The lexer was insisting that there be at least one character after "#pragma" and before the end of the line. This caused an error for a line consisting only of "#pragma" which volates at least the following sentence from the GLSL ES Specification 3.00.4: The scope as well as the effect of the optimize and debug pragmas is implementation-dependent except that their use must not generate an error. [Page 12 (Page 28 of PDF)] and likely the following sentence from that specification and also in GLSLangSpec 4.30.6: If an implementation does not recognize the tokens following #pragma, then it will ignore that pragma. Add a "make check" test to ensure no future regressions. This change fixes at least part of the following Khronos GLES3 CTS test: preprocessor.pragmas.pragma_vertex Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/glcpp/tests/127-pragma-empty.c')
-rw-r--r--src/glsl/glcpp/tests/127-pragma-empty.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/glsl/glcpp/tests/127-pragma-empty.c b/src/glsl/glcpp/tests/127-pragma-empty.c
new file mode 100644
index 00000000000..0f9b0b3d38f
--- /dev/null
+++ b/src/glsl/glcpp/tests/127-pragma-empty.c
@@ -0,0 +1,3 @@
+/* It seems an odd (and particularly useless) thing to have an empty pragma,
+ * but we probably shouldn't trigger an error in this case. */
+#pragma