blob: f1c41021cd16e3cabc44047e4d98d3365849137e [file] [log] [blame]
# Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE.md file.
# Compile an application with modules compiled as outlines with constants.
# When compiling the "real" library (as non-outline) constant evaluation
# goes into more modules than in just the outline version.
type: newworld
# Set to DDC for compiling modules as outline.
target: DDC
modules:
moduleC:
moduleC/lib.dart: |
// @dart=2.9
const constC = true;
moduleC/.dart_tool/package_config.json: |
{
"configVersion": 2,
"packages": [
{
"name": "moduleC",
"rootUri": ".."
}
]
}
moduleB:
moduleB/lib.dart: |
// @dart=2.9
import "package:moduleC/lib.dart";
const constB = false || constC;
moduleB/.dart_tool/package_config.json: |
{
"configVersion": 2,
"packages": [
{
"name": "moduleB",
"rootUri": ".."
},
{
"name": "moduleC",
"rootUri": "../../moduleC"
}
]
}
worlds:
- entry: main.dart
fromComponent: true
sources:
main.dart: |
import 'package:moduleB/lib.dart';
const constA = true && constB;
.dart_tool/package_config.json: |
{
"configVersion": 2,
"packages": [
{
"name": "moduleB",
"rootUri": "../moduleB"
},
{
"name": "moduleC",
"rootUri": "../moduleC"
}
]
}
modules:
- moduleB
- moduleC
expectedLibraryCount: 3
neededDillLibraries:
# Because the modules are complied as outlines they haven't had constants
# evaluated. As this is fully compiled it does evaluate constants and thus
# goes into both B and C.
- package:moduleB/lib.dart
- package:moduleC/lib.dart
expectedContent:
org-dartlang-test:///main.dart:
- Field constA
package:moduleB/lib.dart:
- Field constB
package:moduleC/lib.dart:
- Field constC