blob: d0753b84d79b133e5685fa29b27e9bc2f24bb6ea [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: |
const constC = true;
moduleC/.packages: |
moduleC:.
moduleB:
moduleB/lib.dart: |
import "package:moduleC/lib.dart";
const constB = false || constC;
moduleB/.packages: |
moduleB:.
moduleC:../moduleC
worlds:
- entry: main.dart
fromComponent: true
sources:
main.dart: |
import 'package:moduleB/lib.dart';
const constA = true && constB;
.packages: |
moduleB:moduleB
moduleC: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