Chromium Code Reviews| Index: tests/compiler/dart2js/inverse_operator_test.dart |
| diff --git a/tests/compiler/dart2js/inverse_operator_test.dart b/tests/compiler/dart2js/inverse_operator_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e722d8da9e05dd11804ad5862ae789c89808b34a |
| --- /dev/null |
| +++ b/tests/compiler/dart2js/inverse_operator_test.dart |
| @@ -0,0 +1,24 @@ |
| +// Copyright (c) 2012, 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("compiler_helper.dart"); |
| + |
| +const String MAIN = r""" |
| +main() { |
| + foo(x) { |
| + if (x == 0) return x; |
|
floitsch
2012/10/04 11:35:26
this will be too easy to inline. Maybe change to:
|
| + return x; |
| + } |
| + var x = 1; |
| + if (foo(x) == 0) { |
| + x = 2; |
| + } |
| + print(!(1 < x)); |
| +}"""; |
| + |
| +main() { |
| + // Make sure we don't introduce a new variable. |
| + RegExp regexp = new RegExp("1 >= x"); |
| + compileAndMatch(MAIN, 'main', regexp); |
| +} |