unifdef.test 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. Run me through unifdef -UA
  2. *** Nothing should be visible here:
  3. #if defined A && defined B
  4. hello world
  5. #endif
  6. #if defined A && B
  7. hello world
  8. #endif
  9. #if defined A && 1
  10. hello world
  11. #endif
  12. #if defined A && (1 > 0)
  13. hello world
  14. #endif
  15. #if defined B && defined A
  16. hello world
  17. #endif
  18. #if B && defined A
  19. hello world
  20. #endif
  21. #if 1 && defined A
  22. hello world
  23. #endif
  24. #if (1 > 0) && defined A
  25. hello world
  26. #endif
  27. #if defined A && (defined FOO || defined BAR)
  28. hello world
  29. #endif
  30. #if (defined FOO || defined BAR) && defined A
  31. hello world
  32. #endif
  33. *** Everything should be visible here, but #if/#endif removed:
  34. #if defined B || !defined A
  35. hello world 1
  36. #endif
  37. #if !defined A || defined B
  38. hello world 2 (last)
  39. #endif
  40. *** This should be unchanged (#if/#endif not removed):
  41. #if defined A || defined B
  42. I am here 1
  43. #endif
  44. #if defined B || defined A
  45. I am here 2
  46. #endif
  47. I am here 3
  48. #if !defined FOO && !defined BAR \
  49. && !defined BAZ
  50. # error "I am here 4"
  51. #endif
  52. I am here 5
  53. #if (!defined FOO \
  54. && (defined BAR || defined BAZ \
  55. || defined XYZ))
  56. I am here 6
  57. #endif
  58. I am here 7
  59. #if !defined FOO \
  60. && defined BAR
  61. I am here 8
  62. #endif
  63. I am here 9 (last)
  64. *** End