summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/glslparsertest/glsl2/div-by-zero-01.frag13
-rw-r--r--tests/glslparsertest/glsl2/div-by-zero-02.frag13
-rw-r--r--tests/glslparsertest/glsl2/div-by-zero-03.frag13
-rw-r--r--tests/glslparsertest/glsl2/modulus-zero-01.frag13
-rw-r--r--tests/glslparsertest/glsl2/modulus-zero-02.frag13
-rw-r--r--tests/spec/glsl-1.20/compiler/arithmetic-operators/division-by-zero-01.frag19
-rw-r--r--tests/spec/glsl-1.20/compiler/arithmetic-operators/division-by-zero-02.frag19
-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
10 files changed, 95 insertions, 65 deletions
diff --git a/tests/glslparsertest/glsl2/div-by-zero-01.frag b/tests/glslparsertest/glsl2/div-by-zero-01.frag
deleted file mode 100644
index 7d2c88629..000000000
--- a/tests/glslparsertest/glsl2/div-by-zero-01.frag
+++ /dev/null
@@ -1,13 +0,0 @@
-// [config]
-// expect_result: pass
-// glsl_version: 1.20
-// [end config]
-
-#version 120
-
-float
-f() {
- float x = 1.0 / 0.0;
- return x;
-}
-
diff --git a/tests/glslparsertest/glsl2/div-by-zero-02.frag b/tests/glslparsertest/glsl2/div-by-zero-02.frag
deleted file mode 100644
index 75cad40bd..000000000
--- a/tests/glslparsertest/glsl2/div-by-zero-02.frag
+++ /dev/null
@@ -1,13 +0,0 @@
-// [config]
-// expect_result: pass
-// glsl_version: 1.20
-// [end config]
-
-#version 120
-
-int
-f() {
- int x = 1 / 0;
- return x;
-}
-
diff --git a/tests/glslparsertest/glsl2/div-by-zero-03.frag b/tests/glslparsertest/glsl2/div-by-zero-03.frag
deleted file mode 100644
index f887742d4..000000000
--- a/tests/glslparsertest/glsl2/div-by-zero-03.frag
+++ /dev/null
@@ -1,13 +0,0 @@
-// [config]
-// expect_result: pass
-// glsl_version: 1.30
-// [end config]
-
-#version 130
-
-uint
-f() {
- uint x = 1u / 0u;
- return x;
-}
-
diff --git a/tests/glslparsertest/glsl2/modulus-zero-01.frag b/tests/glslparsertest/glsl2/modulus-zero-01.frag
deleted file mode 100644
index 1b3ea994c..000000000
--- a/tests/glslparsertest/glsl2/modulus-zero-01.frag
+++ /dev/null
@@ -1,13 +0,0 @@
-// [config]
-// expect_result: pass
-// glsl_version: 1.30
-// [end config]
-
-#version 130
-
-int
-f() {
- int x = 1 % 0;
- return x;
-}
-
diff --git a/tests/glslparsertest/glsl2/modulus-zero-02.frag b/tests/glslparsertest/glsl2/modulus-zero-02.frag
deleted file mode 100644
index c812dac14..000000000
--- a/tests/glslparsertest/glsl2/modulus-zero-02.frag
+++ /dev/null
@@ -1,13 +0,0 @@
-// [config]
-// expect_result: pass
-// glsl_version: 1.30
-// [end config]
-
-#version 130
-
-uint
-f() {
- uint x = 1u % 0u;
- return x;
-}
-
diff --git a/tests/spec/glsl-1.20/compiler/arithmetic-operators/division-by-zero-01.frag b/tests/spec/glsl-1.20/compiler/arithmetic-operators/division-by-zero-01.frag
new file mode 100644
index 000000000..ab6b86d5c
--- /dev/null
+++ b/tests/spec/glsl-1.20/compiler/arithmetic-operators/division-by-zero-01.frag
@@ -0,0 +1,19 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.20
+// [end config]
+//
+// Division by zero is legal for floating point values.
+//
+// From section 5.9 of the GLSL 1.20 spec:
+// Dividing by zero does not cause an exception but does result in an
+// unspecified value.
+
+#version 120
+
+float
+f() {
+ float x = 1.0 / 0.0;
+ return x;
+}
+
diff --git a/tests/spec/glsl-1.20/compiler/arithmetic-operators/division-by-zero-02.frag b/tests/spec/glsl-1.20/compiler/arithmetic-operators/division-by-zero-02.frag
new file mode 100644
index 000000000..bc00c996f
--- /dev/null
+++ b/tests/spec/glsl-1.20/compiler/arithmetic-operators/division-by-zero-02.frag
@@ -0,0 +1,19 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.20
+// [end config]
+//
+// Division by zero is legal for integer values.
+//
+// From section 5.9 of the GLSL 1.20 spec:
+// Dividing by zero does not cause an exception but does result in an
+// unspecified value.
+
+#version 120
+
+int
+f() {
+ int x = 1 / 0;
+ return x;
+}
+
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;
+}
+