Repro for inferring arrays with out of range lengths

See https://github.com/dart-lang/sdk/issues/37429

We will change the bogus number(s) to something better when the bug is fixed.

TBR=johnniwinther@google.com

Change-Id: Ibcc085a14770acd61ac2bb596910254a6f2f3219
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108060
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
This commit is contained in:
Stephen Adams 2019-07-03 18:30:21 +00:00 committed by commit-bot@chromium.org
parent 5d77657e7a
commit c100308ba6
4 changed files with 51 additions and 1 deletions

View file

@ -0,0 +1,32 @@
// Copyright (c) 2019, 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 file.
/*element: main:[null]*/
main() {
hugeList1();
hugeList2();
}
/*element: _huge1:[subclass=JSPositiveInt]*/
final _huge1 = 5000000000;
/*element: hugeList1:Container([exact=JSFixedArray], element: [null], length: 5000000000)*/
hugeList1() => List(_huge1);
/*strong.element: _huge2a:[subclass=JSPositiveInt]*/
/*omit.element: _huge2a:[subclass=JSPositiveInt]*/
const _huge2a = 10000000000
/*strong.invoke: [subclass=JSPositiveInt]*/
/*omit.invoke: [subclass=JSPositiveInt]*/
*
10000000000;
/*strong.element: _huge2b:[null|subclass=JSPositiveInt]*/
/*omit.element: _huge2b:[null|subclass=JSPositiveInt]*/
/*strongConst.element: _huge2b:[subclass=JSPositiveInt]*/
/*omitConst.element: _huge2b:[subclass=JSPositiveInt]*/
final _huge2b = _huge2a;
/*element: hugeList2:Container([exact=JSFixedArray], element: [null], length: 9223372036854775807)*/
hugeList2() => List(_huge2b);

View file

@ -0,0 +1,9 @@
// Copyright (c) 2019, 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 file.
import 'inference_test_helper.dart';
main(List<String> args) {
runTests(args, 2);
}

View file

@ -0,0 +1,9 @@
// Copyright (c) 2019, 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 file.
import 'inference_test_helper.dart';
main(List<String> args) {
runTests(args, 3);
}

View file

@ -38,7 +38,7 @@ runTests(List<String> args, [int shardIndex]) {
testCFEConstants: true,
skipForStrong: skipForStrong,
shardIndex: shardIndex ?? 0,
shards: shardIndex != null ? 2 : 1);
shards: shardIndex != null ? 4 : 1);
});
}