Mercurial > hg > truffle
annotate truffle/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/InsertBeforeTest.java @ 22157:dc83cc1f94f2
Using fully qualified imports
author | Jaroslav Tulach <jaroslav.tulach@oracle.com> |
---|---|
date | Wed, 16 Sep 2015 11:33:22 +0200 |
parents | 9c8c0937da41 |
children |
rev | line source |
---|---|
16756
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
1 /* |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved. |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
4 * |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
8 * |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
13 * accompanied this code). |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
14 * |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
18 * |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
21 * questions. |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
22 */ |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
23 package com.oracle.truffle.api.dsl.test; |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
24 |
22157
dc83cc1f94f2
Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
25 import com.oracle.truffle.api.dsl.NodeChild; |
dc83cc1f94f2
Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
26 import com.oracle.truffle.api.dsl.Specialization; |
16756
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
27 import com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode; |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
28 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
29 public class InsertBeforeTest { |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
30 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
31 @NodeChild("a") |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
32 static class InsertBefore1Base extends ValueNode { |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
33 |
19283
08aa0372dad4
Truffle-DSL: implement new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents:
18163
diff
changeset
|
34 @Specialization(guards = "a == 1") |
16756
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
35 int f1(int a) { |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
36 return a; |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
37 } |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
38 |
19283
08aa0372dad4
Truffle-DSL: implement new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents:
18163
diff
changeset
|
39 @Specialization(guards = "a == 2") |
16756
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
40 int f3(int a) { |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
41 return a; |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
42 } |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
43 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
44 } |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
45 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
46 @NodeChild("a") |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
47 static class InsertBefore1T1 extends InsertBefore1Base { |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
48 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
49 @Specialization |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
50 int f0(int a) { |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
51 return a; |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
52 } |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
53 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
54 } |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
55 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
56 @NodeChild("a") |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
57 static class InsertBefore1T2 extends InsertBefore1Base { |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
58 |
19283
08aa0372dad4
Truffle-DSL: implement new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents:
18163
diff
changeset
|
59 @Specialization(guards = "a == 0", insertBefore = "f1") |
16756
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
60 int f0(int a) { |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
61 return a; |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
62 } |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
63 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
64 } |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
65 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
66 @NodeChild("a") |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
67 static class InsertBefore1T3 extends InsertBefore1Base { |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
68 |
19283
08aa0372dad4
Truffle-DSL: implement new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents:
18163
diff
changeset
|
69 @Specialization(guards = "a == 0", insertBefore = "f3") |
16756
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
70 int f0(int a) { |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
71 return a; |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
72 } |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
73 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
74 } |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
75 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
76 @NodeChild("a") |
16765
89f635cbd85e
Truffle-DSL: fixed assertions on unspecified toString methods of the annotation processing API.
Christian Humer <christian.humer@gmail.com>
parents:
16764
diff
changeset
|
77 @ExpectError({"Method f3(int) at annotation @Specialization is erroneous: Specialization is not reachable. It is shadowed by f0(int).", |
89f635cbd85e
Truffle-DSL: fixed assertions on unspecified toString methods of the annotation processing API.
Christian Humer <christian.humer@gmail.com>
parents:
16764
diff
changeset
|
78 "Method f1(int) at annotation @Specialization is erroneous: Specialization is not reachable. It is shadowed by f0(int)."}) |
16756
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
79 static class InsertBefore1T4 extends InsertBefore1Base { |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
80 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
81 @Specialization(insertBefore = "f1") |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
82 int f0(int a) { |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
83 return a; |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
84 } |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
85 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
86 } |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
87 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
88 @NodeChild("a") |
16765
89f635cbd85e
Truffle-DSL: fixed assertions on unspecified toString methods of the annotation processing API.
Christian Humer <christian.humer@gmail.com>
parents:
16764
diff
changeset
|
89 @ExpectError({"Method f3(int) at annotation @Specialization is erroneous: Specialization is not reachable. It is shadowed by f0(int)."}) |
16756
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
90 static class InsertBefore1T5 extends InsertBefore1Base { |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
91 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
92 boolean g0(int a) { |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
93 return a == 0; |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
94 } |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
95 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
96 @Specialization(insertBefore = "f3") |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
97 int f0(int a) { |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
98 return a; |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
99 } |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
100 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
101 } |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
102 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
103 @NodeChild("a") |
18163
c88ab4f1f04a
re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents:
16765
diff
changeset
|
104 static class InsertBefore1T6part1 extends InsertBefore1Base { |
16764
f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
Christian Humer <christian.humer@gmail.com>
parents:
16756
diff
changeset
|
105 |
f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
Christian Humer <christian.humer@gmail.com>
parents:
16756
diff
changeset
|
106 boolean g0(int a) { |
f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
Christian Humer <christian.humer@gmail.com>
parents:
16756
diff
changeset
|
107 return a == 0; |
f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
Christian Humer <christian.humer@gmail.com>
parents:
16756
diff
changeset
|
108 } |
f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
Christian Humer <christian.humer@gmail.com>
parents:
16756
diff
changeset
|
109 |
19283
08aa0372dad4
Truffle-DSL: implement new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents:
18163
diff
changeset
|
110 @Specialization(insertBefore = "f1", guards = "a == 0") |
16764
f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
Christian Humer <christian.humer@gmail.com>
parents:
16756
diff
changeset
|
111 int f0(int a) { |
f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
Christian Humer <christian.humer@gmail.com>
parents:
16756
diff
changeset
|
112 return a; |
f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
Christian Humer <christian.humer@gmail.com>
parents:
16756
diff
changeset
|
113 } |
f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
Christian Humer <christian.humer@gmail.com>
parents:
16756
diff
changeset
|
114 |
f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
Christian Humer <christian.humer@gmail.com>
parents:
16756
diff
changeset
|
115 } |
f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
Christian Humer <christian.humer@gmail.com>
parents:
16756
diff
changeset
|
116 |
f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
Christian Humer <christian.humer@gmail.com>
parents:
16756
diff
changeset
|
117 @NodeChild("a") |
18163
c88ab4f1f04a
re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents:
16765
diff
changeset
|
118 static class InsertBefore1T6part2 extends InsertBefore1T6part1 { |
16764
f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
Christian Humer <christian.humer@gmail.com>
parents:
16756
diff
changeset
|
119 |
19283
08aa0372dad4
Truffle-DSL: implement new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents:
18163
diff
changeset
|
120 @Specialization(insertBefore = "f0", guards = "a == 3") |
16764
f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
Christian Humer <christian.humer@gmail.com>
parents:
16756
diff
changeset
|
121 int f(int a) { |
f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
Christian Humer <christian.humer@gmail.com>
parents:
16756
diff
changeset
|
122 return a; |
f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
Christian Humer <christian.humer@gmail.com>
parents:
16756
diff
changeset
|
123 } |
f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
Christian Humer <christian.humer@gmail.com>
parents:
16756
diff
changeset
|
124 |
f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
Christian Humer <christian.humer@gmail.com>
parents:
16756
diff
changeset
|
125 } |
f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
Christian Humer <christian.humer@gmail.com>
parents:
16756
diff
changeset
|
126 |
f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
Christian Humer <christian.humer@gmail.com>
parents:
16756
diff
changeset
|
127 @NodeChild("a") |
16756
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
128 static class InsertBefore1Error1 extends InsertBefore1Base { |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
129 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
130 @ExpectError("Specializations can only be inserted before specializations in superclasses.") |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
131 @Specialization(insertBefore = "f0") |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
132 int f0(int a) { |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
133 return a; |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
134 } |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
135 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
136 } |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
137 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
138 @NodeChild("a") |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
139 static class InsertBefore1Error2 extends InsertBefore1Base { |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
140 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
141 @ExpectError("The referenced specialization 'asdf' could not be found.") |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
142 @Specialization(insertBefore = "asdf") |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
143 int f0(int a) { |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
144 return a; |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
145 } |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
146 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
147 } |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
148 |
5148aab962af
Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
149 } |