From 721efc04da96451297ca1defe703fe755c212baa Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 29 Mar 2010 14:11:10 -0700 Subject: [PATCH] Add several simple if-statement tests --- tests/if-01.glsl | 11 +++++++++++ tests/if-02.glsl | 11 +++++++++++ tests/if-03.glsl | 11 +++++++++++ tests/if-04.glsl | 11 +++++++++++ 4 files changed, 44 insertions(+) create mode 100644 tests/if-01.glsl create mode 100644 tests/if-02.glsl create mode 100644 tests/if-03.glsl create mode 100644 tests/if-04.glsl diff --git a/tests/if-01.glsl b/tests/if-01.glsl new file mode 100644 index 0000000..ca9abd5 --- /dev/null +++ b/tests/if-01.glsl @@ -0,0 +1,11 @@ +/* FAIL - if-statement condition is not bool scalar */ + +uniform bvec4 a; + +void main() +{ + if (a) + gl_Position = vec4(1.0, 0.0, 0.0, 1.0); + else + gl_Position = vec4(0.0, 1.0, 0.0, 1.0); +} diff --git a/tests/if-02.glsl b/tests/if-02.glsl new file mode 100644 index 0000000..7adccea --- /dev/null +++ b/tests/if-02.glsl @@ -0,0 +1,11 @@ +/* FAIL - if-statement condition is not bool scalar */ + +uniform float a; + +void main() +{ + if (a) + gl_Position = vec4(1.0, 0.0, 0.0, 1.0); + else + gl_Position = vec4(0.0, 1.0, 0.0, 1.0); +} diff --git a/tests/if-03.glsl b/tests/if-03.glsl new file mode 100644 index 0000000..179618c --- /dev/null +++ b/tests/if-03.glsl @@ -0,0 +1,11 @@ +/* PASS */ + +uniform bool a; + +void main() +{ + if (a) + gl_Position = vec4(1.0, 0.0, 0.0, 1.0); + else + gl_Position = vec4(0.0, 1.0, 0.0, 1.0); +} diff --git a/tests/if-04.glsl b/tests/if-04.glsl new file mode 100644 index 0000000..7b711fb --- /dev/null +++ b/tests/if-04.glsl @@ -0,0 +1,11 @@ +/* PASS */ + +uniform bvec4 a; + +void main() +{ + if (a.x) + gl_Position = vec4(1.0, 0.0, 0.0, 1.0); + else + gl_Position = vec4(0.0, 1.0, 0.0, 1.0); +} -- 2.7.4