/test/language/simplify/test_simplify11.e

http://github.com/tybor/Liberty · Specman e · 159 lines · 121 code · 13 blank · 25 comment · 18 complexity · 429619e8d5f4b8ab5ec5a64b792ec87c MD5 · raw file

  1. -- This file is part of SmartEiffel The GNU Eiffel Compiler Tools and Libraries.
  2. -- See the Copyright notice at the end of this file.
  3. --
  4. class TEST_SIMPLIFY11
  5. --
  6. -- To test routine body normalization (extra initialization removal).
  7. --
  8. --
  9. insert
  10. EIFFELTEST_TOOLS
  11. create {}
  12. make
  13. feature {ANY}
  14. f_0: BOOLEAN
  15. do
  16. Result := False
  17. if True then
  18. Result := True
  19. end
  20. end
  21. f_1 (a1: INTEGER): BOOLEAN
  22. do
  23. Result := False
  24. if True then
  25. Result := True
  26. end
  27. end
  28. f_2 (a1, a2: INTEGER): BOOLEAN
  29. do
  30. Result := False
  31. if True then
  32. Result := True
  33. end
  34. end
  35. make
  36. do
  37. if f_0 then
  38. assert(True)
  39. else
  40. c_inline_c("simplify error #1 in boost_simplify11")
  41. end
  42. if f_1(1) then
  43. assert(True)
  44. else
  45. c_inline_c("simplify error #2 in boost_simplify11")
  46. end
  47. if f_2(2, 2) then
  48. assert(True)
  49. else
  50. c_inline_c("simplify error #3 in boost_simplify11")
  51. end
  52. assert(assert_counter.item = 3)
  53. if g_0 then
  54. c_inline_c("simplify error #4 in boost_simplify11")
  55. else
  56. assert(True)
  57. end
  58. if g_1(1) then
  59. c_inline_c("simplify error #5 in boost_simplify11")
  60. else
  61. assert(True)
  62. end
  63. if g_2(2, 2) then
  64. c_inline_c("simplify error #6 in boost_simplify11")
  65. else
  66. assert(True)
  67. end
  68. assert(assert_counter.item = 7)
  69. if h_0 = 1 then
  70. assert(True)
  71. else
  72. c_inline_c("simplify error #7 in boost_simplify11")
  73. end
  74. if h_1(1) = 1 then
  75. assert(True)
  76. else
  77. c_inline_c("simplify error #8 in boost_simplify11")
  78. end
  79. if h_2(2, 2) = 1 then
  80. assert(True)
  81. else
  82. c_inline_c("simplify error #9 in boost_simplify11")
  83. end
  84. assert(assert_counter.item = 11)
  85. end
  86. g_0: BOOLEAN
  87. do
  88. Result := False
  89. if True then
  90. end
  91. end
  92. g_1 (a1: INTEGER): BOOLEAN
  93. do
  94. Result := False
  95. if True then
  96. end
  97. end
  98. g_2 (a1, a2: INTEGER): BOOLEAN
  99. do
  100. Result := False
  101. if True then
  102. end
  103. end
  104. h_0: INTEGER
  105. do
  106. Result := 0
  107. Result := 0
  108. if True then
  109. Result := 1
  110. end
  111. end
  112. h_1 (a1: INTEGER): INTEGER
  113. do
  114. Result := 0
  115. Result := 0
  116. if True then
  117. Result := 1
  118. end
  119. end
  120. h_2 (a1, a2: INTEGER): INTEGER
  121. do
  122. Result := 0
  123. Result := 0
  124. if True then
  125. Result := 1
  126. end
  127. end
  128. end -- class TEST_SIMPLIFY11
  129. --
  130. -- ------------------------------------------------------------------------------------------------------------------------------
  131. -- Copyright notice below. Please read.
  132. --
  133. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  134. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  135. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  136. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  137. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  138. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  139. --
  140. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  141. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  142. --
  143. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  144. --
  145. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  146. -- ------------------------------------------------------------------------------------------------------------------------------