diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-07-15 02:48:00 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-07-15 02:48:00 +0200 |
commit | 0b4d4b0e4171ba170c0468fdcc014bcd16232802 (patch) | |
tree | 160de4d3bf985e6058c1c18ab9febca85a1a3460 /tests/test | |
parent | work (diff) | |
download | calp-0b4d4b0e4171ba170c0468fdcc014bcd16232802.tar.gz calp-0b4d4b0e4171ba170c0468fdcc014bcd16232802.tar.xz |
Fix nested #if
Diffstat (limited to 'tests/test')
-rw-r--r-- | tests/test/cpp/preprocessor2.scm | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/tests/test/cpp/preprocessor2.scm b/tests/test/cpp/preprocessor2.scm index 71e0c1a0..27332894 100644 --- a/tests/test/cpp/preprocessor2.scm +++ b/tests/test/cpp/preprocessor2.scm @@ -641,8 +641,6 @@ (lex "\"stdio.h\"")))) ;; TODO #include is subject to macro expansion - ;; test with through resolve-header - (test-group "Actually including stuff" (call-with-tmp-header " @@ -1135,8 +1133,30 @@ _Pragma(\"not-called\") #endif")))) - (test-group "Nested conditions" - 'TODO) + (test-equal "Nested conditions" + (lex "a\n\nc") + (run " +#define X +#ifdef X +a +#ifdef Y +b +#endif +c +#endif +")) + + (test-equal + (lex "") + (run " +#ifdef X +a +#ifdef Y +b +#endif /* Y */ +c +#endif /* X */ +")) (test-group "Unexpected if ends" (test-error "#else outside if" |