Mercurial > hg > truffle
diff graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/TypeSystemTest.java @ 18221:2c68474cc893
Truffle: add a test to track an ImplicitCast bug
author | Benoit Daloze <benoit.daloze@jku.at> |
---|---|
date | Fri, 31 Oct 2014 10:44:05 +0100 |
parents | c5db657d93c1 |
children | 59953a46c56f |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/TypeSystemTest.java Thu Oct 30 17:04:16 2014 +0100 +++ b/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/TypeSystemTest.java Fri Oct 31 10:44:05 2014 +0100 @@ -32,7 +32,7 @@ public class TypeSystemTest { - @TypeSystem({int.class, double.class, boolean.class, BigInteger.class, String.class, CallTarget.class, BExtendsAbstract.class, CExtendsAbstract.class, Abstract.class, Interface.class, + @TypeSystem({int.class, long.class, double.class, boolean.class, BigInteger.class, String.class, CallTarget.class, BExtendsAbstract.class, CExtendsAbstract.class, Abstract.class, Interface.class, Object[].class}) static class SimpleTypes { @@ -57,6 +57,11 @@ } @ImplicitCast + public long castLong(int value) { + return value; + } + + @ImplicitCast public BigInteger castBigInteger(int value) { return BigInteger.valueOf(value); } @@ -78,6 +83,10 @@ return SimpleTypesGen.SIMPLETYPES.expectInteger(execute(frame)); } + public long executeLong(VirtualFrame frame) throws UnexpectedResultException { + return SimpleTypesGen.SIMPLETYPES.expectLong(execute(frame)); + } + public String executeString(VirtualFrame frame) throws UnexpectedResultException { return SimpleTypesGen.SIMPLETYPES.expectString(execute(frame)); }