Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/ImportGuardsTest.java @ 19283:08aa0372dad4
Truffle-DSL: implement new guard expression syntax.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Fri, 23 Jan 2015 02:55:23 +0100 |
parents | 2db61eddcb97 |
children | 259a416388d7 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/ImportGuardsTest.java Thu Jan 22 20:44:24 2015 +0100 +++ b/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/ImportGuardsTest.java Fri Jan 23 02:55:23 2015 +0100 @@ -36,7 +36,7 @@ @NodeChild("a") static class ImportGuards0 extends ValueNode { - @Specialization(guards = "staticGuard") + @Specialization(guards = "staticGuard(a)") int f0(int a) { return a; } @@ -46,26 +46,26 @@ @ImportGuards(Imports0.class) static class ImportGuards1 extends ValueNode { - @ExpectError("No compatible guard with method name 'nonStaticGuard' found.") - @Specialization(guards = "nonStaticGuard") + @ExpectError("Error parsing expression 'nonStaticGuard(a)': The method nonStaticGuard is undefined for the enclosing scope.") + @Specialization(guards = "nonStaticGuard(a)") int f1(int a) { return a; } - @ExpectError("No compatible guard with method name 'protectedGuard' found.") - @Specialization(guards = "protectedGuard") + @ExpectError("Error parsing expression 'protectedGuard(a)': The method protectedGuard is undefined for the enclosing scope.") + @Specialization(guards = "protectedGuard(a)") int f2(int a) { return a; } - @ExpectError("No compatible guard with method name 'packageGuard' found.") - @Specialization(guards = "packageGuard") + @ExpectError("Error parsing expression 'packageGuard(a)': The method packageGuard is undefined for the enclosing scope.") + @Specialization(guards = "packageGuard(a)") int f3(int a) { return a; } - @ExpectError("No compatible guard with method name 'privateGuard' found.") - @Specialization(guards = "privateGuard") + @ExpectError("Error parsing expression 'privateGuard(a)': The method privateGuard is undefined for the enclosing scope.") + @Specialization(guards = "privateGuard(a)") int f4(int a) { return a; } @@ -159,7 +159,7 @@ return a == 1; } - @Specialization(guards = "staticGuard") + @Specialization(guards = "staticGuard(a)") int f0(int a) { return a; }