| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 // Flags: --validate-asm --allow-natives-syntax | 5 // Flags: --validate-asm --allow-natives-syntax |
| 6 | 6 |
| 7 var stdlib = this; | 7 var stdlib = this; |
| 8 | 8 |
| 9 function assertValidAsm(func) { | 9 function assertValidAsm(func) { |
| 10 assertTrue(%IsAsmWasmCode(func)); | 10 assertTrue(%IsAsmWasmCode(func)); |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 } | 403 } |
| 404 return ret|0; | 404 return ret|0; |
| 405 } | 405 } |
| 406 | 406 |
| 407 return {caller: caller}; | 407 return {caller: caller}; |
| 408 } | 408 } |
| 409 | 409 |
| 410 assertWasm(20, TestContinueInNamedWhile); | 410 assertWasm(20, TestContinueInNamedWhile); |
| 411 | 411 |
| 412 | 412 |
| 413 function TestContinueInDoWhileFalse() { |
| 414 "use asm"; |
| 415 |
| 416 function caller() { |
| 417 do { |
| 418 continue; |
| 419 } while (false); |
| 420 return 47; |
| 421 } |
| 422 |
| 423 return {caller: caller}; |
| 424 } |
| 425 |
| 426 assertWasm(47, TestContinueInDoWhileFalse); |
| 427 |
| 428 |
| 413 function TestNot() { | 429 function TestNot() { |
| 414 "use asm"; | 430 "use asm"; |
| 415 | 431 |
| 416 function caller() { | 432 function caller() { |
| 417 var a = 0; | 433 var a = 0; |
| 418 a = !(2 > 3); | 434 a = !(2 > 3); |
| 419 return a | 0; | 435 return a | 0; |
| 420 } | 436 } |
| 421 | 437 |
| 422 return {caller:caller}; | 438 return {caller:caller}; |
| (...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1736 "use asm"; | 1752 "use asm"; |
| 1737 function foo() { | 1753 function foo() { |
| 1738 return 42; | 1754 return 42; |
| 1739 } | 1755 } |
| 1740 return {bar: foo, baz: foo}; | 1756 return {bar: foo, baz: foo}; |
| 1741 } | 1757 } |
| 1742 var m = asmModule(); | 1758 var m = asmModule(); |
| 1743 assertEquals(42, m.bar()); | 1759 assertEquals(42, m.bar()); |
| 1744 assertEquals(42, m.baz()); | 1760 assertEquals(42, m.baz()); |
| 1745 })(); | 1761 })(); |
| OLD | NEW |