Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/ExecuteEvaluatedTest.java @ 13273:17b116b80aba
Truffle-DSL: added another test case for generating execute methods with varargs.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 02 Dec 2013 11:48:40 +0100 |
parents | 0b8335a4fb13 |
children | 64dcb92ee75a |
comparison
equal
deleted
inserted
replaced
13272:0b8335a4fb13 | 13273:17b116b80aba |
---|---|
32 import com.oracle.truffle.api.dsl.test.ExecuteEvaluatedTestFactory.TestEvaluatedVarArgs0Factory; | 32 import com.oracle.truffle.api.dsl.test.ExecuteEvaluatedTestFactory.TestEvaluatedVarArgs0Factory; |
33 import com.oracle.truffle.api.dsl.test.ExecuteEvaluatedTestFactory.TestEvaluatedVarArgs1Factory; | 33 import com.oracle.truffle.api.dsl.test.ExecuteEvaluatedTestFactory.TestEvaluatedVarArgs1Factory; |
34 import com.oracle.truffle.api.dsl.test.ExecuteEvaluatedTestFactory.TestEvaluatedVarArgs2Factory; | 34 import com.oracle.truffle.api.dsl.test.ExecuteEvaluatedTestFactory.TestEvaluatedVarArgs2Factory; |
35 import com.oracle.truffle.api.dsl.test.ExecuteEvaluatedTestFactory.TestEvaluatedVarArgs3Factory; | 35 import com.oracle.truffle.api.dsl.test.ExecuteEvaluatedTestFactory.TestEvaluatedVarArgs3Factory; |
36 import com.oracle.truffle.api.dsl.test.ExecuteEvaluatedTestFactory.TestEvaluatedVarArgs4Factory; | 36 import com.oracle.truffle.api.dsl.test.ExecuteEvaluatedTestFactory.TestEvaluatedVarArgs4Factory; |
37 import com.oracle.truffle.api.dsl.test.ExecuteEvaluatedTestFactory.TestEvaluatedVarArgs5Factory; | |
37 import com.oracle.truffle.api.dsl.test.ExecuteEvaluatedTestFactory.UseDoubleEvaluatedNodeFactory; | 38 import com.oracle.truffle.api.dsl.test.ExecuteEvaluatedTestFactory.UseDoubleEvaluatedNodeFactory; |
38 import com.oracle.truffle.api.dsl.test.ExecuteEvaluatedTestFactory.UseEvaluatedNodeFactory; | 39 import com.oracle.truffle.api.dsl.test.ExecuteEvaluatedTestFactory.UseEvaluatedNodeFactory; |
39 import com.oracle.truffle.api.dsl.test.TypeSystemTest.ArgumentNode; | 40 import com.oracle.truffle.api.dsl.test.TypeSystemTest.ArgumentNode; |
40 import com.oracle.truffle.api.dsl.test.TypeSystemTest.ChildrenNode; | 41 import com.oracle.truffle.api.dsl.test.TypeSystemTest.ChildrenNode; |
41 import com.oracle.truffle.api.dsl.test.TypeSystemTest.TestArguments; | 42 import com.oracle.truffle.api.dsl.test.TypeSystemTest.TestArguments; |
237 int call(int exp0, int exp1) { | 238 int call(int exp0, int exp1) { |
238 return exp0 + exp1; | 239 return exp0 + exp1; |
239 } | 240 } |
240 } | 241 } |
241 | 242 |
243 @Test | |
244 public void test5VarArgs1() { | |
245 TestRootNode<TestEvaluatedVarArgs5> root = TestHelper.createRoot(TestEvaluatedVarArgs5Factory.getInstance()); | |
246 Assert.assertEquals(42, root.getNode().execute1(null)); | |
247 } | |
248 | |
249 abstract static class TestEvaluatedVarArgs5 extends ValueNode { | |
250 | |
251 public abstract Object execute1(VirtualFrame frame, Object... value); | |
252 | |
253 @Specialization | |
254 int call() { | |
255 return 42; | |
256 } | |
257 } | |
258 | |
242 } | 259 } |