[Piglit] [PATCH] amd_shader_trinary_minmax: Add tests for the preprocessor define
Kenneth Graunke
kenneth at whitecape.org
Fri Jan 24 14:13:21 PST 2014
On 01/24/2014 01:25 PM, Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
>
> This currently fails on Mesa.
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
> tests/all.py | 6 ++++++
> .../amd_shader_trinary_minmax/compiler/define.frag | 19 +++++++++++++++++++
> .../amd_shader_trinary_minmax/compiler/define.vert | 19 +++++++++++++++++++
> 3 files changed, 44 insertions(+)
> create mode 100644 tests/spec/amd_shader_trinary_minmax/compiler/define.frag
> create mode 100644 tests/spec/amd_shader_trinary_minmax/compiler/define.vert
>
> diff --git a/tests/all.py b/tests/all.py
> index b9dc92a..89dd7a3 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -1407,6 +1407,12 @@ import_glsl_parser_tests(spec['AMD_conservative_depth'],
> os.path.join(testsDir, 'spec', 'amd_conservative_depth'),
> [''])
>
> +# Group AMD_shader_trinary_minmax
> +spec['AMD_shader_trinary_minmax'] = Group()
> +import_glsl_parser_tests(spec['AMD_shader_trinary_minmax'],
> + os.path.join(testsDir, 'spec', 'amd_shader_trinary_minmax'),
> + [''])
> +
> # Group ARB_point_sprite
> arb_point_sprite = Group()
> spec['ARB_point_sprite'] = arb_point_sprite
> diff --git a/tests/spec/amd_shader_trinary_minmax/compiler/define.frag b/tests/spec/amd_shader_trinary_minmax/compiler/define.frag
> new file mode 100644
> index 0000000..b1931cf
> --- /dev/null
> +++ b/tests/spec/amd_shader_trinary_minmax/compiler/define.frag
> @@ -0,0 +1,19 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.10
> +// require_extensions: GL_AMD_shader_trinary_minmax
> +// [end config]
> +
> +#version 110
> +#extension GL_AMD_shader_trinary_minmax: require
> +
> +#if !defined GL_AMD_shader_trinary_minmax
I think #ifndef would be nicer, but not a big deal either way.
> +# error GL_AMD_shader_trinary_minmax is not defined
> +#elif GL_AMD_shader_trinary_minmax != 1
> +# error GL_AMD_shader_trinary_minmax is not equal to 1
> +#endif
> +
> +/* Some compilers generate spurious errors if a shader does not contain
> + * any code or declarations.
> + */
> +int foo(void) { return 1; }
> diff --git a/tests/spec/amd_shader_trinary_minmax/compiler/define.vert b/tests/spec/amd_shader_trinary_minmax/compiler/define.vert
> new file mode 100644
> index 0000000..b1931cf
> --- /dev/null
> +++ b/tests/spec/amd_shader_trinary_minmax/compiler/define.vert
> @@ -0,0 +1,19 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.10
> +// require_extensions: GL_AMD_shader_trinary_minmax
> +// [end config]
> +
> +#version 110
> +#extension GL_AMD_shader_trinary_minmax: require
> +
> +#if !defined GL_AMD_shader_trinary_minmax
> +# error GL_AMD_shader_trinary_minmax is not defined
Ditto.
Either way,
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
> +#elif GL_AMD_shader_trinary_minmax != 1
> +# error GL_AMD_shader_trinary_minmax is not equal to 1
> +#endif
> +
> +/* Some compilers generate spurious errors if a shader does not contain
> + * any code or declarations.
> + */
> +int foo(void) { return 1; }
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20140124/3be8defa/attachment.pgp>
More information about the Piglit
mailing list