[Mesa-dev] [PATCH] glcpp: Update tests for new #undef of built-in macro rules.
Kenneth Graunke
kenneth at whitecape.org
Tue Aug 16 05:57:58 UTC 2016
On Sunday, August 14, 2016 9:07:59 PM PDT Kenneth Graunke wrote:
> Ian recently changed the preprocessor to allow this in most GLSL
> versions, but not GLSL ES 3.00+. This patch converts the existing
> test that expects a failure to a #version 300 es shader, and adds
> a #version 110 shader to make sure that it's allowed.
>
> Fixes 'make check'.
>
> Cc: idr at freedesktop.org
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97307
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
I went ahead and pushed this patch with Timothy's R-b and Vinson's T-b.
Ian, if you don't like it, feel free to do something better at your
leisure :)
> ---
> src/compiler/glsl/glcpp/tests/120-undef-builtin.c | 1 +
> src/compiler/glsl/glcpp/tests/120-undef-builtin.c.expected | 3 ++-
> src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c | 4 ++++
> src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c.expected | 4 ++++
> 4 files changed, 11 insertions(+), 1 deletion(-)
> create mode 100644 src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c
> create mode 100644 src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c.expected
>
> diff --git a/src/compiler/glsl/glcpp/tests/120-undef-builtin.c b/src/compiler/glsl/glcpp/tests/120-undef-builtin.c
> index 49e7696..f8ade19 100644
> --- a/src/compiler/glsl/glcpp/tests/120-undef-builtin.c
> +++ b/src/compiler/glsl/glcpp/tests/120-undef-builtin.c
> @@ -1,3 +1,4 @@
> +#version 300 es
> #undef __LINE__
> #undef __FILE__
> #undef __VERSION__
> diff --git a/src/compiler/glsl/glcpp/tests/120-undef-builtin.c.expected b/src/compiler/glsl/glcpp/tests/120-undef-builtin.c.expected
> index 3b736df..498dc0f 100644
> --- a/src/compiler/glsl/glcpp/tests/120-undef-builtin.c.expected
> +++ b/src/compiler/glsl/glcpp/tests/120-undef-builtin.c.expected
> @@ -1,6 +1,7 @@
> -0:1(1): preprocessor error: Built-in (pre-defined) macro names cannot be undefined.
> 0:2(1): preprocessor error: Built-in (pre-defined) macro names cannot be undefined.
> 0:3(1): preprocessor error: Built-in (pre-defined) macro names cannot be undefined.
> +0:4(1): preprocessor error: Built-in (pre-defined) macro names cannot be undefined.
> +#version 300 es
>
>
>
> diff --git a/src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c b/src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c
> new file mode 100644
> index 0000000..e3af10d
> --- /dev/null
> +++ b/src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c
> @@ -0,0 +1,4 @@
> +#version 110
> +#undef __LINE__
> +#undef __FILE__
> +#undef __VERSION__
> diff --git a/src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c.expected b/src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c.expected
> new file mode 100644
> index 0000000..cd0071f
> --- /dev/null
> +++ b/src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c.expected
> @@ -0,0 +1,4 @@
> +#version 110
> +
> +
> +
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160815/98556b77/attachment.sig>
More information about the mesa-dev
mailing list