[Piglit] [PATCH] glsl-1.10: Verify that C99 digraphs aren't treated specially in GLSL

Ian Romanick idr at freedesktop.org
Wed Dec 7 15:32:49 PST 2011


From: Ian Romanick <ian.d.romanick at intel.com>

Right now the digraph-close-bracket tests cause a segfault (or an
assertion failure) in Mesa's GLSL compiler.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43564
Cc: Yi Sun <yi.sun at intel.com>
---
 .../special-characters/digraph-close-bracket.frag  |   14 ++++++++++++++
 .../special-characters/digraph-close-bracket.vert  |   14 ++++++++++++++
 .../special-characters/digraph-open-bracket.frag   |   14 ++++++++++++++
 .../special-characters/digraph-open-bracket.vert   |   14 ++++++++++++++
 4 files changed, 56 insertions(+), 0 deletions(-)
 create mode 100644 tests/spec/glsl-1.10/compiler/special-characters/digraph-close-bracket.frag
 create mode 100644 tests/spec/glsl-1.10/compiler/special-characters/digraph-close-bracket.vert
 create mode 100644 tests/spec/glsl-1.10/compiler/special-characters/digraph-open-bracket.frag
 create mode 100644 tests/spec/glsl-1.10/compiler/special-characters/digraph-open-bracket.vert

diff --git a/tests/spec/glsl-1.10/compiler/special-characters/digraph-close-bracket.frag b/tests/spec/glsl-1.10/compiler/special-characters/digraph-close-bracket.frag
new file mode 100644
index 0000000..4a1541f
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/special-characters/digraph-close-bracket.frag
@@ -0,0 +1,14 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * check_link: false
+ * [end config]
+ *
+ * There is no digraph interpretation in GLSL, so <% should not be
+ * interpreted as {, and %> should not be interpreted as }.
+ */
+
+void main()
+{
+	gl_FragColor = vec4(1.0);
+%>
diff --git a/tests/spec/glsl-1.10/compiler/special-characters/digraph-close-bracket.vert b/tests/spec/glsl-1.10/compiler/special-characters/digraph-close-bracket.vert
new file mode 100644
index 0000000..cfdffb3
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/special-characters/digraph-close-bracket.vert
@@ -0,0 +1,14 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * check_link: false
+ * [end config]
+ *
+ * There is no digraph interpretation in GLSL, so <% should not be
+ * interpreted as {, and %> should not be interpreted as }.
+ */
+
+void main()
+{
+	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+%>
diff --git a/tests/spec/glsl-1.10/compiler/special-characters/digraph-open-bracket.frag b/tests/spec/glsl-1.10/compiler/special-characters/digraph-open-bracket.frag
new file mode 100644
index 0000000..9ff189f
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/special-characters/digraph-open-bracket.frag
@@ -0,0 +1,14 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * check_link: false
+ * [end config]
+ *
+ * There is no digraph interpretation in GLSL, so <% should not be
+ * interpreted as {, and %> should not be interpreted as }.
+ */
+
+void main()
+<%
+	gl_FragColor = vec4(1.0);
+}
diff --git a/tests/spec/glsl-1.10/compiler/special-characters/digraph-open-bracket.vert b/tests/spec/glsl-1.10/compiler/special-characters/digraph-open-bracket.vert
new file mode 100644
index 0000000..b4c375a
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/special-characters/digraph-open-bracket.vert
@@ -0,0 +1,14 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * check_link: false
+ * [end config]
+ *
+ * There is no digraph interpretation in GLSL, so <% should not be
+ * interpreted as {, and %> should not be interpreted as }.
+ */
+
+void main()
+<%
+	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+}
-- 
1.7.6.4



More information about the Piglit mailing list