summaryrefslogtreecommitdiff
path: root/tests/spec/glsl-1.30/compiler
diff options
context:
space:
mode:
authorChad Versace <chad.versace@intel.com>2011-02-04 11:23:57 -0800
committerChad Versace <chad.versace@intel.com>2011-02-04 12:28:10 -0800
commitab7ea2f7714505badd3c2e29e9b094b6f535f964 (patch)
tree3ee416111ee4d5cdd282df259efe2e33a14b8a12 /tests/spec/glsl-1.30/compiler
parentdbdf182e70adf9d3134727023f1868bc66113e68 (diff)
glsl-1.xx: Move some tests from glslparsertest into spec directory
Move tests div-by-zero-* and modulus-zero-* into their respective spec/glsl-1.xx/compiler/arithmetic-operators directory. Also add to each test an appropriate quote from the spec.
Diffstat (limited to 'tests/spec/glsl-1.30/compiler')
-rw-r--r--tests/spec/glsl-1.30/compiler/arithmetic-operators/division-by-zero-03.frag19
-rw-r--r--tests/spec/glsl-1.30/compiler/arithmetic-operators/modulus-zero-01.frag19
-rw-r--r--tests/spec/glsl-1.30/compiler/arithmetic-operators/modulus-zero-02.frag19
3 files changed, 57 insertions, 0 deletions
diff --git a/tests/spec/glsl-1.30/compiler/arithmetic-operators/division-by-zero-03.frag b/tests/spec/glsl-1.30/compiler/arithmetic-operators/division-by-zero-03.frag
new file mode 100644
index 000000000..ea2e436b1
--- /dev/null
+++ b/tests/spec/glsl-1.30/compiler/arithmetic-operators/division-by-zero-03.frag
@@ -0,0 +1,19 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.30
+// [end config]
+//
+// Division by zero is legal for integer values.
+//
+// From section 5.9 of the GLSL 1.30 spec:
+// Dividing by zero does not cause an exception but does result in an
+// unspecified value.
+
+#version 130
+
+uint
+f() {
+ uint x = 1u / 0u;
+ return x;
+}
+
diff --git a/tests/spec/glsl-1.30/compiler/arithmetic-operators/modulus-zero-01.frag b/tests/spec/glsl-1.30/compiler/arithmetic-operators/modulus-zero-01.frag
new file mode 100644
index 000000000..8cdde55fa
--- /dev/null
+++ b/tests/spec/glsl-1.30/compiler/arithmetic-operators/modulus-zero-01.frag
@@ -0,0 +1,19 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.30
+// [end config]
+//
+// A zero modulus is legal.
+//
+// From section 5.9 of the GLSL 1.30 spec:
+// The resulting value [of a modulus operation] is undefined for any
+// component computed with a second operand that is zero,
+
+#version 130
+
+int
+f() {
+ int x = 1 % 0;
+ return x;
+}
+
diff --git a/tests/spec/glsl-1.30/compiler/arithmetic-operators/modulus-zero-02.frag b/tests/spec/glsl-1.30/compiler/arithmetic-operators/modulus-zero-02.frag
new file mode 100644
index 000000000..96958f7f8
--- /dev/null
+++ b/tests/spec/glsl-1.30/compiler/arithmetic-operators/modulus-zero-02.frag
@@ -0,0 +1,19 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.30
+// [end config]
+//
+// A zero modulus is legal.
+//
+// From section 5.9 of the GLSL 1.30 spec:
+// The resulting value [of a modulus operation] is undefined for any
+// component computed with a second operand that is zero,
+
+#version 130
+
+uint
+f() {
+ uint x = 1u % 0u;
+ return x;
+}
+