t_5_014.cpp 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*=============================================================================
  2. Boost.Wave: A Standard compliant C++ preprocessor library
  3. http://www.boost.org/
  4. Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
  5. Software License, Version 1.0. (See accompanying file
  6. LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. The tests included in this file were initially taken from the mcpp V2.5
  8. preprocessor validation suite and were modified to fit into the Boost.Wave
  9. unit test requirements.
  10. The original files of the mcpp preprocessor are distributed under the
  11. license reproduced at the end of this file.
  12. =============================================================================*/
  13. // Tests integer preprocessing number token and type of #if expression.
  14. // 12.1:
  15. //R #line 24 "t_5_014.cpp"
  16. //R true
  17. #if __TESTWAVE_LONG_MAX__ <= __TESTWAVE_LONG_MIN__
  18. "Bad evaluation of long."
  19. #else
  20. true
  21. #endif
  22. //R #line 32 "t_5_014.cpp"
  23. //R true
  24. #if __TESTWAVE_LONG_MAX__ <= (__TESTWAVE_LONG_MAX__ / 2) /* 0x3FFFFFFF */
  25. "Bad evaluation of long."
  26. #else
  27. true
  28. #endif
  29. // 12.2:
  30. //R #line 41 "t_5_014.cpp"
  31. //R true
  32. #if __TESTWAVE_ULONG_MAX__ / 2 < __TESTWAVE_LONG_MAX__
  33. "Bad evaluation of unsigned long."
  34. #else
  35. true
  36. #endif
  37. // 12.3: Octal number.
  38. //R #line 50 "t_5_014.cpp"
  39. //R true
  40. #if 0177777 != 65535
  41. "Bad evaluation of octal number."
  42. #else
  43. true
  44. #endif
  45. // 12.4: Hexadecimal number.
  46. //R #line 59 "t_5_014.cpp"
  47. //R true
  48. #if 0Xffff != 65535 || 0xFfFf != 65535
  49. "Bad evaluation of hexadecimal number."
  50. #else
  51. true
  52. #endif
  53. // 12.5: Suffix 'L' or 'l'.
  54. //R #line 68 "t_5_014.cpp"
  55. //R true
  56. #if 0L != 0 || 0l != 0
  57. "Bad evaluation of 'L' suffix."
  58. #else
  59. true
  60. #endif
  61. // 12.6: Suffix 'U' or 'u'.
  62. //R #line 77 "t_5_014.cpp"
  63. //R true
  64. #if 1U != 1 || 1u != 1
  65. "Bad evaluation of 'U' suffix."
  66. #else
  67. true
  68. #endif
  69. // 12.7: Negative integer.
  70. //R #line 86 "t_5_014.cpp"
  71. //R true
  72. #if 0 <= -1
  73. "Bad evaluation of negative number."
  74. #else
  75. true
  76. #endif
  77. /*-
  78. * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp>
  79. * All rights reserved.
  80. *
  81. * Redistribution and use in source and binary forms, with or without
  82. * modification, are permitted provided that the following conditions
  83. * are met:
  84. * 1. Redistributions of source code must retain the above copyright
  85. * notice, this list of conditions and the following disclaimer.
  86. * 2. Redistributions in binary form must reproduce the above copyright
  87. * notice, this list of conditions and the following disclaimer in the
  88. * documentation and/or other materials provided with the distribution.
  89. *
  90. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
  91. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  92. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  93. * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
  94. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  95. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  96. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  97. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  98. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  99. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  100. * SUCH DAMAGE.
  101. */