diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-08-19 09:49:38 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-09-07 09:55:03 -0700 |
commit | 266e922cddf0a5c78ed22f046eeebc053a9305c0 (patch) | |
tree | 2dec707b00304b1a6c888efb8f2c1b9a19ce38f3 /test/unit.fromasm.no-opts | |
parent | 9660c200eff60c10266a85aae0637b495c4cba39 (diff) | |
download | binaryen-266e922cddf0a5c78ed22f046eeebc053a9305c0.tar.gz binaryen-266e922cddf0a5c78ed22f046eeebc053a9305c0.tar.bz2 binaryen-266e922cddf0a5c78ed22f046eeebc053a9305c0.zip |
use globals in asm2wasm
Diffstat (limited to 'test/unit.fromasm.no-opts')
-rw-r--r-- | test/unit.fromasm.no-opts | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/test/unit.fromasm.no-opts b/test/unit.fromasm.no-opts index 5fba592a6..56a1d4085 100644 --- a/test/unit.fromasm.no-opts +++ b/test/unit.fromasm.no-opts @@ -6,6 +6,10 @@ (type $FUNCSIG$vf (func (param f32))) (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$vd (func (param f64))) + (import $t global "global" "NaN" f64) + (import $u global "global" "Infinity" f64) + (import $tempDoublePtr global "env" "tempDoublePtr" i32) + (import $n global "env" "gb" i32) (import $abort "env" "abort" (param f64)) (import $print "env" "print" (param i32)) (import $h "env" "h" (param i32)) @@ -15,6 +19,8 @@ (export "big_negative" $big_negative) (export "pick" $exportMe) (export "memory" memory) + (global $Int i32 (i32.const 0)) + (global $Double f64 (f64.const 0)) (table 10 10 anyfunc) (elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg) (func $big_negative @@ -41,31 +47,21 @@ (f64.add (f64.add (f64.add - (f64.load - (i32.const 8) - ) - (f64.load - (i32.const 16) - ) + (get_global $t) + (get_global $u) ) (f64.neg - (f64.load - (i32.const 16) - ) + (get_global $u) ) ) (f64.neg - (f64.load - (i32.const 8) - ) + (get_global $t) ) ) ) (if (i32.gt_s - (i32.load - (i32.const 24) - ) + (get_global $Int) (i32.const 0) ) (return @@ -74,9 +70,7 @@ ) (if (f64.gt - (f64.load - (i32.const 32) - ) + (get_global $Double) (f64.const 0) ) (return @@ -787,9 +781,7 @@ (get_local $a) (i32.add (i32.add - (i32.load - (i32.const 48) - ) + (get_global $n) (i32.const 136) ) (i32.const 8) |