]> git.tdb.fi Git - libs/gl.git/blobdiff - tests/glsl/identifier_conflict.glsl
Add some test cases to test shader validation
[libs/gl.git] / tests / glsl / identifier_conflict.glsl
diff --git a/tests/glsl/identifier_conflict.glsl b/tests/glsl/identifier_conflict.glsl
new file mode 100644 (file)
index 0000000..3e10089
--- /dev/null
@@ -0,0 +1,31 @@
+#pragma MSP stage(vertex)
+layout(location=0) in vec4 position;
+out VertexOut
+{
+       vec2 texcoord;
+} vs_out;
+vec3 normal;
+out VertexOut2
+{
+       vec2 texcoord;
+       vec3 normal;
+};
+vec2 texcoord;
+void main()
+{
+       vec2 texcoord;
+       gl_Position = position;
+}
+vec2 texcoord()
+{
+       return vec2(0.0);
+}
+
+/* Expected error:
+<test>:11: Multiple definition of 'normal'
+<test>:7: Previous definition is here
+<test>:13: Multiple definition of 'texcoord'
+<test>:10: Previous definition is here
+<test>:19: Multiple definition of 'texcoord'
+<test>:10: Previous definition is here
+*/