[FIR2IR] Introduce & use FirBuiltInsPackageFragment

Without this commit, JVM name mapping logic in BE does not work for FIR,
because FIR cannot use old BuiltInsPackageFragmentImpl descriptor.
In this commit we add our own implementation thus fixing
a pack of FIR black box tests.
This commit is contained in:
Mikhail Glukhikh
2020-03-20 13:10:21 +03:00
parent 01558f48ae
commit a4c7619c89
79 changed files with 55 additions and 85 deletions
@@ -71,6 +71,18 @@ public class GenerateRangesCodegenTestData {
private static final Map<String, String> ELEMENT_TYPE_KNOWN_SUBSTRINGS = new HashMap<>();
private static final Map<String, String> MIN_MAX_CONSTANTS = new LinkedHashMap<>();
private static final List<String> FIR_PASSING_LITERAL_TESTS =
Arrays.asList("emptyDownto", "emptyRange", "oneElementDownTo", "oneElementRange", "openRange",
"reversedBackSequence", "reversedEmptyBackSequence", "reversedEmptyRange",
"reversedRange", "simpleDownTo", "simpleRange", "simpleRangeWithNonConstantEnds");
private static final List<String> FIR_PASSING_EXPRESSION_TESTS =
Arrays.asList("emptyDownto", "emptyRange", "inexactSteppedDownTo", "inexactSteppedRange",
"oneElementDownTo", "oneElementRange", "openRange",
"reversedBackSequence", "reversedEmptyBackSequence", "reversedEmptyRange",
"reversedInexactSteppedDownTo", "reversedRange", "reversedSimpleSteppedRange",
"simpleDownTo", "simpleRange", "simpleRangeWithNonConstantEnds",
"simpleSteppedDownTo", "simpleSteppedRange");
static {
for (String integerType : INTEGER_PRIMITIVES) {
String suffix = integerType.substring(0, integerType.startsWith("U") ? 2 : 1);
@@ -227,11 +239,8 @@ public class GenerateRangesCodegenTestData {
}
String fileName = testFunName + ".kt";
boolean useFrontendIR =
testFunName.equals("emptyDownto") || testFunName.equals("emptyRange") ||
testFunName.equals("reversedEmptyRange") || testFunName.equals("reversedEmptyBackSequence");
writeToFile(new File(AS_LITERAL_DIR, fileName), asLiteralBody.toString(), false, !useFrontendIR);
writeToFile(new File(AS_EXPRESSION_DIR, fileName), asExpressionBody.toString(), false, !useFrontendIR);
writeToFile(new File(AS_LITERAL_DIR, fileName), asLiteralBody.toString(), false, !FIR_PASSING_LITERAL_TESTS.contains(testFunName));
writeToFile(new File(AS_EXPRESSION_DIR, fileName), asExpressionBody.toString(), false, !FIR_PASSING_EXPRESSION_TESTS.contains(testFunName));
writeToFile(new File(UNSIGNED_AS_LITERAL_DIR, fileName), unsignedAsLiteralBody.toString(), true, true);
writeToFile(new File(UNSIGNED_AS_EXPRESSION_DIR, fileName), unsignedAsExpressionBody.toString(), true, true);
}