#ifdef nested #expand 15. This should appear. This is should be line 2 and is line __LINE__. #elifdef pathtest This should not appear (path test was relative to wrong path) #elifndef nested 1. This should appear. This is a test file for the preprocessor. 2. This should appear. #define test 0 3. This should appear. #expand 4. This should appear. This should be line 10 and is line __LINE__. 5. This should appear. #if test This should not appear. #else 6. This should appear. #endif 7. This should appear. 8. This should appear. #ifdef test 9. This should appear. #ifndef test This should not appear. #ifdef test This should not appear. #else This should not appear. #endif #else 10. This should appear. #ifdef test #expand 11. This should appear. 'test' is defined with value __test__ (should be 0). #else This should not appear. #endif #endif #else This should not appear. #else 12. This should appear. #endif 13. This should appear. #ifdef HOME #expand 14. This should appear. Your home directory is __HOME__. #else 14. This should appear. You have not defined the HOME variable (e.g. by using -E). #endif # now we include a file: #define nested #include ../preprocessor/test.txt #if 0 This should not appear. #undef test #endif #if !test 16. This should appear. #else This should not appear. #endif #if 1 17. This should appear. #endif #define foo #undef bar #ifdef foo 18. This should appear. # (included if foo is defined) #else This should not appear. # (included if foo is not defined) #elifndef bar 19. This should appear. # (included if foo is defined and bar is not defined) #else This should not appear. # (included if either foo is defined or bar is not defined) #endif #undef foo #ifdef foo This should not appear. # (included if foo is defined) #else 20. This should appear. # (included if foo is not defined) #elifndef bar This should not appear. # (included if foo is defined and bar is not defined) #else 21. This should appear. # (included if either foo is defined or bar is not defined) #endif 22. This should appear. # above line is redundant. 23. This should appear. +-+---+-----+ 24. This should appear. | | | | 25. This should appear. +-+---+-----+ #filter spaces 26. This should appear. +-+-+-+ 27. This should appear. | | | | 28. This should appear. +-+-+-+ 29. This should appear. # above line is redundant. #filter slashslash 30. This should appear. +-+-+-+ // This should not appear 31. This should appear. | | | | // This should not appear 32. This should appear. +-+-+-+ // This should not appear // This should not appear either #unfilter spaces 33. This should appear. +-+---+-----+ // This should not appear // This should not appear either 34. This should appear. | | | | // This should not appear // This should not appear either 35. This should appear. +-+---+-----+ // This should not appear #unfilter spaces slashslash 36. This should appear. // This should appear. #include test/test.txt #filter substitution #ifdef HOME 40. This should appear. Your home directory is @HOME@. #else 40. This should appear. You have not defined the HOME variable (e.g. by using -E). #endif #define __FAILED__ appear 41. This should @__FAILED__@. #filter attemptSubstitution # next line would cause a fatal error if attemptSubstition wasn't # enabled but substitution was. But since filters run alphabetically, # it should be ok. 42. This should appear. @__BLANK__@ #unfilter attemptSubstitution 43. This should appear. End. #else # this would be included at the same time as line 15. # this is tested above near lines 18-21 #endif