History log of /external/mesa3d/src/glsl/glcpp/tests/098-elif-undefined.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c96b8302a398a6db27f1bb6070cdc088c7ee0fba 09-Jun-2012 Carl Worth <cworth@cworth.org> glsl: glcpp: Allow "#if undefined-macro' to evaluate to false.

A strict reading of the GLSL specification would have this be an
error, but we've received reports from users who expect the
preprocessor to interepret undefined macros as 0. This is the standard
behavior of the rpeprocessor for C, and according to these user
reports is also the behavior of other OpenGL implementations.

So here's one of those cases where we can make our users happier by
ignoring the specification. And it's hard to imagine users who really,
really want to see an error for this case.

The two affected tests cases are updated to reflect the new behavior.

Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/glcpp/tests/098-elif-undefined.c
201485bae0fcba4db61ceb1e9d9916778b5bba74 30-Sep-2011 Carl Worth <cworth@cworth.org> glcpp: Add a test for #elif with an undefined macro.

As written, this test correctly raises an error for #elif being used
with an undefined macro (and not as an argument to "defined"). If the
preceding #if were '#if 1' then this diagnositc would correctly be
hidden. That allows code such as the following to not raise an error:

#ifndef MAYBE_UNDEFINED
#elif MAYBE_UNDEFINED < 5
...
#endif

So this test case is working as expected already. We add it here just
to improve test coverage.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Carl Worth <cworth@cworth.org>
/external/mesa3d/src/glsl/glcpp/tests/098-elif-undefined.c