Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.api.codegen.test/src/com/oracle/truffle/api/codegen/test/TypeSystemTest.java @ 10594:72e6b178de16
Truffle-DSL: added a few missing types to the dsl tests.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 01 Jul 2013 20:29:08 +0200 |
parents | e162d9e32830 |
children |
comparison
equal
deleted
inserted
replaced
10593:447465567e6f | 10594:72e6b178de16 |
---|---|
22 */ | 22 */ |
23 package com.oracle.truffle.api.codegen.test; | 23 package com.oracle.truffle.api.codegen.test; |
24 | 24 |
25 import com.oracle.truffle.api.*; | 25 import com.oracle.truffle.api.*; |
26 import com.oracle.truffle.api.codegen.*; | 26 import com.oracle.truffle.api.codegen.*; |
27 import com.oracle.truffle.api.codegen.test.BuiltinTest.Str; | 27 import com.oracle.truffle.api.codegen.test.NodeContainerTest.Str; |
28 import com.oracle.truffle.api.frame.*; | 28 import com.oracle.truffle.api.frame.*; |
29 import com.oracle.truffle.api.nodes.*; | 29 import com.oracle.truffle.api.nodes.*; |
30 | 30 |
31 public class TypeSystemTest { | 31 public class TypeSystemTest { |
32 | 32 |
33 @TypeSystem({int.class, Str.class, CallTarget.class, Object[].class}) | 33 @TypeSystem({int.class, boolean.class, String.class, Str.class, CallTarget.class, Object[].class}) |
34 static class SimpleTypes { | 34 static class SimpleTypes { |
35 } | 35 } |
36 | 36 |
37 @TypeSystemReference(SimpleTypes.class) | 37 @TypeSystemReference(SimpleTypes.class) |
38 public abstract static class ValueNode extends Node { | 38 public abstract static class ValueNode extends Node { |
41 return SimpleTypesGen.SIMPLETYPES.expectInteger(execute(frame)); | 41 return SimpleTypesGen.SIMPLETYPES.expectInteger(execute(frame)); |
42 } | 42 } |
43 | 43 |
44 public Str executeStr(VirtualFrame frame) throws UnexpectedResultException { | 44 public Str executeStr(VirtualFrame frame) throws UnexpectedResultException { |
45 return SimpleTypesGen.SIMPLETYPES.expectStr(execute(frame)); | 45 return SimpleTypesGen.SIMPLETYPES.expectStr(execute(frame)); |
46 } | |
47 | |
48 public String executeString(VirtualFrame frame) throws UnexpectedResultException { | |
49 return SimpleTypesGen.SIMPLETYPES.expectString(execute(frame)); | |
50 } | |
51 | |
52 public boolean executeBoolean(VirtualFrame frame) throws UnexpectedResultException { | |
53 return SimpleTypesGen.SIMPLETYPES.expectBoolean(execute(frame)); | |
46 } | 54 } |
47 | 55 |
48 public Object[] executeIntArray(VirtualFrame frame) throws UnexpectedResultException { | 56 public Object[] executeIntArray(VirtualFrame frame) throws UnexpectedResultException { |
49 return SimpleTypesGen.SIMPLETYPES.expectObjectArray(execute(frame)); | 57 return SimpleTypesGen.SIMPLETYPES.expectObjectArray(execute(frame)); |
50 } | 58 } |