/test/language/simplify/inlining/test_inlining5.e

http://github.com/tybor/Liberty · Specman e · 84 lines · 49 code · 13 blank · 22 comment · 1 complexity · bda3265e7ad040b999997da41ecc3c46 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_INLINING5
  5. create {}
  6. make
  7. feature {ANY}
  8. make
  9. do
  10. a1 := Current
  11. a2 := Current
  12. a3 := Current
  13. a4 := 1
  14. assert(f4 = 1)
  15. assert(f3 = 1)
  16. assert(f2 = 1)
  17. assert(f1 = 1)
  18. end
  19. feature {TEST_INLINING5}
  20. a1: like Current
  21. f1: INTEGER
  22. do
  23. Result := a1.f2
  24. end
  25. a2: like Current
  26. f2: INTEGER
  27. do
  28. Result := a2.f3
  29. end
  30. a3: like Current
  31. f3: INTEGER
  32. do
  33. Result := a3.f4
  34. end
  35. a4: INTEGER
  36. f4: INTEGER
  37. do
  38. Result := a4
  39. end
  40. feature {}
  41. assert (b: BOOLEAN)
  42. do
  43. cpt := cpt + 1
  44. if not b then
  45. std_output.put_string("TEST_INLINING5: ERROR Test # ")
  46. std_output.put_integer(cpt)
  47. std_output.put_string("%N")
  48. else
  49. -- std_output.put_string("Yes%N");
  50. end
  51. end
  52. cpt: INTEGER
  53. end -- class TEST_INLINING5
  54. --
  55. -- ------------------------------------------------------------------------------------------------------------------------------
  56. -- Copyright notice below. Please read.
  57. --
  58. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  59. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  60. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  61. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  62. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  63. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  64. --
  65. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  66. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  67. --
  68. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  69. --
  70. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  71. -- ------------------------------------------------------------------------------------------------------------------------------