glcpp: Update tests for new #undef of built-in macro rules.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 15 Aug 2016 04:00:31 +0000 (21:00 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 16 Aug 2016 05:55:34 +0000 (22:55 -0700)
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 <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
src/compiler/glsl/glcpp/tests/120-undef-builtin.c
src/compiler/glsl/glcpp/tests/120-undef-builtin.c.expected
src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c.expected [new file with mode: 0644]

index 49e7696613ee0fad2018deadb8f5ffe491c4330d..f8ade19bd5919a634e97c54b6c83faac9d456777 100644 (file)
@@ -1,3 +1,4 @@
+#version 300 es
 #undef __LINE__
 #undef __FILE__
 #undef __VERSION__
index 3b736df378e094fe2fdb22183b618d51a84869c1..498dc0f98d137bba61fe5b69c6ab80bf6c0f21b5 100644 (file)
@@ -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 (file)
index 0000000..e3af10d
--- /dev/null
@@ -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 (file)
index 0000000..cd0071f
--- /dev/null
@@ -0,0 +1,4 @@
+#version 110
+
+
+