update NOTICE and LICENSE
[nit.git] / tests / icode_ireg.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Copyright 2010 Jean Privat <jean@pryen.org>
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16
17 import kernel
18
19 fun maybe: Bool do return true
20
21 fun foo
22 do
23 var a: Object
24 var b: Object
25 var c: Object
26 var d: Object
27 var e: Object
28 var f: Object
29 var g: Object
30 var h: Object
31 var i: Object
32 var j: Object
33 var k: Object
34 c = 5 #R1
35 b = 2 #R2
36 a = 1 #R3
37 var out = not maybe
38 loop
39 a.output #Deferred free R3
40 f = 4 #R4
41 e = 6 #R5
42 d = 3 #R6
43 if maybe and out then break
44 out = maybe
45 end #Free a(R3)
46 b.output #Free R2
47 d.output #Free R6
48 g = 6 #R2
49 out = not maybe
50 loop
51 loop
52 f.output #Deferred free
53 if maybe then break
54 end
55 h = 7 #R3
56 if maybe and out then break
57 out = maybe
58 end #Free f(R4)
59 i = 8 #R4
60 j = 9 #R6
61 k = 10 #R7
62 c.output #Free R1
63 e.output #Free R5
64 g.output #Free R2
65 h.output #Free R3
66 i.output #Free R4
67 j.output #Free R6
68 k.output #Free R7
69 end
70
71 foo