aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/glcpp
diff options
context:
space:
mode:
authorCarl Worth <[email protected]>2014-06-11 17:20:40 -0700
committerCarl Worth <[email protected]>2014-07-09 12:05:13 -0700
commit1a46dd6edd6a50624fd5cc876bc22dce99bd9326 (patch)
tree1863a91f0904247b4314cbb717c5bae680d379ba /src/glsl/glcpp
parent64b7fc2dd16cd4a4966a4ed8e9f239c53715f1d5 (diff)
glsl/glcpp: Add test to ensure compiler won't allow #undef for some builtins
Currently verifying that an #undef of __FILE__, __LINE__, or __VERSION__ will generate an error. Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src/glsl/glcpp')
-rw-r--r--src/glsl/glcpp/tests/120-undef-builtin.c3
-rw-r--r--src/glsl/glcpp/tests/120-undef-builtin.c.expected7
2 files changed, 10 insertions, 0 deletions
diff --git a/src/glsl/glcpp/tests/120-undef-builtin.c b/src/glsl/glcpp/tests/120-undef-builtin.c
new file mode 100644
index 00000000000..49e7696613e
--- /dev/null
+++ b/src/glsl/glcpp/tests/120-undef-builtin.c
@@ -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
index 00000000000..d6981dc0b80
--- /dev/null
+++ b/src/glsl/glcpp/tests/120-undef-builtin.c.expected
@@ -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.
+
+
+
+