Files
sdk/pkg/front_end/testcases/const_functions/const_functions_recursion.dart.weak.modular.expect
T
Johnni Winther 078d407f40 [cfe] Add modular_suite
This adds a new expectation test suite which mimics the modular
compilation strategy used by dartdevc; the test code is fully compiled
but the linked dependencies are only compiled as outlines.

Change-Id: I4b8a68087997c025eb39aec414ee1706ddf7f847
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222762
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2021-12-10 14:02:30 +00:00

30 lines
905 B
Plaintext

library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
import "package:expect/expect.dart" as exp;
import "package:expect/expect.dart";
static const field core::int b = #C1;
static method fn(core::int a) → core::int {
if(a =={core::num::==}{(core::Object) → core::bool} 1)
return 1;
return a.{core::num::*}(self::fn(a.{core::num::-}(1){(core::num) → core::int})){(core::num) → core::int};
}
static method localTest() → core::int {
function fnLocal(core::int a) → core::int {
if(a =={core::num::==}{(core::Object) → core::bool} 1)
return 1;
return a.{core::num::*}(fnLocal(a.{core::num::-}(1){(core::num) → core::int}){(core::int) → core::int}){(core::num) → core::int};
}
return #C1;
}
static method main() → void {
exp::Expect::equals(#C1, 24);
exp::Expect::equals(self::localTest(), 24);
}
constants {
#C1 = 24
}