Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/ReachabilityTest.java @ 19283:08aa0372dad4
Truffle-DSL: implement new guard expression syntax.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Fri, 23 Jan 2015 02:55:23 +0100 |
parents | 90984ae0eaa8 |
children | f4792a544170 |
comparison
equal
deleted
inserted
replaced
19282:ae81dd154fb6 | 19283:08aa0372dad4 |
---|---|
180 | 180 |
181 boolean foo() { | 181 boolean foo() { |
182 return false; | 182 return false; |
183 } | 183 } |
184 | 184 |
185 @Specialization(guards = "foo") | 185 @Specialization(guards = "foo()") |
186 int do2() { | 186 int do2() { |
187 return 1; | 187 return 1; |
188 } | 188 } |
189 | 189 |
190 @Specialization | 190 @Specialization |
204 int do2() { | 204 int do2() { |
205 return 2; | 205 return 2; |
206 } | 206 } |
207 | 207 |
208 @ExpectError("Specialization is not reachable. It is shadowed by do2().") | 208 @ExpectError("Specialization is not reachable. It is shadowed by do2().") |
209 @Specialization(guards = "foo") | 209 @Specialization(guards = "foo()") |
210 int do1() { | 210 int do1() { |
211 return 1; | 211 return 1; |
212 } | 212 } |
213 | 213 |
214 } | 214 } |
217 | 217 |
218 boolean foo() { | 218 boolean foo() { |
219 return false; | 219 return false; |
220 } | 220 } |
221 | 221 |
222 @Specialization(guards = "foo") | 222 @Specialization(guards = "foo()") |
223 int do2() { | 223 int do2() { |
224 return 1; | 224 return 1; |
225 } | 225 } |
226 | 226 |
227 @Specialization | 227 @Specialization |
235 | 235 |
236 boolean foo() { | 236 boolean foo() { |
237 return false; | 237 return false; |
238 } | 238 } |
239 | 239 |
240 @Specialization(guards = "foo") | 240 @Specialization(guards = "foo()") |
241 int do2() { | 241 int do2() { |
242 return 1; | 242 return 1; |
243 } | 243 } |
244 | 244 |
245 @ExpectError("Specialization is not reachable. It is shadowed by do2().") | 245 @ExpectError("Specialization is not reachable. It is shadowed by do2().") |
246 @Specialization(guards = "foo") | 246 @Specialization(guards = "foo()") |
247 int do1() { | 247 int do1() { |
248 return 2; | 248 return 2; |
249 } | 249 } |
250 | 250 |
251 } | 251 } |