[Piglit] [PATCH] glsl-1.10: add some preprocessor stringification tests
Ian Romanick
idr at freedesktop.org
Wed Aug 29 04:31:24 UTC 2018
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
On 08/28/2018 06:33 PM, Timothy Arceri wrote:
> From Section 3.3. (Preprocessor) of the GLSL 4.60 spec:
>
> "The following operators are also available:
> defined
> ##
> ...
>
> Any directive not listed above will cause a compile-time error."
> ---
> .../stringification-in-unreachable-branch.frag | 12 ++++++++++++
> .../compiler/preprocessor/stringification.frag | 10 ++++++++++
> 2 files changed, 22 insertions(+)
> create mode 100644 tests/spec/glsl-1.10/compiler/preprocessor/stringification-in-unreachable-branch.frag
> create mode 100644 tests/spec/glsl-1.10/compiler/preprocessor/stringification.frag
>
> diff --git a/tests/spec/glsl-1.10/compiler/preprocessor/stringification-in-unreachable-branch.frag b/tests/spec/glsl-1.10/compiler/preprocessor/stringification-in-unreachable-branch.frag
> new file mode 100644
> index 000000000..32b1798b8
> --- /dev/null
> +++ b/tests/spec/glsl-1.10/compiler/preprocessor/stringification-in-unreachable-branch.frag
> @@ -0,0 +1,12 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.10
> +// [end config]
> +
> +#version 110
> +
> +#ifdef this_is_undefined
> +#define VEC4_STRING_PARAM(a, b, c, d) vec4(#a, #b, c, d)
> +#endif
> +
> +void main() { }
> diff --git a/tests/spec/glsl-1.10/compiler/preprocessor/stringification.frag b/tests/spec/glsl-1.10/compiler/preprocessor/stringification.frag
> new file mode 100644
> index 000000000..617ad102d
> --- /dev/null
> +++ b/tests/spec/glsl-1.10/compiler/preprocessor/stringification.frag
> @@ -0,0 +1,10 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.10
> +// [end config]
> +
> +#version 110
> +
> +#define VEC4_STRING_PARAM(a, b, c, d) vec4(#a, #b, c, d)
> +
> +void main() { }
>
More information about the Piglit
mailing list