This website requires JavaScript.
Explore
Help
Sign in
fdo-mirrors
/
mesa
Watch
1
Star
0
Fork
You've already forked mesa
0
mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced
2026-05-22 23:58:10 +02:00
Code
Issues
Projects
Releases
Packages
Wiki
Activity
Actions
1
34cd293c8a
mesa
/
src
/
glsl
/
glcpp
/
tests
/
098-elif-undefined.c
8 lines
70 B
C
Raw
Normal View
History
Unescape
Escape
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>
2011-09-29 22:24:18 -07:00
#if 0
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>
2012-06-08 15:00:49 -07:00
Not
this
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>
2011-09-29 22:24:18 -07:00
#
elif UNDEFINED_MACRO
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>
2012-06-08 15:00:49 -07:00
Nor
this
#
else
Yes
,
this
.
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>
2011-09-29 22:24:18 -07:00
#
endif
Reference in a new issue
Copy permalink