[Piglit] [PATCH] glsl-1.50: Add more tests for interface block name reuse

Chris Forbes chrisf at ijw.co.nz
Sat Nov 29 12:54:21 PST 2014


Mesa's GLSL implementation has different paths for these cases. Just
make sure we cover them all.

Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
 .../interface-blocks-name-reused-globally-2.vert   | 26 +++++++++++++++++++
 .../interface-blocks-name-reused-globally-3.vert   | 26 +++++++++++++++++++
 .../interface-blocks-name-reused-globally-4.vert   | 28 +++++++++++++++++++++
 .../interface-blocks-name-reused-globally-5.vert   | 28 +++++++++++++++++++++
 .../interface-blocks-name-reused-globally-6.vert   | 29 ++++++++++++++++++++++
 5 files changed, 137 insertions(+)
 create mode 100644 tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally-2.vert
 create mode 100644 tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally-3.vert
 create mode 100644 tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally-4.vert
 create mode 100644 tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally-5.vert
 create mode 100644 tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally-6.vert

diff --git a/tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally-2.vert b/tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally-2.vert
new file mode 100644
index 0000000..94c6266
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally-2.vert
@@ -0,0 +1,26 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: true
+// [end config]
+//
+// GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
+// "Block names have no other use within a shader beyond interface matching;
+//  it is an error to use a block name at global scope for anything other than
+//  as a block name."
+//
+// Tests that an interface block name may not be reused globally as anything
+// other than as a block name.
+
+#version 150
+
+out block {
+    vec4 a;
+} inst;
+
+vec4 block;
+
+void main()
+{
+}
+
diff --git a/tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally-3.vert b/tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally-3.vert
new file mode 100644
index 0000000..9ae6c07
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally-3.vert
@@ -0,0 +1,26 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: true
+// [end config]
+//
+// GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
+// "Block names have no other use within a shader beyond interface matching;
+//  it is an error to use a block name at global scope for anything other than
+//  as a block name."
+//
+// Tests that an interface block name may not be reused globally as anything
+// other than as a block name.
+
+#version 150
+
+out block {
+    vec4 a;
+} inst;
+
+vec4 block() { return vec4(0); }
+
+void main()
+{
+}
+
diff --git a/tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally-4.vert b/tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally-4.vert
new file mode 100644
index 0000000..2a35e7f
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally-4.vert
@@ -0,0 +1,28 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: true
+// [end config]
+//
+// GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
+// "Block names have no other use within a shader beyond interface matching;
+//  it is an error to use a block name at global scope for anything other than
+//  as a block name."
+//
+// Tests that an interface block name may not be reused globally as anything
+// other than as a block name.
+
+#version 150
+
+out block {
+    vec4 a;
+} inst;
+
+struct block {
+    vec4 z;
+};
+
+void main()
+{
+}
+
diff --git a/tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally-5.vert b/tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally-5.vert
new file mode 100644
index 0000000..c6f2b24
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally-5.vert
@@ -0,0 +1,28 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: true
+// [end config]
+//
+// GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
+// "Block names have no other use within a shader beyond interface matching;
+//  it is an error to use a block name at global scope for anything other than
+//  as a block name."
+//
+// Tests that an interface block name may not be reused globally as anything
+// other than as a block name.
+
+#version 150
+
+struct block {
+    vec4 z;
+};
+
+out block {
+    vec4 a;
+} inst;
+
+void main()
+{
+}
+
diff --git a/tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally-6.vert b/tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally-6.vert
new file mode 100644
index 0000000..a2ea8c0
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally-6.vert
@@ -0,0 +1,29 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: true
+// [end config]
+//
+// GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
+// "Block names have no other use within a shader beyond interface matching;
+//  it is an error to use a block name at global scope for anything other than
+//  as a block name."
+//
+// Tests that an interface block name may not be reused globally as anything
+// other than as a block name.
+
+#version 150
+
+vec4 block()
+{
+    return vec4(0);
+}
+
+out block {
+    vec4 a;
+} inst;
+
+void main()
+{
+}
+
-- 
2.1.3



More information about the Piglit mailing list