glsl: Verify that #version 0 generates an error instead of crashing

Submitted by Ian Romanick on Aug. 24, 2016, 7:32 p.m.

Details

Message ID 1472067135-26546-1-git-send-email-idr@freedesktop.org
State Accepted
Commit 89c8851d2227fde3aeda3682fd148f96c750be68
Headers show
Series "glsl: Verify that #version 0 generates an error instead of crashing" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Ian Romanick Aug. 24, 2016, 7:32 p.m.
From: Ian Romanick <ian.d.romanick@intel.com>

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97420
---
 tests/spec/glsl-1.10/compiler/version-0.frag    | 8 ++++++++
 tests/spec/glsl-1.10/compiler/version-0.vert    | 8 ++++++++
 tests/spec/glsl-es-3.00/compiler/version-0.frag | 8 ++++++++
 tests/spec/glsl-es-3.00/compiler/version-0.vert | 8 ++++++++
 4 files changed, 32 insertions(+)
 create mode 100644 tests/spec/glsl-1.10/compiler/version-0.frag
 create mode 100644 tests/spec/glsl-1.10/compiler/version-0.vert
 create mode 100644 tests/spec/glsl-es-3.00/compiler/version-0.frag
 create mode 100644 tests/spec/glsl-es-3.00/compiler/version-0.vert

Patch hide | download patch | download mbox

diff --git a/tests/spec/glsl-1.10/compiler/version-0.frag b/tests/spec/glsl-1.10/compiler/version-0.frag
new file mode 100644
index 0000000..bed4793
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/version-0.frag
@@ -0,0 +1,8 @@ 
+// [config]
+// expect_result: fail
+// glsl_version: 1.10
+// [end config]
+
+#version 0
+
+void main() { gl_FragColor = vec4(0); }
\ No newline at end of file
diff --git a/tests/spec/glsl-1.10/compiler/version-0.vert b/tests/spec/glsl-1.10/compiler/version-0.vert
new file mode 100644
index 0000000..342df76
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/version-0.vert
@@ -0,0 +1,8 @@ 
+// [config]
+// expect_result: fail
+// glsl_version: 1.10
+// [end config]
+
+#version 0
+
+void main() { gl_Position = vec4(0); }
\ No newline at end of file
diff --git a/tests/spec/glsl-es-3.00/compiler/version-0.frag b/tests/spec/glsl-es-3.00/compiler/version-0.frag
new file mode 100644
index 0000000..126dcab
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/version-0.frag
@@ -0,0 +1,8 @@ 
+// [config]
+// expect_result: fail
+// glsl_version: 3.00
+// [end config]
+
+#version 0 es
+
+void main() { }
diff --git a/tests/spec/glsl-es-3.00/compiler/version-0.vert b/tests/spec/glsl-es-3.00/compiler/version-0.vert
new file mode 100644
index 0000000..1383fe3
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/version-0.vert
@@ -0,0 +1,8 @@ 
+// [config]
+// expect_result: fail
+// glsl_version: 3.00
+// [end config]
+
+#version 0 es
+
+void main() { gl_Position = vec4(0); }

Comments

Quoting Ian Romanick (2016-08-24 12:32:15)
> From: Ian Romanick <ian.d.romanick@intel.com>
> 
> Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97420
> ---
>  tests/spec/glsl-1.10/compiler/version-0.frag    | 8 ++++++++
>  tests/spec/glsl-1.10/compiler/version-0.vert    | 8 ++++++++
>  tests/spec/glsl-es-3.00/compiler/version-0.frag | 8 ++++++++
>  tests/spec/glsl-es-3.00/compiler/version-0.vert | 8 ++++++++
>  4 files changed, 32 insertions(+)
>  create mode 100644 tests/spec/glsl-1.10/compiler/version-0.frag
>  create mode 100644 tests/spec/glsl-1.10/compiler/version-0.vert
>  create mode 100644 tests/spec/glsl-es-3.00/compiler/version-0.frag
>  create mode 100644 tests/spec/glsl-es-3.00/compiler/version-0.vert
> 
> diff --git a/tests/spec/glsl-1.10/compiler/version-0.frag b/tests/spec/glsl-1.10/compiler/version-0.frag
> new file mode 100644
> index 0000000..bed4793
> --- /dev/null
> +++ b/tests/spec/glsl-1.10/compiler/version-0.frag
> @@ -0,0 +1,8 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.10
> +// [end config]
> +
> +#version 0
> +
> +void main() { gl_FragColor = vec4(0); }
> \ No newline at end of file
> diff --git a/tests/spec/glsl-1.10/compiler/version-0.vert b/tests/spec/glsl-1.10/compiler/version-0.vert
> new file mode 100644
> index 0000000..342df76
> --- /dev/null
> +++ b/tests/spec/glsl-1.10/compiler/version-0.vert
> @@ -0,0 +1,8 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.10
> +// [end config]
> +
> +#version 0
> +
> +void main() { gl_Position = vec4(0); }
> \ No newline at end of file
> diff --git a/tests/spec/glsl-es-3.00/compiler/version-0.frag b/tests/spec/glsl-es-3.00/compiler/version-0.frag
> new file mode 100644
> index 0000000..126dcab
> --- /dev/null
> +++ b/tests/spec/glsl-es-3.00/compiler/version-0.frag
> @@ -0,0 +1,8 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 3.00
> +// [end config]
> +
> +#version 0 es
> +
> +void main() { }
> diff --git a/tests/spec/glsl-es-3.00/compiler/version-0.vert b/tests/spec/glsl-es-3.00/compiler/version-0.vert
> new file mode 100644
> index 0000000..1383fe3
> --- /dev/null
> +++ b/tests/spec/glsl-es-3.00/compiler/version-0.vert
> @@ -0,0 +1,8 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 3.00
> +// [end config]
> +
> +#version 0 es
> +
> +void main() { gl_Position = vec4(0); }
> -- 
> 2.5.5
> 
> _______________________________________________
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>