]> git.tdb.fi Git - libs/gl.git/blobdiff - tests/glsl/return_type_conflict.glsl
Validate return types of overloaded functions
[libs/gl.git] / tests / glsl / return_type_conflict.glsl
diff --git a/tests/glsl/return_type_conflict.glsl b/tests/glsl/return_type_conflict.glsl
new file mode 100644 (file)
index 0000000..2de20c3
--- /dev/null
@@ -0,0 +1,17 @@
+#pragma MSP stage(vertex)
+layout(location=0) in vec4 position;
+void func();
+vec4 func();
+float func();
+float func(float v);
+void main()
+{
+       gl_Position = position;
+}
+
+/* Expected error:
+<test>:4: Conflicting return type 'vec4' for function 'func'
+<test>:3: Previously declared as returning 'void'
+<test>:5: Conflicting return type 'float' for function 'func'
+<test>:3: Previously declared as returning 'void'
+*/