diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-02-13 13:43:00 -0500 |
|---|---|---|
| committer | Tim Foley <tfoleyNV@users.noreply.github.com> | 2019-02-13 10:43:00 -0800 |
| commit | 8e7e74f3137a89ccff306350d591a34933ae772f (patch) | |
| tree | 1804acf8cf57455abab28bde9d6db4e134d42417 /tests/preprocessor | |
| parent | 259cfa9dabca31bb1739f9ca1b42e7ca1181652f (diff) | |
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
Diffstat (limited to 'tests/preprocessor')
| -rw-r--r-- | tests/preprocessor/if-ignore.slang | 17 |
1 files changed, 17 insertions, 0 deletions
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 |
