glcpp/tests: Add a test for #if defined (identifier)
Previously we only tested #if defined identifier (without parenthesis).
This commit is contained in:
17
glcpp/tests/065-if-defined-parens.c
Normal file
17
glcpp/tests/065-if-defined-parens.c
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#if defined(foo)
|
||||||
|
failure_1
|
||||||
|
#else
|
||||||
|
success_1
|
||||||
|
#endif
|
||||||
|
#define foo
|
||||||
|
#if defined ( foo )
|
||||||
|
success_2
|
||||||
|
#else
|
||||||
|
failure_2
|
||||||
|
#endif
|
||||||
|
#undef foo
|
||||||
|
#if defined (foo)
|
||||||
|
failure_3
|
||||||
|
#else
|
||||||
|
success_3
|
||||||
|
#endif
|
18
glcpp/tests/065-if-defined-parens.c.expected
Normal file
18
glcpp/tests/065-if-defined-parens.c.expected
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
success_1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
success_2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
success_3
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user