comparison graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/InsertBeforeTest.java @ 16764:f9fff060dc41

Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
author Christian Humer <christian.humer@gmail.com>
date Mon, 11 Aug 2014 16:37:40 +0200
parents 5148aab962af
children 89f635cbd85e
comparison
equal deleted inserted replaced
16763:e6d15134ca86 16764:f9fff060dc41
118 } 118 }
119 119
120 } 120 }
121 121
122 @NodeChild("a") 122 @NodeChild("a")
123 static class InsertBefore1T6_1 extends InsertBefore1Base {
124
125 boolean g0(int a) {
126 return a == 0;
127 }
128
129 @Specialization(insertBefore = "f1", guards = "g0")
130 int f0(int a) {
131 return a;
132 }
133
134 }
135
136 @NodeChild("a")
137 static class InsertBefore1T6_2 extends InsertBefore1T6_1 {
138
139 boolean g(int a) {
140 return a == 0;
141 }
142
143 @Specialization(insertBefore = "f0", guards = "g")
144 int f(int a) {
145 return a;
146 }
147
148 }
149
150 @NodeChild("a")
123 static class InsertBefore1Error1 extends InsertBefore1Base { 151 static class InsertBefore1Error1 extends InsertBefore1Base {
124 152
125 @ExpectError("Specializations can only be inserted before specializations in superclasses.") 153 @ExpectError("Specializations can only be inserted before specializations in superclasses.")
126 @Specialization(insertBefore = "f0") 154 @Specialization(insertBefore = "f0")
127 int f0(int a) { 155 int f0(int a) {