Add a handful of simple tests for function calls in constructors

This commit is contained in:
Ian Romanick 2010-03-11 14:46:19 -08:00
parent ed45ec6a51
commit 7e3ed40200
4 changed files with 52 additions and 0 deletions

View file

@ -0,0 +1,4 @@
void main()
{
gl_Position = vec4(1.0, 1.0, 1.0, 0.0);;
}

16
tests/function-01.glsl Normal file
View file

@ -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);
}

16
tests/function-02.glsl Normal file
View file

@ -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);
}

16
tests/function-03.glsl Normal file
View file

@ -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);
}