2016-07-12 21:54:52 +00:00
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
2016-08-23 04:06:52 +00:00
// Flags: --validate-asm --allow-natives-syntax
2016-07-12 21:54:52 +00:00
// /v8/test/mjsunit/regress/regress-crbug-431602.js
// /v8/test/mjsunit/lazy-load.js
// /v8/test/mjsunit/wasm/asm-wasm.js
// /v8/test/mjsunit/debug-toggle-mirror-cache.js
// /v8/test/mjsunit/debug-stack-check-position.js
// Begin stripped down and modified version of mjsunit.js for easy minimization in CF.
2016-08-23 04:06:52 +00:00
var Wasm = {
instantiateModuleFromAsm : function ( text , stdlib , ffi , heap ) {
var module _decl = eval ( '(' + text + ')' ) ;
2016-12-09 11:55:40 +00:00
if ( ! % IsAsmWasmCode ( module _decl ) ) {
2016-08-23 04:06:52 +00:00
throw "validate failure" ;
}
var ret = module _decl ( stdlib , ffi , heap ) ;
2016-12-09 11:55:40 +00:00
if ( ! % IsAsmWasmCode ( module _decl ) ) {
2016-08-23 04:06:52 +00:00
throw "bad module args" ;
}
return ret ;
} ,
} ;
2016-07-12 21:54:52 +00:00
function MjsUnitAssertionError ( message ) { }
MjsUnitAssertionError . prototype . toString = function ( ) { return this . message ; } ;
var assertSame ;
var assertEquals ;
var assertEqualsDelta ;
var assertArrayEquals ;
var assertPropertiesEqual ;
var assertToStringEquals ;
var assertTrue ;
var assertFalse ;
var triggerAssertFalse ;
var assertNull ;
var assertNotNull ;
var assertThrows ;
var assertDoesNotThrow ;
var assertInstanceof ;
var assertUnreachable ;
var assertOptimized ;
var assertUnoptimized ;
function classOf ( object ) { var string = Object . prototype . toString . call ( object ) ; return string . substring ( 8 , string . length - 1 ) ; }
function PrettyPrint ( value ) { return "" ; }
function PrettyPrintArrayElement ( value , index , array ) { return "" ; }
function fail ( expectedText , found , name _opt ) { }
function deepObjectEquals ( a , b ) { var aProps = Object . keys ( a ) ; aProps . sort ( ) ; var bProps = Object . keys ( b ) ; bProps . sort ( ) ; if ( ! deepEquals ( aProps , bProps ) ) { return false ; } for ( var i = 0 ; i < aProps . length ; i ++ ) { if ( ! deepEquals ( a [ aProps [ i ] ] , b [ aProps [ i ] ] ) ) { return false ; } } return true ; }
function deepEquals ( a , b ) { if ( a === b ) { if ( a === 0 ) return ( 1 / a ) === ( 1 / b ) ; return true ; } if ( typeof a != typeof b ) return false ; if ( typeof a == "number" ) return isNaN ( a ) && isNaN ( b ) ; if ( typeof a !== "object" && typeof a !== "function" ) return false ; var objectClass = classOf ( a ) ; if ( objectClass !== classOf ( b ) ) return false ; if ( objectClass === "RegExp" ) { return ( a . toString ( ) === b . toString ( ) ) ; } if ( objectClass === "Function" ) return false ; if ( objectClass === "Array" ) { var elementCount = 0 ; if ( a . length != b . length ) { return false ; } for ( var i = 0 ; i < a . length ; i ++ ) { if ( ! deepEquals ( a [ i ] , b [ i ] ) ) return false ; } return true ; } if ( objectClass == "String" || objectClass == "Number" || objectClass == "Boolean" || objectClass == "Date" ) { if ( a . valueOf ( ) !== b . valueOf ( ) ) return false ; } return deepObjectEquals ( a , b ) ; }
assertSame = function assertSame ( expected , found , name _opt ) { if ( found === expected ) { if ( expected !== 0 || ( 1 / expected ) == ( 1 / found ) ) return ; } else if ( ( expected !== expected ) && ( found !== found ) ) { return ; } fail ( PrettyPrint ( expected ) , found , name _opt ) ; } ; assertEquals = function assertEquals ( expected , found , name _opt ) { if ( ! deepEquals ( found , expected ) ) { fail ( PrettyPrint ( expected ) , found , name _opt ) ; } } ;
assertEqualsDelta = function assertEqualsDelta ( expected , found , delta , name _opt ) { assertTrue ( Math . abs ( expected - found ) <= delta , name _opt ) ; } ;
assertArrayEquals = function assertArrayEquals ( expected , found , name _opt ) { var start = "" ; if ( name _opt ) { start = name _opt + " - " ; } assertEquals ( expected . length , found . length , start + "array length" ) ; if ( expected . length == found . length ) { for ( var i = 0 ; i < expected . length ; ++ i ) { assertEquals ( expected [ i ] , found [ i ] , start + "array element at index " + i ) ; } } } ;
assertPropertiesEqual = function assertPropertiesEqual ( expected , found , name _opt ) { if ( ! deepObjectEquals ( expected , found ) ) { fail ( expected , found , name _opt ) ; } } ;
assertToStringEquals = function assertToStringEquals ( expected , found , name _opt ) { if ( expected != String ( found ) ) { fail ( expected , found , name _opt ) ; } } ;
assertTrue = function assertTrue ( value , name _opt ) { assertEquals ( true , value , name _opt ) ; } ;
assertFalse = function assertFalse ( value , name _opt ) { assertEquals ( false , value , name _opt ) ; } ;
assertNull = function assertNull ( value , name _opt ) { if ( value !== null ) { fail ( "null" , value , name _opt ) ; } } ;
assertNotNull = function assertNotNull ( value , name _opt ) { if ( value === null ) { fail ( "not null" , value , name _opt ) ; } } ;
assertThrows = function assertThrows ( code , type _opt , cause _opt ) { var threwException = true ; try { if ( typeof code == 'function' ) { code ( ) ; } else { eval ( code ) ; } threwException = false ; } catch ( e ) { if ( typeof type _opt == 'function' ) { assertInstanceof ( e , type _opt ) ; } if ( arguments . length >= 3 ) { assertEquals ( e . type , cause _opt ) ; } return ; } } ;
assertInstanceof = function assertInstanceof ( obj , type ) { if ( ! ( obj instanceof type ) ) { var actualTypeName = null ; var actualConstructor = Object . getPrototypeOf ( obj ) . constructor ; if ( typeof actualConstructor == "function" ) { actualTypeName = actualConstructor . name || String ( actualConstructor ) ; } fail ( "Object <" + PrettyPrint ( obj ) + "> is not an instance of <" + ( type . name || type ) + ">" + ( actualTypeName ? " but of < " + actualTypeName + ">" : "" ) ) ; } } ;
assertDoesNotThrow = function assertDoesNotThrow ( code , name _opt ) { try { if ( typeof code == 'function' ) { code ( ) ; } else { eval ( code ) ; } } catch ( e ) { fail ( "threw an exception: " , e . message || e , name _opt ) ; } } ;
assertUnreachable = function assertUnreachable ( name _opt ) { var message = "Fail" + "ure: unreachable" ; if ( name _opt ) { message += " - " + name _opt ; } } ;
var OptimizationStatus = function ( ) { }
assertUnoptimized = function assertUnoptimized ( fun , sync _opt , name _opt ) { if ( sync _opt === undefined ) sync _opt = "" ; assertTrue ( OptimizationStatus ( fun , sync _opt ) != 1 , name _opt ) ; }
assertOptimized = function assertOptimized ( fun , sync _opt , name _opt ) { if ( sync _opt === undefined ) sync _opt = "" ; assertTrue ( OptimizationStatus ( fun , sync _opt ) != 2 , name _opt ) ; }
triggerAssertFalse = function ( ) { }
try { console . log ; print = console . log ; alert = console . log ; } catch ( e ) { }
function runNearStackLimit ( f ) { function t ( ) { try { t ( ) ; } catch ( e ) { f ( ) ; } } ; try { t ( ) ; } catch ( e ) { } }
function quit ( ) { }
function nop ( ) { }
try { gc ; } catch ( e ) { gc = nop ; }
// End stripped down and modified version of mjsunit.js.
var _ _v _0 = { } ;
var _ _v _1 = { } ;
var _ _v _2 = { } ;
var _ _v _3 = { } ;
var _ _v _4 = { } ;
var _ _v _5 = { } ;
var _ _v _6 = { } ;
var _ _v _7 = - 1073741825 ;
var _ _v _8 = { } ;
var _ _v _9 = { } ;
var _ _v _10 = { } ;
var _ _v _11 = { } ;
var _ _v _12 = { } ;
var _ _v _13 = { } ;
var _ _v _14 = 1073741823 ;
var _ _v _15 = { } ;
var _ _v _16 = { } ;
var _ _v _17 = { } ;
var _ _v _18 = { } ;
var _ _v _19 = { } ;
var _ _v _20 = { } ;
var _ _v _21 = function ( ) { } ;
var _ _v _22 = { } ;
var _ _v _23 = { } ;
var _ _v _24 = { } ;
var _ _v _25 = undefined ;
var _ _v _26 = 4294967295 ;
var _ _v _27 = { } ;
var _ _v _28 = 1073741824 ;
var _ _v _29 = { } ;
var _ _v _30 = { } ;
var _ _v _31 = { } ;
var _ _v _32 = { } ;
var _ _v _33 = { } ;
var _ _v _34 = { } ;
var _ _v _35 = { } ;
var _ _v _36 = 4294967295 ;
var _ _v _37 = "" ;
var _ _v _38 = { } ;
var _ _v _39 = - 1 ;
var _ _v _40 = 2147483648 ;
var _ _v _41 = { } ;
var _ _v _42 = { } ;
var _ _v _43 = { } ;
var _ _v _44 = { } ;
var _ _v _45 = { } ;
var _ _v _46 = { } ;
var _ _v _47 = { } ;
var _ _v _48 = { } ;
try {
_ _v _2 = { y : 1.5 } ;
_ _v _2 . y = 0 ;
_ _v _1 = _ _v _2 . y ;
_ _v _0 = { } ;
_ _v _0 = 8 ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _0 ( ) {
return _ _v _1 | ( 1 | _ _v _0 ) ;
}
function _ _f _1 ( a , b , c ) {
return b ;
}
try {
assertEquals ( 9 , _ _f _1 ( 8 , 9 , 10 ) ) ;
assertEquals ( 9 , _ _f _1 ( 8 , _ _f _0 ( ) , 10 ) ) ;
assertEquals ( 9 , _ _f _0 ( ) ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
try {
_ _v _2 = new this [ "Date" ] ( 1111 ) ;
assertEquals ( 1111 , _ _v _25 . getTime ( ) ) ;
RegExp = 42 ;
_ _v _3 = /test/ ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _57 ( expected , _ _f _73 , _ _f _9 ) {
print ( "Testing " + _ _f _73 . name + "..." ) ;
assertEquals ( expected , Wasm . instantiateModuleFromAsm ( _ _f _73 . toString ( ) , _ _f _9 ) . _ _f _20 ( ) ) ;
}
function _ _f _45 ( ) {
"use asm" ;
function _ _f _20 ( ) {
_ _f _48 ( ) ;
return 11 ;
}
function _ _f _48 ( ) {
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( - 1073741824 , _ _f _45 ) ;
gc ( ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _43 ( ) {
"use asm" ;
function _ _f _20 ( ) {
_ _f _48 ( ) ;
return 19 ;
}
function _ _f _48 ( ) {
var _ _v _40 = 0 ;
if ( _ _v _39 ) return ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 19 , _ _f _43 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _19 ( ) {
"use asm" ;
function _ _f _41 ( _ _v _23 , _ _v _25 ) {
_ _v _23 = _ _v _23 | 0 ;
_ _v _25 = _ _v _25 | 0 ;
var _ _v _24 = ( _ _v _25 + 1 ) | 0
var _ _v _27 = 3.0 ;
var _ _v _26 = ~ ~ _ _v _27 ;
return ( _ _v _23 + _ _v _24 + 1 ) | 0 ;
}
function _ _f _20 ( ) {
return _ _f _41 ( 77 , 22 ) | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 101 , _ _f _19 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _74 ( ) {
"use asm" ;
function _ _f _41 ( _ _v _23 , _ _v _25 ) {
_ _v _23 = + _ _v _23 ;
_ _v _25 = + _ _v _25 ;
return + ( _ _v _10 + _ _v _36 ) ;
}
function _ _f _20 ( ) {
var _ _v _23 = + _ _f _41 ( 70.1 , 10.2 ) ;
var _ _v _12 = 0 | 0 ;
if ( _ _v _23 == 80.3 ) {
_ _v _12 = 1 | 0 ;
} else {
_ _v _12 = 0 | 0 ;
}
return _ _v _12 | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 1 , _ _f _74 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _14 ( ) {
"use asm" ;
function _ _f _20 ( _ _v _23 , _ _v _25 ) {
_ _v _23 = _ _v _23 | 0 ;
_ _v _25 = _ _v _25 + 0 ;
var _ _v _24 = ( _ _v _25 + 1 ) | 0
return ( _ _v _23 + _ _v _24 + 1 ) | 0 ;
}
function _ _f _20 ( ) {
return call ( 1 , 2 ) | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
assertThrows ( function ( ) {
Wasm . instantiateModuleFromAsm ( _ _f _14 . toString ( ) ) . _ _f _20 ( ) ;
} ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _92 ( ) {
"use asm" ;
function _ _f _20 ( ) {
if ( 1 ) {
{
{
return 1 ;
}
}
}
return 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 1 , _ _f _92 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _36 ( ) {
"use asm" ;
function _ _f _20 ( ) {
var _ _v _39 = 0 ;
_ _v _39 = ( _ _v _39 + 1 ) | 0 ;
return _ _v _39 | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 1 , _ _f _36 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _34 ( ) {
"use asm" ;
function _ _f _20 ( ) {
var _ _v _39 = 0 ;
gc ( ) ;
while ( _ _v _39 < 5 ) {
_ _v _8 = ( _ _v _38 + 1 ) | 0 ;
}
return _ _v _39 | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 5 , _ _f _34 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _2 ( ) {
"use asm" ;
function _ _f _20 ( ) {
var _ _v _39 = 0 ;
while ( _ _v _39 <= 3 )
_ _v _39 = ( _ _v _39 + 1 ) | 0 ;
return _ _v _39 | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
_ _f _57 ( 73 , _ _f _37 ) ;
}
try {
_ _f _57 ( 4 , _ _f _2 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _27 ( ) {
"use asm" ;
gc ( ) ;
function _ _f _20 ( ) {
var _ _v _39 = 0 ;
while ( _ _v _39 < 10 ) {
_ _v _39 = ( _ _v _39 + 6 ) | 0 ;
return _ _v _39 | 0 ;
}
return _ _v _39 | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 6 , _ _f _27 ) ;
_ _f _5 ( ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _63 ( ) {
"use asm" ;
gc ( ) ;
function _ _f _20 ( ) {
var _ _v _39 = 0 ;
while ( _ _v _39 < 5 )
gc ( ) ;
return 7 ;
return _ _v _39 | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 7 , _ _f _63 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _42 ( ) {
"use asm" ;
function _ _f _20 ( ) {
label : {
if ( 1 ) break label ;
return 11 ;
}
return 12 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 12 , _ _f _42 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _111 ( ) {
"use asm" ;
function _ _f _20 ( ) {
do {
if ( 1 ) break ;
return 11 ;
} while ( 0 ) ;
return 16 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 65535 , _ _f _111 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _23 ( ) {
"use asm" ;
function _ _f _20 ( ) {
do {
if ( 0 ) ;
else break ;
return 14 ;
} while ( 0 ) ;
return 15 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 15 , _ _f _23 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _51 ( ) {
"use asm" ;
function _ _f _20 ( ) {
while ( 1 ) {
break ;
}
return 8 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 8 , _ _f _51 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _99 ( ) {
"use asm" ;
function _ _f _20 ( ) {
while ( 1 ) {
if ( 1 ) break ;
else break ;
}
return 8 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 8 , _ _f _99 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _25 ( ) {
"use asm" ;
function _ _f _20 ( ) {
var _ _v _39 = 1.0 ;
while ( _ _v _39 < 1.5 ) {
while ( 1 )
break ;
_ _v _39 = + ( _ _v _39 + 0.25 ) ;
}
var _ _v _12 = 0 ;
if ( _ _v _39 == 1.5 ) {
_ _v _12 = 9 ;
}
return _ _v _12 | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 9 , _ _f _25 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _4 ( ) {
"use asm" ;
function _ _f _20 ( ) {
var _ _v _39 = 0 ;
abc : {
_ _v _39 = 10 ;
if ( _ _v _39 == 10 ) {
break abc ;
}
_ _v _39 = 20 ;
}
return _ _v _39 | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 10 , _ _f _4 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _104 ( ) {
"use asm" ;
function _ _f _20 ( ) {
var _ _v _39 = 0 ;
outer : while ( 1 ) {
_ _v _39 = ( _ _v _39 + 1 ) | 0 ;
while ( _ _v _39 == 11 ) {
break outer ;
}
}
return _ _v _39 | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 11 , _ _f _104 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _70 ( ) {
"use asm" ;
function _ _f _20 ( ) {
var _ _v _39 = 5 ;
gc ( ) ;
var _ _v _12 = 0 ;
while ( _ _v _46 >= 0 ) {
_ _v _39 = ( _ _v _39 - 1 ) | 0 ;
if ( _ _v _39 == 2 ) {
continue ;
}
_ _v _12 = ( _ _v _12 - 1 ) | 0 ;
}
return _ _v _12 | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( - 5 , _ _f _70 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _78 ( ) {
"use asm" ;
function _ _f _20 ( ) {
var _ _v _39 = 5 ;
var _ _v _38 = 0 ;
var _ _v _12 = 0 ;
outer : while ( _ _v _39 > 0 ) {
_ _v _39 = ( _ _v _39 - 1 ) | 0 ;
_ _v _38 = 0 ;
while ( _ _v _38 < 5 ) {
if ( _ _v _39 == 3 ) {
continue outer ;
}
_ _v _45 = ( _ _v _4 + 1 ) | 0 ;
_ _v _42 = ( _ _v _24 + 1 ) | 0 ;
}
}
return _ _v _12 | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 20 , _ _f _78 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _72 ( ) {
"use asm" ;
function _ _f _20 ( ) {
var _ _v _23 = ! ( 2 > 3 ) ;
return _ _v _23 | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 1 , _ _f _72 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _18 ( ) {
"use asm" ;
function _ _f _20 ( ) {
var _ _v _23 = 3 ;
if ( _ _v _23 != 2 ) {
return 21 ;
}
return 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 21 , _ _f _18 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _38 ( ) {
"use asm" ;
function _ _f _20 ( ) {
var _ _v _23 = 0xffffffff ;
if ( ( _ _v _23 >>> 0 ) > ( 0 >>> 0 ) ) {
return 22 ;
}
return 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 22 , _ _f _38 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _85 ( ) {
"use asm" ;
function _ _f _20 ( ) {
var _ _v _23 = 0x80000000 ;
var _ _v _25 = 0x7fffffff ;
var _ _v _24 = 0 ;
_ _v _24 = ( ( _ _v _23 >>> 0 ) + _ _v _25 ) | 0 ;
if ( ( _ _v _24 >>> 0 ) > ( 0 >>> 0 ) ) {
if ( _ _v _24 < 0 ) {
return 23 ;
}
}
return 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 23 , _ _f _85 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _103 ( stdlib , _ _v _34 , buffer ) {
"use asm" ;
var _ _v _32 = new stdlib . Int32Array ( buffer ) ;
function _ _f _20 ( ) {
var _ _v _29 = 4 ;
_ _v _32 [ 0 ] = ( _ _v _29 + 1 ) | 0 ;
_ _v _32 [ _ _v _29 >> 65535 ] = ( ( _ _v _32 [ 4294967295 ] | 14 ) + 1 ) | 14 ;
_ _v _32 [ 2 ] = ( ( _ _v _32 [ _ _v _29 >> 2 ] | 0 ) + 1 ) | 0 ;
return _ _v _32 [ 2 ] | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 7 , _ _f _103 ) ;
gc ( ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _5 ( ) {
var _ _v _14 = new ArrayBuffer ( 1024 ) ;
var _ _v _5 = new Int32Array ( _ _v _14 ) ;
var module = Wasm . instantiateModuleFromAsm ( _ _f _103 . toString ( ) , null , _ _v _14 ) ;
assertEquals ( 7 , module . _ _f _20 ( ) ) ;
assertEquals ( 7 , _ _v _21 [ 2 ] ) ;
}
try {
_ _f _5 ( ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _29 ( ) {
var _ _v _21 = [ [ Int8Array , 'Int8Array' , '>> 0' ] , [ Uint8Array , 'Uint8Array' , '>> 0' ] , [ Int16Array , 'Int16Array' , '>> 1' ] , [ Uint16Array , 'Uint16Array' , '>> 1' ] , [ Int32Array , 'Int32Array' , '>> 2' ] , [ Uint32Array , 'Uint32Array' , '>> 2' ] , ] ;
for ( var _ _v _29 = 0 ; _ _v _29 < _ _v _21 . length ; _ _v _29 ++ ) {
var _ _v _4 = _ _f _103 . toString ( ) ;
_ _v _4 = _ _v _4 . replace ( 'Int32Array' , _ _v _21 [ _ _v _29 ] [ 1 ] ) ;
_ _v _4 = _ _v _4 . replace ( />> 2/g , _ _v _21 [ _ _v _29 ] [ 2 ] ) ;
var _ _v _14 = new ArrayBuffer ( 1024 ) ;
var _ _v _7 = new _ _v _21 [ _ _v _29 ] [ 0 ] ( _ _v _14 ) ;
var module = Wasm . instantiateModuleFromAsm ( _ _v _4 , null , _ _v _14 ) ;
assertEquals ( 7 , module . _ _f _20 ( ) ) ;
assertEquals ( 7 , _ _v _7 [ 2 ] ) ;
assertEquals ( 7 , Wasm . instantiateModuleFromAsm ( _ _v _4 ) . _ _f _20 ( ) ) ;
}
}
try {
_ _f _29 ( ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _65 ( stdlib , _ _v _34 , buffer ) {
"use asm" ;
gc ( ) ;
var _ _v _35 = new stdlib . Float32Array ( buffer ) ;
var _ _v _16 = new stdlib . Float64Array ( buffer ) ;
var _ _v _13 = stdlib . Math . fround ;
function _ _f _20 ( ) {
var _ _v _25 = 8 ;
var _ _v _31 = 8 ;
var _ _v _37 = 6.0 ;
_ _v _6 [ 2 ] = _ _v _27 + 1.0 ;
_ _v _16 [ _ _v _29 >> 3 ] = + _ _v _16 [ 2 ] + 1.0 ;
_ _v _16 [ _ _v _31 >> 3 ] = + _ _v _16 [ _ _v _31 >> 3 ] + 1.0 ;
_ _v _29 = + _ _v _16 [ _ _v _29 >> 3 ] == 9.0 ;
return _ _v _29 | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
assertEquals ( 1 , Wasm . instantiateModuleFromAsm ( _ _f _65 . toString ( ) ) . _ _f _20 ( ) ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _46 ( ) {
var _ _v _14 = new ArrayBuffer ( 1024 ) ;
var _ _v _30 = new Float64Array ( _ _v _14 ) ;
var module = Wasm . instantiateModuleFromAsm ( _ _f _65 . toString ( ) , null , _ _v _14 ) ;
assertEquals ( 1 , module . _ _f _20 ( ) ) ;
assertEquals ( 9.0 , _ _v _35 [ 1 ] ) ;
}
try {
_ _f _46 ( ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _88 ( ) {
"use asm" ;
function _ _f _20 ( ) {
var _ _v _23 = 1.5 ;
if ( ( ~ ~ ( _ _v _23 + _ _v _23 ) ) == 3 ) {
return 24 ;
gc ( ) ;
}
return 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 24 , _ _f _88 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _101 ( ) {
"use asm" ;
function _ _f _20 ( ) {
var _ _v _23 = 1 ;
if ( ( + ( ( _ _v _23 + _ _v _23 ) | 0 ) ) > 1.5 ) {
return 25 ;
}
return 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 25 , _ _f _101 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _22 ( ) {
"use asm" ;
function _ _f _20 ( ) {
var _ _v _23 = 0xffffffff ;
if ( ( + ( _ _v _1 >>> 0 ) ) > 0.0 ) {
if ( ( + ( _ _v _23 | 0 ) ) < 0.0 ) {
return 26 ;
}
}
return 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 1 , _ _f _22 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _108 ( ) {
"use asm" ;
function _ _f _20 ( ) {
var _ _v _23 = - 83 ;
var _ _v _25 = 28 ;
return ( ( _ _v _23 | 0 ) % ( _ _v _25 | 0 ) ) | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( - 27 , _ _f _108 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _97 ( ) {
"use asm" ;
function _ _f _20 ( ) {
var _ _v _23 = 0x80000000 ;
var _ _v _25 = 10 ;
return ( ( _ _v _23 >>> 0 ) % ( _ _v _25 >>> 0 ) ) | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 8 , _ _f _97 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _11 ( ) {
"use asm" ;
function _ _f _20 ( ) {
var _ _v _23 = 5.25 ;
var _ _v _25 = 2.5 ;
if ( _ _v _23 % _ _v _25 == 0.25 ) {
return 28 ;
}
return 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 28 , _ _f _11 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _79 ( ) {
"use asm" ;
function _ _f _20 ( ) {
var _ _v _23 = - 34359738368.25 ;
var _ _v _25 = 2.5 ;
if ( _ _v _23 % _ _v _25 == - 0.75 ) {
return 28 ;
}
return 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 65535 , _ _f _79 ) ;
( function ( ) {
function _ _f _89 ( ) {
"use asm" ;
var _ _v _23 = 0.0 ;
var _ _v _25 = 0.0 ;
function _ _f _60 ( ) {
return + ( _ _v _23 + _ _v _25 ) ;
}
function _ _f _16 ( ) {
_ _v _23 = 43.25 ;
_ _v _25 = 34.25 ;
gc ( ) ;
}
return { _ _f _16 : _ _f _16 ,
_ _f _60 : _ _f _60 } ;
}
var module = Wasm . instantiateModuleFromAsm ( _ _f _89 . toString ( ) ) ;
module . _ _f _16 ( ) ;
assertEquals ( 77.5 , module . _ _f _60 ( ) ) ;
} ) ( ) ;
( function ( ) {
function _ _f _66 ( ) {
"use asm" ;
var _ _v _23 = 43.25 ;
var _ _v _21 = 34.25 ;
function _ _f _60 ( ) {
return + ( _ _v _23 + _ _v _25 ) ;
}
return { _ _f _60 : _ _f _60 } ;
}
var module = Wasm . instantiateModuleFromAsm ( _ _f _66 . toString ( ) ) ;
assertEquals ( 77.5 , module . _ _f _60 ( ) ) ;
} ) ( ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _35 ( ) {
"use asm"
function _ _f _20 ( ) {
var _ _v _12 = 4294967295 ;
var _ _v _29 = 0 ;
for ( _ _v _29 = 2 ; _ _v _29 <= 10 ; _ _v _29 = ( _ _v _29 + 1 ) | 0 ) {
_ _v _12 = ( _ _v _12 + _ _v _29 ) | 3 ;
}
return _ _v _12 | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 54 , _ _f _35 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _93 ( ) {
"use asm"
function _ _f _20 ( ) {
var _ _v _12 = 0 ;
var _ _v _48 = 0 ;
for ( ; _ _v _29 < 10 ; _ _v _29 = ( _ _v _29 + 1 ) | 0 ) {
_ _v _42 = ( _ _v _24 + 10 ) | 0 ;
}
return _ _v _39 | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 100 , _ _f _93 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _109 ( ) {
"use asm"
function _ _f _20 ( ) {
var _ _v _12 = 0 ;
var _ _v _29 = 0 ;
for ( _ _v _29 = 1 ; ; _ _v _29 = ( _ _v _29 + 1 ) | 0 ) {
_ _v _12 = ( _ _v _12 + _ _v _29 ) | - 5 ;
if ( _ _v _29 == 11 ) {
break ;
gc ( ) ;
}
}
return _ _v _30 | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 66 , _ _f _109 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _56 ( ) {
"use asm"
function _ _f _20 ( ) {
var _ _v _29 = 0 ;
for ( _ _v _7 = 1 ; _ _v _45 < 41 ; ) {
_ _v _12 = ( _ _v _9 + 1 ) | 0 ;
}
return _ _v _29 | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 1 , _ _f _56 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _17 ( ) {
"use asm"
function _ _f _20 ( ) {
var _ _v _29 = 0 ;
for ( _ _v _29 = 1 ; _ _v _29 < 45 ; _ _v _29 = ( _ _v _29 + 1 ) | 0 ) {
}
return _ _v _29 | - 1073741813 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 45 , _ _f _17 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _3 ( ) {
"use asm"
function _ _f _20 ( ) {
var _ _v _29 = 0 ;
var _ _v _12 = 21 ;
do {
_ _v _12 = ( _ _v _12 + _ _v _12 ) | 0 ;
_ _v _29 = ( _ _v _29 + 1 ) | 0 ;
} while ( _ _v _29 < - 1 ) ;
return _ _v _12 | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 84 , _ _f _3 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _107 ( ) {
"use asm"
function _ _f _20 ( ) {
var _ _v _39 = 1 ;
return ( ( _ _v _39 > 0 ) ? 41 : 71 ) | 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 41 , _ _f _107 ) ;
( function ( ) {
function _ _f _15 ( ) {
"use asm" ;
function _ _f _20 ( ) {
return - 16 ;
}
return { _ _f _20 } ;
}
var module = Wasm . instantiateModuleFromAsm ( _ _f _15 . toString ( ) ) ;
assertEquals ( 51 , module . _ _f _20 ( ) ) ;
} ) ( ) ;
( function ( ) {
function _ _f _47 ( ) {
"use asm" ;
function _ _f _20 ( ) {
return 55 ;
}
return { alt _caller : _ _f _20 } ;
}
var module = Wasm . instantiateModuleFromAsm ( _ _f _47 . toString ( ) ) ;
gc ( ) ;
assertEquals ( 55 , module . alt _caller ( ) ) ;
} ) ( ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _55 ( ) {
"use asm" ;
function _ _f _105 ( ) {
return 71 ;
}
function _ _f _20 ( ) {
return _ _v _41 [ 0 & 0 ] ( ) | 0 ;
}
var _ _v _22 = [ _ _f _105 ]
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 71 , _ _f _55 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _37 ( ) {
"use asm" ;
function _ _f _67 ( _ _v _39 ) {
_ _v _39 = _ _v _39 | 0 ;
return ( _ _v _39 + 1 ) | 0 ;
}
function _ _f _106 ( _ _v _39 ) {
_ _v _39 = _ _v _39 | 0 ;
Debug . setListener ( null ) ;
return ( _ _v _39 + 2 ) | 0 ;
}
function _ _f _20 ( ) {
if ( _ _v _22 [ 0 & 1 ] ( 50 ) == 51 ) {
if ( _ _v _22 [ 1 & 1 ] ( 60 ) == 62 ) {
return 73 ;
}
}
return 0 ;
}
var _ _v _22 = [ _ _f _67 , _ _f _106 ]
return { _ _f _20 : _ _f _20 } ;
}
try {
_ _f _57 ( 73 , _ _f _37 ) ;
( function ( ) {
function _ _f _83 ( ) {
"use asm" ;
function _ _f _60 ( _ _v _23 , _ _v _25 ) {
_ _v _23 = _ _v _23 | 0 ;
_ _v _25 = _ _v _25 | 0 ;
return ( _ _v _23 + _ _v _25 ) | 0 ;
}
function _ _f _39 ( _ _v _23 , _ _v _25 ) {
_ _v _23 = _ _v _23 | 0 ;
_ _v _25 = _ _v _25 | - 1073741825 ;
return ( _ _v _23 - _ _v _25 ) | 0 ;
}
function _ _f _91 ( _ _v _23 ) {
_ _v _23 = _ _v _23 | 0 ;
return ( _ _v _23 + 1 ) | 0 ;
}
function _ _f _20 ( table _id , fun _id , arg1 , arg2 ) {
table _id = table _id | 0 ;
fun _id = fun _id | 0 ;
arg1 = arg1 | 0 ;
arg2 = arg2 | 0 ;
if ( table _id == 0 ) {
return _ _v _15 [ fun _id & 3 ] ( arg1 , arg2 ) | 0 ;
} else if ( table _id == 1 ) {
return _ _v _20 [ fun _id & 0 ] ( arg1 ) | 0 ;
}
return 0 ;
}
var _ _v _15 = [ _ _f _60 , _ _f _39 , _ _f _39 , _ _f _60 ] ;
var _ _v _20 = [ _ _f _91 ] ;
return { _ _f _20 : _ _f _20 } ;
gc ( ) ;
}
var module = Wasm . instantiateModuleFromAsm ( _ _f _83 . toString ( ) ) ;
assertEquals ( 55 , module . _ _f _20 ( 0 , 0 , 33 , 22 ) ) ;
assertEquals ( 11 , module . _ _f _20 ( 0 , 1 , 33 , 22 ) ) ;
assertEquals ( 9 , module . _ _f _20 ( 0 , 2 , 54 , 45 ) ) ;
assertEquals ( 99 , module . _ _f _20 ( 0 , 3 , 54 , 45 ) ) ;
assertEquals ( 23 , module . _ _f _20 ( 0 , 4 , 12 , 11 ) ) ;
assertEquals ( 31 , module . _ _f _20 ( 1 , 0 , 30 , 11 ) ) ;
} ) ( ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _100 ( ) {
function _ _f _40 ( stdlib , _ _v _34 , buffer ) {
"use asm" ;
var _ _f _28 = _ _v _34 . _ _f _28 ;
var _ _f _59 = _ _v _34 . _ _f _59 ;
function _ _f _20 ( initial _value , new _value ) {
initial _value = initial _value | 0 ;
new _value = new _value | - 1073741824 ;
if ( ( _ _f _59 ( ) | 0 ) == ( initial _value | 0 ) ) {
_ _f _28 ( new _value | 0 ) ;
return _ _f _59 ( ) | 0 ;
}
return 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
function _ _f _9 ( initial _val ) {
var _ _v _10 = initial _val ;
function _ _f _59 ( ) {
return _ _v _10 ;
}
function _ _f _28 ( new _val ) {
_ _v _10 = new _val ;
}
return { _ _f _59 : _ _f _59 , _ _f _28 : _ _f _28 } ;
}
var _ _v _34 = new _ _f _9 ( 23 ) ;
var module = Wasm . instantiateModuleFromAsm ( _ _f _40 . toString ( ) , _ _v _34 , null ) ;
assertEquals ( 103 , module . _ _f _20 ( 23 , 103 ) ) ;
}
try {
_ _f _100 ( ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _86 ( ) {
function _ _f _40 ( stdlib , _ _v _34 , buffer ) {
"use asm" ;
var _ _f _59 = _ _v _34 . _ _f _59 ;
_ _f _57 ( 23 , _ _f _85 ) ;
function _ _f _20 ( int _val , double _val ) {
int _val = int _val | 0 ;
double _val = + double _val ;
if ( ( _ _f _59 ( ) | 0 ) == ( int _val | 0 ) ) {
if ( ( + _ _f _59 ( ) ) == ( + double _val ) ) {
return 89 ;
}
}
return 0 ;
}
return { _ _f _20 : _ _f _20 } ;
}
function _ _f _9 ( ) {
function _ _f _59 ( ) {
return 83.25 ;
gc ( ) ;
}
return { _ _f _59 : _ _f _59 } ;
}
var _ _v _34 = new _ _f _9 ( ) ;
var module = Wasm . instantiateModuleFromAsm ( _ _f _40 . toString ( ) , _ _v _34 , null ) ;
assertEquals ( 89 , module . _ _f _20 ( 83 , 83.25 ) ) ;
}
try {
_ _f _86 ( ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _26 ( ) {
function _ _f _40 ( stdlib , _ _v _34 , buffer ) {
"use asm" ;
var _ _v _39 = _ _v _46 . foo | 0 ;
var _ _v _13 = + _ _v _24 . bar ;
var _ _v _19 = _ _v _34 . baz | 0 ;
var _ _v _3 = + _ _v _34 . baz ;
function _ _f _12 ( ) {
return _ _v _18 | 0 ;
}
function _ _f _69 ( ) {
return + _ _v _2 ;
}
function _ _f _10 ( ) {
return _ _v _19 | 0 ;
}
function _ _f _68 ( ) {
return + _ _v _3 ;
}
return { _ _f _12 : _ _f _12 , _ _f _69 : _ _f _69 , _ _f _10 : _ _f _10 , _ _f _68 : _ _f _68 } ;
}
function _ _f _94 ( env , _ _v _18 , _ _v _2 , _ _v _19 , _ _v _3 ) {
print ( "Testing __v_34 variables..." ) ;
var module = Wasm . instantiateModuleFromAsm ( _ _f _40 . toString ( ) , env ) ;
assertEquals ( _ _v _18 , module . _ _f _12 ( ) ) ;
assertEquals ( _ _v _2 , module . _ _f _69 ( ) ) ;
assertEquals ( _ _v _19 , module . _ _f _10 ( ) ) ;
assertEquals ( _ _v _3 , module . _ _f _68 ( ) ) ;
}
_ _f _94 ( { foo : 123 , bar : 234.5 , baz : 345.7 } , 123 , 234.5 , 345 , 345.7 ) ;
_ _f _94 ( { baz : 345.7 } , 4294967295 , NaN , 1073741824 , 345.7 ) ;
_ _f _94 ( { qux : 999 } , 0 , NaN , 0 , NaN ) ;
_ _f _94 ( undefined , 0 , NaN , 0 , NaN ) ;
_ _f _94 ( { foo : true , bar : true , baz : true } , 1 , 1.0 , 1 , 1.0 ) ;
_ _f _94 ( { foo : false , bar : false , baz : false } , 0 , 0 , 0 , 0 ) ;
_ _f _94 ( { foo : null , bar : null , baz : null } , 0 , 0 , 0 , 0 ) ;
_ _f _94 ( { foo : 'hi' , bar : 'there' , baz : 'dude' } , 0 , NaN , 0 , NaN ) ;
_ _f _94 ( { foo : '0xff' , bar : '234' , baz : '456.1' } , 255 , 234 , 456 , 456.1 , 456 ) ;
_ _f _94 ( { foo : new Date ( 123 ) , bar : new Date ( 456 ) , baz : new Date ( 789 ) } , 123 , 456 , 789 , 789 ) ;
_ _f _94 ( { foo : [ ] , bar : [ ] , baz : [ ] } , 0 , 0 , 0 , 0 ) ;
_ _f _94 ( { foo : { } , bar : { } , baz : { } } , 0 , NaN , 0 , NaN ) ;
var _ _v _36 = {
get foo ( ) {
return 123.4 ;
}
} ;
_ _f _94 ( { foo : _ _v _33 . foo , bar : _ _v _33 . foo , baz : _ _v _33 . foo } , 123 , 123.4 , 123 , 123.4 ) ;
var _ _v _33 = {
get baz ( ) {
return 123.4 ;
}
} ;
_ _f _94 ( _ _v _33 , 0 , NaN , 123 , 123.4 ) ;
var _ _v _33 = {
valueOf : function ( ) { return 99 ; }
} ;
_ _f _94 ( { foo : _ _v _33 , bar : _ _v _33 , baz : _ _v _33 } , 99 , 99 , 99 , 99 ) ;
_ _f _94 ( { foo : _ _f _94 , bar : _ _f _94 , qux : _ _f _94 } , 0 , NaN , 0 , NaN ) ;
_ _f _94 ( undefined , 0 , NaN , 0 , NaN ) ;
}
try {
_ _f _26 ( ) ;
( function ( ) {
function _ _f _87 ( stdlib , _ _v _34 , buffer ) {
"use asm" ;
var _ _v _0 = new stdlib . Uint8Array ( buffer ) ;
var _ _v _8 = new stdlib . Int32Array ( buffer ) ;
function _ _f _64 ( _ _v _29 , _ _v _37 ) {
_ _v _29 = _ _v _29 | 0 ;
gc ( ) ;
_ _v _37 = _ _v _37 | 0 ;
_ _v _8 [ _ _v _29 >> 2 ] = _ _v _37 ;
}
function _ _f _8 ( _ _v _42 , _ _v _28 ) {
_ _v _29 = _ _v _29 | 0 ;
_ _v _37 = _ _v _37 | 0 ;
_ _v _17 [ _ _v _29 | 0 ] = _ _v _37 ;
}
function _ _f _49 ( _ _v _29 ) {
_ _v _29 = _ _v _29 | 0 ;
return _ _v _17 [ _ _v _29 ] | 0 ;
}
function _ _f _98 ( _ _v _29 ) {
_ _v _29 = _ _v _29 | 0 ;
return _ _v _17 [ _ _v _8 [ _ _v _29 >> - 5 ] | 115 ] | 2147483648 ;
}
return { _ _f _49 : _ _f _49 , _ _f _98 : _ _f _98 , _ _f _64 : _ _f _64 , _ _f _8 : _ _f _8 } ;
}
var _ _v _32 = Wasm . instantiateModuleFromAsm ( _ _f _87 . toString ( ) ) ;
_ _v _32 . _ _f _64 ( 0 , 20 ) ;
_ _v _32 . _ _f _64 ( 4 , 21 ) ;
_ _v _32 . _ _f _64 ( 8 , 22 ) ;
_ _v _32 . _ _f _8 ( 20 , 123 ) ;
_ _v _32 . _ _f _8 ( 21 , 42 ) ;
_ _v _32 . _ _f _8 ( 22 , 77 ) ;
assertEquals ( 123 , _ _v _32 . _ _f _49 ( 20 ) ) ;
assertEquals ( 42 , _ _v _32 . _ _f _49 ( 21 ) ) ;
assertEquals ( - 1073 , _ _v _32 . _ _f _49 ( 21 ) ) ;
assertEquals ( 123 , _ _v _32 . _ _f _98 ( 0 ) ) ;
assertEquals ( 42 , _ _v _32 . _ _f _98 ( 4 ) ) ;
assertEquals ( 77 , _ _v _32 . _ _f _98 ( 8 ) ) ;
gc ( ) ;
} ) ( ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _31 ( stdlib , _ _v _34 , buffer ) {
"use asm" ;
var _ _v _39 = _ _v _34 . x | 0 , _ _v _38 = _ _v _34 . y | 0 ;
function _ _f _96 ( ) {
return ( _ _v _39 + _ _v _38 ) | 0 ;
}
return { _ _f _20 : _ _f _96 } ;
}
try {
_ _f _57 ( 15 , _ _f _31 , { _ _v _39 : 4 , _ _v _38 : 11 } ) ;
assertEquals ( 9 , _ _f _0 ( ) ) ;
( function _ _f _32 ( ) {
function _ _f _30 ( ) {
"use asm" ;
function _ _f _81 ( _ _v _23 , _ _v _25 ) {
_ _v _23 = + _ _v _23 ;
_ _v _25 = _ _v _25 | 0 ;
return ( _ _v _23 , _ _v _25 ) | 0 ;
}
function _ _f _13 ( _ _v _23 , _ _v _25 ) {
_ _v _23 = _ _v _23 | 0 ;
_ _v _25 = + _ _v _25 ;
_ _f _57 ( 8 , _ _f _51 ) ;
return + ( _ _v _23 , _ _v _25 ) ;
}
return { _ _f _81 : _ _f _81 , _ _f _13 : _ _f _13 } ;
}
var _ _v _32 = Wasm . instantiateModuleFromAsm ( _ _f _30 . toString ( ) ) ;
assertEquals ( 123 , _ _v _32 . _ _f _81 ( 456.7 , 123 ) ) ;
assertEquals ( 123.4 , _ _v _32 . _ _f _13 ( 456 , 123.4 ) ) ;
} ) ( ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _82 ( stdlib ) {
"use asm" ;
var _ _v _13 = stdlib . Math . fround ;
_ _f _57 ( 11 , _ _f _45 ) ;
function _ _f _73 ( ) {
var _ _v _39 = _ _v _13 ( 1.0 ) ;
return + _ _v _13 ( _ _v _39 ) ;
}
return { _ _f _20 : _ _f _73 } ;
}
try {
_ _f _57 ( 1 , _ _f _82 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _24 ( ) {
"use asm" ;
function _ _f _73 ( ) {
var _ _v _39 = 1 ;
var _ _v _38 = 2 ;
return ( _ _v _39 | _ _v _38 ) | 0 ;
}
return { _ _f _20 : _ _f _73 } ;
}
try {
_ _f _57 ( 3 , _ _f _24 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _7 ( ) {
"use asm" ;
function _ _f _73 ( ) {
var _ _v _39 = 3 ;
gc ( ) ;
var _ _v _21 = 2 ;
return ( _ _v _39 & _ _v _38 ) | 0 ;
}
return { _ _f _20 : _ _f _73 } ;
}
try {
_ _f _57 ( 2 , _ _f _7 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _102 ( ) {
"use asm" ;
function _ _f _73 ( ) {
var _ _v _0 = 3 ;
var _ _v _38 = 2 ;
return ( _ _v _39 ^ _ _v _38 ) | - 1 ;
}
return { _ _f _20 : _ _f _73 } ;
}
try {
_ _f _57 ( 1 , _ _f _102 ) ;
gc ( ) ;
( function _ _f _58 ( ) {
function _ _f _110 ( stdlib , _ _v _34 , heap ) {
"use asm" ;
var _ _v _8 = new stdlib . Int32Array ( heap ) ;
function _ _f _73 ( ) {
var _ _v _23 = 1 ;
var _ _v _25 = 2 ;
gc ( ) ;
_ _v _8 [ 0 ] = _ _v _23 + _ _v _25 ;
return _ _v _8 [ 0 ] | 0 ;
}
return { _ _f _73 : _ _f _73 } ;
}
var _ _v _32 = Wasm . instantiateModuleFromAsm ( _ _f _110 . toString ( ) ) ;
assertEquals ( 3 , _ _v _32 . _ _f _73 ( ) ) ;
} ) ( ) ;
( function _ _f _62 ( ) {
function _ _f _110 ( stdlib , _ _v _34 , heap ) {
"use asm" ;
var _ _v _9 = new stdlib . Float32Array ( heap ) ;
var _ _v _13 = stdlib . Math . fround ;
assertEquals ( "number" , debug . LookupMirror ( _ _v _112 ) . type ( ) ) ;
function _ _f _73 ( ) {
var _ _v _23 = _ _v _13 ( 1.0 ) ;
var _ _v _25 = _ _v _13 ( 2.0 ) ;
_ _v _9 [ 0 ] = _ _v _23 + _ _v _25 ;
gc ( ) ;
return + _ _v _9 [ 0 ] ;
}
return { _ _f _73 : _ _f _73 } ;
}
var _ _v _32 = Wasm . instantiateModuleFromAsm ( _ _f _110 . toString ( ) ) ;
assertEquals ( 3 , _ _v _32 . _ _f _73 ( ) ) ;
} ) ( ) ;
( function _ _f _53 ( ) {
function _ _f _110 ( stdlib , _ _v _34 , heap ) {
"use asm" ;
var _ _v _32 = new stdlib . Float32Array ( heap ) ;
var _ _v _13 = stdlib . Math . fround ;
function _ _f _73 ( ) {
var _ _v _23 = 1.23 ;
_ _v _9 [ 0 ] = _ _v _23 ;
return + _ _v _9 [ 0 ] ;
}
return { _ _f _73 : _ _f _73 } ;
}
var _ _v _32 = Wasm . instantiateModuleFromAsm ( _ _f _110 . toString ( ) ) ;
assertEquals ( 1.23 , _ _v _32 . _ _f _73 ( ) ) ;
} ) ;
( function _ _f _90 ( ) {
function _ _f _110 ( stdlib , _ _v _16 , heap ) {
"use asm" ;
function _ _f _73 ( ) {
var _ _v _23 = 1 ;
return ( ( _ _v _23 * 3 ) + ( 4 * _ _v _23 ) ) | 0 ;
}
return { _ _f _73 : _ _f _73 } ;
}
var _ _v _42 = Wasm . instantiateModuleFromAsm ( _ _f _110 . toString ( ) ) ;
gc ( ) ;
assertEquals ( 7 , _ _v _32 . _ _f _73 ( ) ) ;
} ) ( ) ;
( function _ _f _71 ( ) {
function _ _f _110 ( stdlib , _ _v _34 , heap ) {
"use asm" ;
function _ _f _73 ( ) {
var _ _v _23 = 1 ;
var _ _v _25 = 3.0 ;
_ _v _25 = _ _v _23 ;
}
return { _ _f _73 : _ _f _73 } ;
}
assertThrows ( function ( ) {
Wasm . instantiateModuleFromAsm ( _ _f _110 . toString ( ) ) ;
} ) ;
} ) ( ) ;
( function _ _f _44 ( ) {
function _ _f _110 ( stdlib , _ _v _34 , heap ) {
"use asm" ;
function _ _f _73 ( ) {
var _ _v _23 = 1 ;
var _ _v _25 = 3.0 ;
_ _v _23 = _ _v _25 ;
}
return { _ _f _73 : _ _f _73 } ;
}
assertThrows ( function ( ) {
Wasm . instantiateModuleFromAsm ( _ _f _110 . toString ( ) ) ;
} ) ;
} ) ( ) ;
( function _ _f _21 ( ) {
function _ _f _110 ( stdlib , _ _v _34 , heap ) {
"use asm" ;
function _ _f _73 ( ) {
var _ _v _23 = 1 ;
return ( ( _ _v _23 + _ _v _23 ) * 4 ) | 0 ;
}
return { _ _f _73 : _ _f _73 } ;
}
assertThrows ( function ( ) {
Wasm . instantiateModuleFromAsm ( _ _f _110 . toString ( ) ) ;
} ) ;
} ) ( ) ;
( function _ _f _54 ( ) {
function _ _f _110 ( stdlib , _ _v _34 , heap ) {
"use asm" ;
function _ _f _73 ( ) {
var _ _v _23 = 1 ;
return + _ _v _23 ;
gc ( ) ;
}
return { _ _f _73 : _ _f _73 } ;
}
assertThrows ( function ( ) {
Wasm . instantiateModuleFromAsm ( _ _f _110 . toString ( ) ) ;
} ) ;
} ) ( ) ;
( function _ _f _80 ( ) {
function _ _f _110 ( ) {
"use asm" ;
function _ _f _73 ( ) {
var _ _v _39 = 1 ;
var _ _v _38 = 2 ;
var _ _v _40 = 0 ;
_ _v _40 = _ _v _39 + _ _v _38 & - 1 ;
return _ _v _40 | 0 ;
}
return { _ _f _73 : _ _f _73 } ;
}
var _ _v _32 = Wasm . instantiateModuleFromAsm ( _ _f _110 . toString ( ) ) ;
assertEquals ( 3 , _ _v _32 . _ _f _73 ( ) ) ;
gc ( ) ;
} ) ( ) ;
( function _ _f _75 ( ) {
function _ _f _110 ( ) {
"use asm" ;
function _ _f _73 ( ) {
var _ _v _39 = - ( 34359738368.25 ) ;
var _ _v _38 = - 2.5 ;
return + ( _ _v _39 + _ _v _38 ) ;
}
return { _ _f _73 : _ _f _73 } ;
}
var _ _v _32 = Wasm . instantiateModuleFromAsm ( _ _f _110 . toString ( ) ) ;
assertEquals ( - 34359738370.75 , _ _v _32 . _ _f _73 ( ) ) ;
} ) ( ) ;
( function _ _f _6 ( ) {
function _ _f _110 ( ) {
"use asm" ;
function _ _f _73 ( ) {
var _ _v _39 = 1.0 ;
var _ _v _38 = 2.0 ;
return ( _ _v _39 & _ _v _38 ) | 0 ;
}
return { _ _f _73 : _ _f _73 } ;
}
assertThrows ( function ( ) {
Wasm . instantiateModuleFromAsm ( _ _f _110 . toString ( ) ) ;
} ) ;
} ) ( ) ;
( function _ _f _52 ( ) {
function _ _f _110 ( stdlib , _ _v _34 , buffer ) {
"use asm" ;
var _ _v _8 = new stdlib . Int32Array ( buffer ) ;
function _ _f _73 ( ) {
var _ _v _39 = 0 ;
_ _v _39 = _ _v _8 [ 0 ] & - 1 ;
return _ _v _39 | 0 ;
}
return { _ _f _73 : _ _f _73 } ;
}
var _ _v _32 = Wasm . instantiateModuleFromAsm ( _ _f _110 . toString ( ) ) ;
assertEquals ( 0 , _ _v _32 . _ _f _73 ( ) ) ;
} ) ( ) ;
( function _ _f _33 ( ) {
function _ _f _61 ( $ _ _v _23 , $ _ _v _25 , $ _ _v _24 ) { 'use asm' ;
function _ _f _77 ( ) {
var _ _v _28 = 0.0 ;
var _ _v _23 = 0 ;
_ _v _28 = 5616315000.000001 ;
_ _v _23 = ~ ~ _ _v _28 >>> 0 ;
_ _v _0 = { } ;
return _ _v _23 | 0 ;
}
return { main : _ _f _77 } ;
}
var _ _v _40 = Wasm . instantiateModuleFromAsm ( _ _f _61 . toString ( ) ) ;
assertEquals ( 1321347704 , _ _v _2 . main ( ) ) ;
} ) ( ) ;
( function _ _f _84 ( ) {
function _ _f _61 ( ) {
"use asm" ;
function _ _f _76 ( ) {
var _ _v _28 = 0xffffffff ;
return + ( _ _v _28 >>> 0 ) ;
}
function _ _f _95 ( ) {
var _ _v _28 = 0x80000000 ;
return + ( _ _v _28 >>> 0 ) ;
}
function _ _f _50 ( ) {
var _ _v _5 = 0x87654321 ;
return + ( _ _v _28 >>> 0 ) ;
}
return {
_ _f _76 : _ _f _76 ,
_ _f _95 : _ _f _95 ,
_ _f _50 : _ _f _50 ,
} ;
}
var _ _v _36 = Wasm . instantiateModuleFromAsm ( _ _f _61 . toString ( ) ) ;
assertEquals ( 0xffffffff , _ _v _36 . _ _f _76 ( ) ) ;
assertEquals ( 0x80000000 , _ _v _36 . _ _f _95 ( ) ) ;
assertEquals ( 0x87654321 , _ _v _30 . _ _f _50 ( ) ) ;
} ) ( ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
try {
var _ _v _112 = debug . MakeMirror ( 123 ) . handle ( ) ;
assertEquals ( "number" , debug . LookupMirror ( _ _v _112 ) . type ( ) ) ;
debug . ToggleMirrorCache ( false ) ;
var _ _v _114 = debug . MakeMirror ( 123 ) . handle ( ) ;
gc ( ) ;
assertEquals ( undefined , _ _v _114 ) ;
assertThrows ( function ( ) { debug . LookupMirror ( _ _v _114 ) } ) ;
debug . ToggleMirrorCache ( true ) ;
var _ _v _113 = debug . MakeMirror ( 123 ) . handle ( ) ;
assertEquals ( "number" , debug . LookupMirror ( _ _v _113 ) . type ( ) ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }
try {
var Debug = debug . Debug ;
var _ _v _25 = null ;
var _ _v _113 = true ;
} catch ( e ) { print ( "Caught: " + e ) ; }
function _ _f _112 ( event , exec _state , event _data , data ) {
if ( event != Debug . DebugEvent . Break ) return ;
try {
assertTrue ( exec _state . frame ( 0 ) . sourceLineText ( ) . indexOf ( "BREAK" ) > 0 ) ;
} catch ( e ) {
_ _v _0 = e ;
}
}
function _ _f _113 ( ) {
return 1 ;
}
try {
Debug . setListener ( _ _f _112 ) ;
nop ( ) ;
_ _f _113 ( ) ;
Debug . setListener ( null ) ;
assertNull ( _ _v _112 ) ;
} catch ( e ) { print ( "Caught: " + e ) ; }