Mercurial > hg > graal-compiler
view graal/com.oracle.graal.truffle.test/src/sl/TestIsCompilationConstant1.sl @ 22721:2d6bcedb5058
Allow OperandMode.TEMP to be STACK; do not reuse VirtualStackSlot for temp slots on SPARC
author | Stefan Anzinger <stefan.anzinger@oracle.com> |
---|---|
date | Tue, 29 Sep 2015 16:01:13 +0200 |
parents | bba4e91a2d63 |
children |
line wrap: on
line source
function testConstantValue1() { return isCompilationConstant(42); } function testConstantValue2() { return isCompilationConstant(21 + 21); } function testConstantSequence() { 40; return isCompilationConstant(42); } function testConstantLocalVariable() { x = 42; return isCompilationConstant(x); } function testNonConstantAdd() { return isCompilationConstant(42 + "42"); } function main() { callFunctionsWith("testConstant", harnessTrue); callFunctionsWith("testNonConstant", harnessFalse); } function harnessTrue(testFunction) { callUntilOptimized(testFunction); assertTrue(testFunction(), "test function " + testFunction + " is not constant"); } function harnessFalse(testFunction) { callUntilOptimized(testFunction); assertFalse(testFunction(), "test function " + testFunction + " is constant"); }