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

Side by Side Diff: test/mjsunit/asm/infinite-loops-taken.js

Issue 2663243002: [asm] Fix lots of invalid asm.js tests (Closed)
Patch Set: Rebase Created 3 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
« no previous file with comments | « test/mjsunit/asm/if-tonumber.js ('k') | test/mjsunit/asm/int16array-negative-offset.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var error = "error"; 5 var error = "error";
6 function counter(x) { 6 function counter(x) {
7 return (function() { if (x-- == 0) throw error;}); 7 return (function() { if (x-- == 0) throw error;});
8 } 8 }
9 9
10 // TODO(asm): This module is not valid asm.js.
10 function Module() { 11 function Module() {
11 "use asm"; 12 "use asm";
12 13
13 function w0(f) { 14 function w0(f) {
14 while (1) f(); 15 while (1) f();
15 return 108; 16 return 108;
16 } 17 }
17 18
18 function w1(f) { 19 function w1(f) {
19 if (1) while (1) f(); 20 if (1) while (1) f();
(...skipping 12 matching lines...) Expand all
32 } 33 }
33 34
34 return { w0: w0, w1: w1, w2: w2, w3: w3 }; 35 return { w0: w0, w1: w1, w2: w2, w3: w3 };
35 } 36 }
36 37
37 var m = Module(); 38 var m = Module();
38 assertThrowsEquals(function() { m.w0(counter(5)) }, error); 39 assertThrowsEquals(function() { m.w0(counter(5)) }, error);
39 assertThrowsEquals(function() { m.w1(counter(5)) }, error); 40 assertThrowsEquals(function() { m.w1(counter(5)) }, error);
40 assertThrowsEquals(function() { m.w2(counter(5)) }, error); 41 assertThrowsEquals(function() { m.w2(counter(5)) }, error);
41 assertEquals(111, m.w3(counter(5))); 42 assertEquals(111, m.w3(counter(5)));
OLDNEW
« no previous file with comments | « test/mjsunit/asm/if-tonumber.js ('k') | test/mjsunit/asm/int16array-negative-offset.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698