Mercurial > hg > truffle
diff graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/InsertBeforeTest.java @ 16764:f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 11 Aug 2014 16:37:40 +0200 |
parents | 5148aab962af |
children | 89f635cbd85e |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/InsertBeforeTest.java Mon Aug 11 16:21:54 2014 +0200 +++ b/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/InsertBeforeTest.java Mon Aug 11 16:37:40 2014 +0200 @@ -120,6 +120,34 @@ } @NodeChild("a") + static class InsertBefore1T6_1 extends InsertBefore1Base { + + boolean g0(int a) { + return a == 0; + } + + @Specialization(insertBefore = "f1", guards = "g0") + int f0(int a) { + return a; + } + + } + + @NodeChild("a") + static class InsertBefore1T6_2 extends InsertBefore1T6_1 { + + boolean g(int a) { + return a == 0; + } + + @Specialization(insertBefore = "f0", guards = "g") + int f(int a) { + return a; + } + + } + + @NodeChild("a") static class InsertBefore1Error1 extends InsertBefore1Base { @ExpectError("Specializations can only be inserted before specializations in superclasses.")