diff options
author | Kenneth Graunke <[email protected]> | 2016-08-14 21:00:31 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2016-08-15 22:55:34 -0700 |
commit | 1f47f78fc3193ecff13799305a8e35af82e68a06 (patch) | |
tree | 2a9d5ccedff0982b4a15a1b4cf1084f3bb758180 /src/compiler/glsl | |
parent | c2f225203721681fe964cb6f1f4fec317260a91e (diff) |
glcpp: Update tests for new #undef of built-in macro rules.
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'.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97307
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Tested-by: Vinson Lee <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
4 files changed, 11 insertions, 1 deletions
diff --git a/src/compiler/glsl/glcpp/tests/120-undef-builtin.c b/src/compiler/glsl/glcpp/tests/120-undef-builtin.c index 49e7696613e..f8ade19bd59 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 3b736df378e..498dc0f98d1 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 00000000000..e3af10d7da2 --- /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 00000000000..cd0071ff4d4 --- /dev/null +++ b/src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c.expected @@ -0,0 +1,4 @@ +#version 110 + + + |