PageRenderTime 19ms CodeModel.GetById 11ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/test/language/simplify/test_simplify06.e

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