[Piglit] [PATCH 3/3] glsl-es-3.00: Verify that predefined macros cannot be undefined
Ian Romanick
idr at freedesktop.org
Tue Feb 18 10:18:58 PST 2014
From: Ian Romanick <ian.d.romanick at intel.com>
Section 3.4 (Preprocessor) of the OpenGL ES Shading Language 3.00 spec
says:
"It is an error to undefine or to redefine a built-in (pre-defined)
macro name."
NOTE: These tests currently fail on Mesa.
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
tests/spec/glsl-es-3.00/compiler/undef-GL_ES.vert | 17 +++++++++++++++++
tests/spec/glsl-es-3.00/compiler/undef-__FILE__.vert | 17 +++++++++++++++++
tests/spec/glsl-es-3.00/compiler/undef-__LINE__.vert | 17 +++++++++++++++++
tests/spec/glsl-es-3.00/compiler/undef-__VERSION__.vert | 17 +++++++++++++++++
4 files changed, 68 insertions(+)
create mode 100644 tests/spec/glsl-es-3.00/compiler/undef-GL_ES.vert
create mode 100644 tests/spec/glsl-es-3.00/compiler/undef-__FILE__.vert
create mode 100644 tests/spec/glsl-es-3.00/compiler/undef-__LINE__.vert
create mode 100644 tests/spec/glsl-es-3.00/compiler/undef-__VERSION__.vert
diff --git a/tests/spec/glsl-es-3.00/compiler/undef-GL_ES.vert b/tests/spec/glsl-es-3.00/compiler/undef-GL_ES.vert
new file mode 100644
index 0000000..524f551
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/undef-GL_ES.vert
@@ -0,0 +1,17 @@
+#version 300 es
+
+/* [config]
+ * expect_result: fail
+ * glsl_version: 3.00
+ * [end config]
+ *
+ * Section 3.4 (Preprocessor) of the OpenGL ES Shading Language 3.00 spec
+ * says:
+ *
+ * "It is an error to undefine or to redefine a built-in (pre-defined)
+ * macro name."
+ */
+
+#undef GL_ES
+
+void main() { gl_Position = vec4(0); }
diff --git a/tests/spec/glsl-es-3.00/compiler/undef-__FILE__.vert b/tests/spec/glsl-es-3.00/compiler/undef-__FILE__.vert
new file mode 100644
index 0000000..930d1b4
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/undef-__FILE__.vert
@@ -0,0 +1,17 @@
+#version 300 es
+
+/* [config]
+ * expect_result: fail
+ * glsl_version: 3.00
+ * [end config]
+ *
+ * Section 3.4 (Preprocessor) of the OpenGL ES Shading Language 3.00 spec
+ * says:
+ *
+ * "It is an error to undefine or to redefine a built-in (pre-defined)
+ * macro name."
+ */
+
+#undef __FILE__
+
+void main() { gl_Position = vec4(0); }
diff --git a/tests/spec/glsl-es-3.00/compiler/undef-__LINE__.vert b/tests/spec/glsl-es-3.00/compiler/undef-__LINE__.vert
new file mode 100644
index 0000000..9c3a635
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/undef-__LINE__.vert
@@ -0,0 +1,17 @@
+#version 300 es
+
+/* [config]
+ * expect_result: fail
+ * glsl_version: 3.00
+ * [end config]
+ *
+ * Section 3.4 (Preprocessor) of the OpenGL ES Shading Language 3.00 spec
+ * says:
+ *
+ * "It is an error to undefine or to redefine a built-in (pre-defined)
+ * macro name."
+ */
+
+#undef __LINE__
+
+void main() { gl_Position = vec4(0); }
diff --git a/tests/spec/glsl-es-3.00/compiler/undef-__VERSION__.vert b/tests/spec/glsl-es-3.00/compiler/undef-__VERSION__.vert
new file mode 100644
index 0000000..5ef1806
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/undef-__VERSION__.vert
@@ -0,0 +1,17 @@
+#version 300 es
+
+/* [config]
+ * expect_result: fail
+ * glsl_version: 3.00
+ * [end config]
+ *
+ * Section 3.4 (Preprocessor) of the OpenGL ES Shading Language 3.00 spec
+ * says:
+ *
+ * "It is an error to undefine or to redefine a built-in (pre-defined)
+ * macro name."
+ */
+
+#undef __VERSION__
+
+void main() { gl_Position = vec4(0); }
--
1.8.1.4
More information about the Piglit
mailing list