Add a handful of simple tests for function calls in constructors
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 11 Mar 2010 22:46:19 +0000 (14:46 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 11 Mar 2010 22:46:19 +0000 (14:46 -0800)
tests/constructor-01.glsl [new file with mode: 0644]
tests/function-01.glsl [new file with mode: 0644]
tests/function-02.glsl [new file with mode: 0644]
tests/function-03.glsl [new file with mode: 0644]

diff --git a/tests/constructor-01.glsl b/tests/constructor-01.glsl
new file mode 100644 (file)
index 0000000..f7af569
--- /dev/null
@@ -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 (file)
index 0000000..0eaa239
--- /dev/null
@@ -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 (file)
index 0000000..941fcc1
--- /dev/null
@@ -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 (file)
index 0000000..6f6562e
--- /dev/null
@@ -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);
+}