diff options
author | Carl Worth <[email protected]> | 2011-09-29 21:44:52 -0700 |
---|---|---|
committer | Carl Worth <[email protected]> | 2011-09-30 11:44:16 -0700 |
commit | c4aaf7943c2cdff0e2148b5c05813356dc99696d (patch) | |
tree | 8b2e4704b1d483107390222e9c41201be2c688a9 /src/glsl/glcpp/tests | |
parent | 28842c2331e6df2cbe18c0be3487ece93680075d (diff) |
glcpp: Raise error if defining any macro containing two consecutive underscores
The specification reserves any macro name containing two consecutive
underscores, (anywhere within the name). Previously, we only raised
this error for macro names that started with two underscores.
Fix the implementation to check for two underscores anywhere, and also
update the corresponding 086-reserved-macro-names test.
This also fixes the following two piglit tests:
spec/glsl-1.30/preprocessor/reserved/double-underscore-02.frag
spec/glsl-1.30/preprocessor/reserved/double-underscore-03.frag
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Signed-off-by: Carl Worth <[email protected]>
Diffstat (limited to 'src/glsl/glcpp/tests')
-rw-r--r-- | src/glsl/glcpp/tests/086-reserved-macro-names.c | 1 | ||||
-rw-r--r-- | src/glsl/glcpp/tests/086-reserved-macro-names.c.expected | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/glsl/glcpp/tests/086-reserved-macro-names.c b/src/glsl/glcpp/tests/086-reserved-macro-names.c index fd0c29f0c47..a6b7201f95d 100644 --- a/src/glsl/glcpp/tests/086-reserved-macro-names.c +++ b/src/glsl/glcpp/tests/086-reserved-macro-names.c @@ -1,2 +1,3 @@ #define __BAD reserved #define GL_ALSO_BAD() also reserved +#define THIS__TOO__IS__BAD reserved diff --git a/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected b/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected index 6a9df682685..d8aa9f0a648 100644 --- a/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected +++ b/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected @@ -1,7 +1,10 @@ -0:1(10): preprocessor error: Macro names starting with "__" are reserved. +0:1(10): preprocessor error: Macro names containing "__" are reserved. 0:2(9): preprocessor error: Macro names starting with "GL_" are reserved. +0:3(9): preprocessor error: Macro names containing "__" are reserved. + + |