annotate graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/ReachabilityTest.java @ 16763:e6d15134ca86

Truffle-DSL: fixed formatting problems.
author Christian Humer <christian.humer@gmail.com>
date Mon, 11 Aug 2014 16:21:54 +0200
parents 5148aab962af
children 90984ae0eaa8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16763
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
1 package com.oracle.truffle.api.dsl.test;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
2
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
3 import java.math.*;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
4
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
5 import com.oracle.truffle.api.dsl.*;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
6 import com.oracle.truffle.api.dsl.test.TypeSystemTest.*;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
7
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
8 public class ReachabilityTest {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
9
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
10 static class Reachability1 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
11 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
12 int do2() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
13 return 2;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
14 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
15
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
16 @ExpectError("Specialization is not reachable. It is shadowed by do2().")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
17 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
18 int do1() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
19 return 2;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
20 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
21 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
22
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
23 @NodeChildren({@NodeChild("a")})
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
24 static class ReachabilityType1 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
25 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
26 int do2(int a) {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
27 return a;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
28 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
29
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
30 @ExpectError("Specialization is not reachable. It is shadowed by do2(int).")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
31 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
32 int do1(int a) {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
33 return a;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
34 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
35 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
36
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
37 @NodeChildren({@NodeChild("a")})
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
38 static class ReachabilityType2 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
39 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
40 BExtendsAbstract do2(BExtendsAbstract a) {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
41 return a;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
42 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
43
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
44 @ExpectError("Specialization is not reachable. It is shadowed by do2(BExtendsAbstract).")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
45 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
46 BExtendsAbstract do1(BExtendsAbstract a) {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
47 return a;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
48 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
49 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
50
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
51 @NodeChildren({@NodeChild("a")})
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
52 static class ReachabilityType3 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
53 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
54 Abstract do2(Abstract a) {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
55 return a;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
56 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
57
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
58 @ExpectError("Specialization is not reachable. It is shadowed by do2(Abstract).")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
59 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
60 BExtendsAbstract do1(BExtendsAbstract a) {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
61 return a;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
62 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
63 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
64
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
65 @NodeChildren({@NodeChild("a")})
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
66 static class ReachabilityType4 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
67
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
68 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
69 BExtendsAbstract do2(BExtendsAbstract a) {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
70 return a;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
71 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
72
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
73 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
74 Abstract do1(Abstract a) {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
75 return a;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
76 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
77
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
78 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
79
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
80 @NodeChildren({@NodeChild("a")})
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
81 static class ReachabilityType5 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
82
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
83 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
84 double do2(double a) {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
85 return a;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
86 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
87
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
88 @ExpectError("Specialization is not reachable. It is shadowed by do2(double).")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
89 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
90 int do1(int a) {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
91 return a;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
92 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
93
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
94 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
95
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
96 @NodeChildren({@NodeChild("a")})
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
97 static class ReachabilityType6 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
98
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
99 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
100 BigInteger do2(BigInteger a) {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
101 return a;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
102 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
103
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
104 @ExpectError("Specialization is not reachable. It is shadowed by do2(BigInteger).")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
105 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
106 int do1(int a) {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
107 return a;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
108 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
109
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
110 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
111
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
112 @NodeChildren({@NodeChild("a")})
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
113 static class ReachabilityType7 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
114
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
115 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
116 int do2(int a) {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
117 return a;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
118 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
119
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
120 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
121 BigInteger do1(BigInteger a) {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
122 return a;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
123 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
124
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
125 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
126
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
127 @NodeChildren({@NodeChild("a")})
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
128 static class ReachabilityType8 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
129
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
130 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
131 int do2(int a) {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
132 return a;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
133 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
134
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
135 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
136 Object do1(Object a) {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
137 return a;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
138 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
139
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
140 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
141
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
142 @NodeChildren({@NodeChild("a")})
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
143 static class ReachabilityType9 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
144
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
145 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
146 Object do2(Object a) {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
147 return a;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
148 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
149
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
150 @ExpectError("Specialization is not reachable. It is shadowed by do2(Object).")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
151 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
152 int do1(int a) {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
153 return a;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
154 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
155 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
156
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
157 static class ReachabilityGuard1 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
158
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
159 boolean foo() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
160 return false;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
161 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
162
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
163 @Specialization(guards = "foo")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
164 int do2() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
165 return 1;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
166 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
167
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
168 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
169 int do1() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
170 return 2;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
171 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
172
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
173 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
174
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
175 static class ReachabilityGuard2 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
176
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
177 boolean foo() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
178 return false;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
179 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
180
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
181 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
182 int do2() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
183 return 2;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
184 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
185
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
186 @ExpectError("Specialization is not reachable. It is shadowed by do2().")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
187 @Specialization(guards = "foo")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
188 int do1() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
189 return 1;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
190 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
191
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
192 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
193
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
194 static class ReachabilityGuard3 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
195
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
196 boolean foo() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
197 return false;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
198 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
199
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
200 @Specialization(guards = "foo")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
201 int do2() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
202 return 1;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
203 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
204
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
205 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
206 int do1() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
207 return 2;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
208 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
209
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
210 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
211
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
212 static class ReachabilityGuard4 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
213
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
214 boolean foo() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
215 return false;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
216 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
217
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
218 @Specialization(guards = "foo")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
219 int do2() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
220 return 1;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
221 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
222
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
223 @ExpectError("Specialization is not reachable. It is shadowed by do2().")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
224 @Specialization(guards = "foo")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
225 int do1() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
226 return 2;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
227 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
228
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
229 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
230
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
231 @NodeAssumptions({"a1"})
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
232 static class ReachabilityAssumption1 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
233
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
234 @Specialization(assumptions = "a1")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
235 int do2() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
236 return 1;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
237 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
238
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
239 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
240 int do1() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
241 return 2;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
242 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
243
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
244 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
245
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
246 @NodeAssumptions({"a1"})
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
247 static class ReachabilityAssumption2 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
248
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
249 @Specialization(assumptions = "a1")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
250 int do2() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
251 return 1;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
252 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
253
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
254 @ExpectError("Specialization is not reachable. It is shadowed by do2().")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
255 @Specialization(assumptions = "a1")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
256 int do1() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
257 return 2;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
258 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
259
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
260 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
261
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
262 @NodeAssumptions({"a1", "a2"})
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
263 static class ReachabilityAssumption3 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
264
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
265 @Specialization(assumptions = {"a1", "a2"})
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
266 int do2() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
267 return 1;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
268 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
269
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
270 @Specialization(assumptions = "a1")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
271 int do1() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
272 return 2;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
273 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
274
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
275 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
276
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
277 @NodeAssumptions({"a1", "a2"})
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
278 static class ReachabilityAssumption4 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
279
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
280 @Specialization(assumptions = "a1")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
281 int do2() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
282 return 1;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
283 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
284
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
285 @Specialization(assumptions = "a2")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
286 int do1() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
287 return 2;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
288 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
289
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
290 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
291
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
292 @NodeAssumptions({"a1", "a2"})
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
293 static class ReachabilityAssumption5 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
294
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
295 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
296 int do2() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
297 return 1;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
298 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
299
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
300 @ExpectError("Specialization is not reachable. It is shadowed by do2().")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
301 @Specialization(assumptions = "a2")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
302 int do1() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
303 return 2;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
304 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
305
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
306 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
307
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
308 @NodeAssumptions({"a1", "a2"})
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
309 static class ReachabilityAssumption6 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
310
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
311 @Specialization(assumptions = {"a1"})
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
312 int do2() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
313 return 1;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
314 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
315
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
316 @ExpectError("Specialization is not reachable. It is shadowed by do2().")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
317 @Specialization(assumptions = {"a1", "a2"})
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
318 int do1() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
319 return 2;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
320 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
321
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
322 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
323
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
324 static class ReachabilityThrowable1 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
325
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
326 @Specialization(rewriteOn = RuntimeException.class)
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
327 int do2() throws RuntimeException {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
328 return 1;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
329 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
330
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
331 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
332 int do1() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
333 return 2;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
334 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
335
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
336 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
337
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
338 static class ReachabilityThrowable2 extends ValueNode {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
339
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
340 @Specialization
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
341 int do2() {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
342 return 1;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
343 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
344
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
345 @ExpectError("Specialization is not reachable. It is shadowed by do2().")
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
346 @Specialization(rewriteOn = RuntimeException.class)
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
347 int do1() throws RuntimeException {
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
348 return 2;
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
349 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
350
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
351 }
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
352
e6d15134ca86 Truffle-DSL: fixed formatting problems.
Christian Humer <christian.humer@gmail.com>
parents: 16756
diff changeset
353 }