From: Ian Romanick Date: Thu, 11 Mar 2010 22:46:19 +0000 (-0800) Subject: Add a handful of simple tests for function calls in constructors X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7e3ed40200ac87c50b84f73409ca0df48fc6a25d;p=mesa.git Add a handful of simple tests for function calls in constructors --- diff --git a/tests/constructor-01.glsl b/tests/constructor-01.glsl new file mode 100644 index 00000000000..f7af569c683 --- /dev/null +++ b/tests/constructor-01.glsl @@ -0,0 +1,4 @@ +void main() +{ + gl_Position = vec4(1.0, 1.0, 1.0, 0.0);; +} diff --git a/tests/function-01.glsl b/tests/function-01.glsl new file mode 100644 index 00000000000..0eaa2397ab6 --- /dev/null +++ b/tests/function-01.glsl @@ -0,0 +1,16 @@ +/* FAIL - no function named 'foo' exists */ + +vec4 bar(float x, float y, float z, float w) +{ + vec4 v; + v.x = x; + v.y = y; + v.z = z; + v.w = w; + return v; +} + +void main() +{ + gl_Position = foo(1.0, 1.0, 1.0, 0.0); +} diff --git a/tests/function-02.glsl b/tests/function-02.glsl new file mode 100644 index 00000000000..941fcc1ef7b --- /dev/null +++ b/tests/function-02.glsl @@ -0,0 +1,16 @@ +/* FAIL - no version of 'foo' matches the call to 'foo' */ + +vec4 foo(float x, float y, float z, float w) +{ + vec4 v; + v.x = x; + v.y = y; + v.z = z; + v.w = w; + return v; +} + +void main() +{ + gl_Position = foo(1.0, 1.0, 1.0); +} diff --git a/tests/function-03.glsl b/tests/function-03.glsl new file mode 100644 index 00000000000..6f6562ea858 --- /dev/null +++ b/tests/function-03.glsl @@ -0,0 +1,16 @@ +/* PASS */ + +vec4 foo(float x, float y, float z, float w) +{ + vec4 v; + v.x = x; + v.y = y; + v.z = z; + v.w = w; + return v; +} + +void main() +{ + gl_Position = foo(1.0, 1.0, 1.0, 0.0); +}