From 8e7e74f3137a89ccff306350d591a34933ae772f Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 13 Feb 2019 13:43:00 -0500 Subject: Ignore expression if hit #if when skipping. (#844) * Ignore expression if hit #if when skipping. * Add test for #if parsing is ok * * Use SkipToEndOfLine * Improve comments slightly --- tests/preprocessor/if-ignore.slang | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/preprocessor/if-ignore.slang (limited to 'tests/preprocessor') diff --git a/tests/preprocessor/if-ignore.slang b/tests/preprocessor/if-ignore.slang new file mode 100644 index 000000000..66f065bf3 --- /dev/null +++ b/tests/preprocessor/if-ignore.slang @@ -0,0 +1,17 @@ +//TEST:SIMPLE: +// Check #if expression is ignored if outer #if/#ifndef means it is skipped + +#if 0 +BadThing thatWontCompile; +#if a + b == 27 +BadThing thatWontCompile; +#endif +BadThing thatWontCompile; +#endif + +#ifdef SOMETHING_SILLY +BadThing thatWontCompile; +#if SOMETHING_SILLY +BadThing thatWontCompile; +#endif +#endif -- cgit v1.2.3