aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/spec/glsl-es-1.00/compiler/arithmetic-operators/division-by-zero-01.frag17
-rw-r--r--tests/spec/glsl-es-1.00/compiler/arithmetic-operators/division-by-zero-02.frag18
-rw-r--r--tests/spec/glsl-es-1.00/compiler/arithmetic-operators/modulus-00.frag16
3 files changed, 51 insertions, 0 deletions
diff --git a/tests/spec/glsl-es-1.00/compiler/arithmetic-operators/division-by-zero-01.frag b/tests/spec/glsl-es-1.00/compiler/arithmetic-operators/division-by-zero-01.frag
new file mode 100644
index 00000000..97a6122c
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/arithmetic-operators/division-by-zero-01.frag
@@ -0,0 +1,17 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.10
+// glsles_version: 1.00
+// [end config]
+//
+// Division by zero is legal for floating point values.
+//
+// From section 5.9 of the GLSL ES 1.00.17 spec:
+// Dividing by zero does not cause an exception but does result in an
+// unspecified value.
+
+float
+f() {
+ float x = 1.0 / 0.0;
+ return x;
+}
diff --git a/tests/spec/glsl-es-1.00/compiler/arithmetic-operators/division-by-zero-02.frag b/tests/spec/glsl-es-1.00/compiler/arithmetic-operators/division-by-zero-02.frag
new file mode 100644
index 00000000..7b1e906c
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/arithmetic-operators/division-by-zero-02.frag
@@ -0,0 +1,18 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.10
+// glsles_version: 1.00
+// [end config]
+
+//
+// # Division by zero is legal for integer values.
+// #
+// # From section 5.9 of the GLSL ES 1.00.17 spec:
+// # Dividing by zero does not cause an exception but does result in an
+// # unspecified value.
+
+int
+f() {
+ int x = 1 / 0;
+ return x;
+}
diff --git a/tests/spec/glsl-es-1.00/compiler/arithmetic-operators/modulus-00.frag b/tests/spec/glsl-es-1.00/compiler/arithmetic-operators/modulus-00.frag
new file mode 100644
index 00000000..8f1efea9
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/arithmetic-operators/modulus-00.frag
@@ -0,0 +1,16 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.10
+// glsles_version: 1.00
+// [end config]
+//
+// The modulus operator '%' is reserved.
+//
+// From section 5.9 of the GLSL ES 1.00.17 spec:
+// The operator modulus (%) is reserved for future use.
+
+int
+f() {
+ int tea_time = 15 % 24;
+ return tea_time;
+}