Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.api.codegen.test/src/com/oracle/truffle/api/codegen/test/BinaryNodeTest.java @ 9223:5f7f0d3e3638
Updated codegen tests to new codegen API.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Sat, 20 Apr 2013 12:17:47 +0200 |
parents | 119a20bb3b1d |
children | e27f125147d6 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api.codegen.test/src/com/oracle/truffle/api/codegen/test/BinaryNodeTest.java Sat Apr 20 12:17:27 2013 +0200 +++ b/graal/com.oracle.truffle.api.codegen.test/src/com/oracle/truffle/api/codegen/test/BinaryNodeTest.java Sat Apr 20 12:17:47 2013 +0200 @@ -22,6 +22,9 @@ */ package com.oracle.truffle.api.codegen.test; +import static com.oracle.truffle.api.codegen.test.TestHelper.*; +import static junit.framework.Assert.*; + import org.junit.*; import com.oracle.truffle.api.codegen.*; @@ -29,9 +32,6 @@ import com.oracle.truffle.api.codegen.test.TypeSystemTest.TestRootNode; import com.oracle.truffle.api.codegen.test.TypeSystemTest.ValueNode; -import static junit.framework.Assert.*; -import static com.oracle.truffle.api.codegen.test.TestHelper.*; - public class BinaryNodeTest { @Test @@ -49,31 +49,13 @@ executeWith(node, new Object(), new Object()); } + @NodeChildren({@NodeChild("leftNode"), @NodeChild("rightNode")}) abstract static class BinaryNode extends ValueNode { - @Child protected ValueNode leftNode; - @Child protected ValueNode rightNode; - - public BinaryNode(ValueNode left, ValueNode right) { - this.leftNode = adoptChild(left); - this.rightNode = adoptChild(right); - } - - public BinaryNode(BinaryNode prev) { - this(prev.leftNode, prev.rightNode); - } } abstract static class AddNode extends BinaryNode { - public AddNode(ValueNode left, ValueNode right) { - super(left, right); - } - - public AddNode(AddNode prev) { - super(prev); - } - @Specialization int add(int left, int right) { return left + right;