aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gall <tom.gall@linaro.org>2013-01-07 14:14:39 -0600
committerTom Gall <tom.gall@linaro.org>2013-01-23 14:08:49 -0600
commit378004376cdf8b98756d5f553d98f46be4373d55 (patch)
treef13c8d4c1d2dff211e93673a2ca1cb70dafaf939
parent2dc568e31dfc9a73c4a023ec415c42a4e7a24628 (diff)
downloadpiglit-378004376cdf8b98756d5f553d98f46be4373d55.tar.gz
gles2: add compiler tests for glsl-es-1.00. Ported from tests for 1.10.
-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;
+}