Files
sdk/tests/language_2/vm/regress_flutter_19612_test.dart
T
Alexander Markov cb70de8afa [vm/compiler] Fix negated integer comparisons in AOT
Fixes https://github.com/flutter/flutter/issues/19612

Change-Id: I5cf45b7243e4c2b50bb29f8b0f3dafc55a1f1838
Reviewed-on: https://dart-review.googlesource.com/67040
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-07-27 17:35:58 +00:00

27 lines
680 B
Dart

// Copyright (c) 2018, 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.
// Regression test for https://github.com/flutter/flutter/issues/19612.
// This test verifies that negated condition is correctly handled by the
// AOT compiler.
import "package:expect/expect.dart";
class X {
final int maxLines;
X([this.maxLines]);
bool get isMultiline => maxLines != 1;
}
X x1 = new X(1);
X x2 = new X(42);
X x3 = new X();
main() {
Expect.isFalse(x1.isMultiline);
Expect.isTrue(x2.isMultiline);
Expect.isTrue(x3.isMultiline);
}