glsl/glcpp: Add test to ensure compiler won't allow #undef for some builtins
authorCarl Worth <cworth@cworth.org>
Thu, 12 Jun 2014 00:20:40 +0000 (17:20 -0700)
committerCarl Worth <cworth@cworth.org>
Wed, 9 Jul 2014 19:05:13 +0000 (12:05 -0700)
Currently verifying that an #undef of __FILE__, __LINE__, or __VERSION__ will
generate an error.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/glsl/glcpp/tests/120-undef-builtin.c [new file with mode: 0644]
src/glsl/glcpp/tests/120-undef-builtin.c.expected [new file with mode: 0644]

diff --git a/src/glsl/glcpp/tests/120-undef-builtin.c b/src/glsl/glcpp/tests/120-undef-builtin.c
new file mode 100644 (file)
index 0000000..49e7696
--- /dev/null
@@ -0,0 +1,3 @@
+#undef __LINE__
+#undef __FILE__
+#undef __VERSION__
diff --git a/src/glsl/glcpp/tests/120-undef-builtin.c.expected b/src/glsl/glcpp/tests/120-undef-builtin.c.expected
new file mode 100644 (file)
index 0000000..d6981dc
--- /dev/null
@@ -0,0 +1,7 @@
+0:1(2): preprocessor error: Built-in (pre-defined) macro names can not be undefined.
+0:2(1): preprocessor error: Built-in (pre-defined) macro names can not be undefined.
+0:3(1): preprocessor error: Built-in (pre-defined) macro names can not be undefined.
+
+
+
+