Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/CreateCastTest.java @ 13533:b466199f19e1
Truffle-DSL: fixed bug when using @CreateCast with children arrays.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Tue, 07 Jan 2014 20:16:01 +0100 |
parents | 1f870eaf1e96 |
children |
comparison
equal
deleted
inserted
replaced
13532:85b485b1e8e1 | 13533:b466199f19e1 |
---|---|
26 | 26 |
27 import com.oracle.truffle.api.dsl.*; | 27 import com.oracle.truffle.api.dsl.*; |
28 import com.oracle.truffle.api.dsl.test.CreateCastTestFactory.CreateCastNode1Factory; | 28 import com.oracle.truffle.api.dsl.test.CreateCastTestFactory.CreateCastNode1Factory; |
29 import com.oracle.truffle.api.dsl.test.CreateCastTestFactory.CreateCastNode2Factory; | 29 import com.oracle.truffle.api.dsl.test.CreateCastTestFactory.CreateCastNode2Factory; |
30 import com.oracle.truffle.api.dsl.test.CreateCastTestFactory.CreateCastNode3Factory; | 30 import com.oracle.truffle.api.dsl.test.CreateCastTestFactory.CreateCastNode3Factory; |
31 import com.oracle.truffle.api.dsl.test.TypeSystemTest.ChildrenNode; | |
31 import com.oracle.truffle.api.dsl.test.TypeSystemTest.TestRootNode; | 32 import com.oracle.truffle.api.dsl.test.TypeSystemTest.TestRootNode; |
32 import com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode; | 33 import com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode; |
33 import com.oracle.truffle.api.nodes.*; | 34 import com.oracle.truffle.api.nodes.*; |
34 | 35 |
35 @SuppressWarnings("unused") | 36 @SuppressWarnings("unused") |
85 public int doInteger(int a, int b) { | 86 public int doInteger(int a, int b) { |
86 throw new AssertionError(); | 87 throw new AssertionError(); |
87 } | 88 } |
88 } | 89 } |
89 | 90 |
90 @NodeChild(value = "a", type = ValueNode[].class) | 91 abstract static class CreateCastNode3 extends ChildrenNode { |
91 abstract static class CreateCastNode3 extends ValueNode { | |
92 | 92 |
93 int invocations = 0; | 93 int invocations = 0; |
94 | 94 |
95 @CreateCast("a") | 95 @CreateCast("children") |
96 public ValueNode[] createCast(ValueNode[] node) { | 96 public ValueNode[] createCast(ValueNode[] node) { |
97 invocations++; | 97 invocations++; |
98 return node; | 98 return node; |
99 } | 99 } |
100 | 100 |