Detecting tail calls through CFA

This commit is contained in:
Andrey Breslav
2013-12-06 00:00:01 +04:00
parent 9f319e8b24
commit 97319808b6
16 changed files with 483 additions and 7 deletions
@@ -31,7 +31,7 @@ import org.jetbrains.jet.cfg.AbstractControlFlowTest;
/** This class is generated by {@link org.jetbrains.jet.generators.tests.GenerateTests}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@TestMetadata("compiler/testData/cfg")
@InnerTestClasses({ControlFlowTestGenerated.DeadCode.class})
@InnerTestClasses({ControlFlowTestGenerated.DeadCode.class, ControlFlowTestGenerated.TailCalls.class})
public class ControlFlowTestGenerated extends AbstractControlFlowTest {
public void testAllFilesPresentInCfg() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/cfg"), Pattern.compile("^(.+)\\.kt$"), true);
@@ -245,10 +245,44 @@ public class ControlFlowTestGenerated extends AbstractControlFlowTest {
}
@TestMetadata("compiler/testData/cfg/tailCalls")
public static class TailCalls extends AbstractControlFlowTest {
public void testAllFilesPresentInTailCalls() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/cfg/tailCalls"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("finally.kt")
public void testFinally() throws Exception {
doTest("compiler/testData/cfg/tailCalls/finally.kt");
}
@TestMetadata("finallyWithReturn.kt")
public void testFinallyWithReturn() throws Exception {
doTest("compiler/testData/cfg/tailCalls/finallyWithReturn.kt");
}
@TestMetadata("sum.kt")
public void testSum() throws Exception {
doTest("compiler/testData/cfg/tailCalls/sum.kt");
}
@TestMetadata("try.kt")
public void testTry() throws Exception {
doTest("compiler/testData/cfg/tailCalls/try.kt");
}
@TestMetadata("tryCatchFinally.kt")
public void testTryCatchFinally() throws Exception {
doTest("compiler/testData/cfg/tailCalls/tryCatchFinally.kt");
}
}
public static Test suite() {
TestSuite suite = new TestSuite("ControlFlowTestGenerated");
suite.addTestSuite(ControlFlowTestGenerated.class);
suite.addTestSuite(DeadCode.class);
suite.addTestSuite(TailCalls.class);
return suite;
}
}