Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: tests/compiler/dart2js/expect_annotations2_test.dart

Issue 912223003: Support @NoInlining in the ssa-builder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: move TODO Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/expect/lib/expect.dart ('k') | tests/compiler/dart2js/expect_annotations_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import "package:expect/expect.dart";
6 import "package:async_helper/async_helper.dart";
7 import 'memory_compiler.dart';
8
9 const MEMORY_SOURCE_FILES = const {
10 'main.dart': '''
11 import 'package:expect/expect.dart';
12
13 @NoInline()
14 foo(y) => 49912344 + y;
15
16 class A {
17 @NoInline()
18 static bar(x) => x + 123455;
19
20 @NoInline()
21 gee(x, y) => x + y + 81234512;
22 }
23
24 main() {
25 print(foo(23412));
26 print(A.bar(87654));
27 print(new A().gee(1337, 919182));
28 }'''};
29
30 void main() {
31 OutputCollector collector = new OutputCollector();
32 var compiler = compilerFor(MEMORY_SOURCE_FILES, outputProvider: collector);
33 asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) {
34 // Simply check that the constants of the small functions are still in the
35 // output, and that we don't see the result of constant folding.
36 String jsOutput = collector.getOutput('', 'js');
37
38 Expect.isTrue(jsOutput.contains('49912344'));
karlklose 2015/02/20 09:48:15 I don't think this way of testing is robust enough
floitsch 2015/02/20 10:52:56 We will need to discuss the semantics of @NoInline
39 Expect.isTrue(jsOutput.contains('123455'));
40 Expect.isTrue(jsOutput.contains('81234512'));
41 Expect.isFalse(jsOutput.contains('49935756'));
42 Expect.isFalse(jsOutput.contains('211109'));
43 Expect.isFalse(jsOutput.contains('82155031'));
44 }));
45 }
OLDNEW
« no previous file with comments | « pkg/expect/lib/expect.dart ('k') | tests/compiler/dart2js/expect_annotations_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698