summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/dot_s/alternate-lcomm.wast2
-rw-r--r--test/dot_s/asm_const.wast2
-rw-r--r--test/dot_s/basics.s7
-rw-r--r--test/dot_s/basics.wast6
-rw-r--r--test/dot_s/call.wast2
-rw-r--r--test/dot_s/cfg-stackify.wast4
-rw-r--r--test/dot_s/comparisons_f32.wast2
-rw-r--r--test/dot_s/comparisons_f64.wast2
-rw-r--r--test/dot_s/comparisons_i32.wast2
-rw-r--r--test/dot_s/comparisons_i64.wast2
-rw-r--r--test/dot_s/conv.wast2
-rw-r--r--test/dot_s/copysign-casts.wast2
-rw-r--r--test/dot_s/cpus.wast2
-rw-r--r--test/dot_s/data-offset-folding.wast4
-rw-r--r--test/dot_s/dead-vreg.wast2
-rw-r--r--test/dot_s/exit.wast2
-rw-r--r--test/dot_s/f32.wast2
-rw-r--r--test/dot_s/f64.wast2
-rw-r--r--test/dot_s/fast-isel.wast2
-rw-r--r--test/dot_s/frem.wast2
-rw-r--r--test/dot_s/func.wast2
-rw-r--r--test/dot_s/global.wast4
-rw-r--r--test/dot_s/globl.wast2
-rw-r--r--test/dot_s/i32.wast2
-rw-r--r--test/dot_s/i64.wast2
-rw-r--r--test/dot_s/ident.wast2
-rw-r--r--test/dot_s/immediates.wast2
-rw-r--r--test/dot_s/lcomm-in-text-segment.wast2
-rw-r--r--test/dot_s/legalize.wast2
-rw-r--r--test/dot_s/load-ext.wast22
-rw-r--r--test/dot_s/load-store-i1.wast10
-rw-r--r--test/dot_s/load.wast2
-rw-r--r--test/dot_s/memops.wast4
-rw-r--r--test/dot_s/memory-addr32.wast2
-rw-r--r--test/dot_s/memory-addr64.wast2
-rw-r--r--test/dot_s/minimal.wast2
-rw-r--r--test/dot_s/offset.wast12
-rw-r--r--test/dot_s/permute.wast4
-rw-r--r--test/dot_s/phi.wast2
-rw-r--r--test/dot_s/reg-stackify.wast2
-rw-r--r--test/dot_s/relocation.wast6
-rw-r--r--test/dot_s/return-int32.wast2
-rw-r--r--test/dot_s/return-void.wast2
-rw-r--r--test/dot_s/returned.wast2
-rw-r--r--test/dot_s/select.wast2
-rw-r--r--test/dot_s/signext-zeroext.wast2
-rw-r--r--test/dot_s/store-results.wast6
-rw-r--r--test/dot_s/store-trunc.wast2
-rw-r--r--test/dot_s/store.wast2
-rw-r--r--test/dot_s/switch.wast2
-rw-r--r--test/dot_s/symbolic-offset.wast6
-rw-r--r--test/dot_s/unreachable.wast2
-rw-r--r--test/dot_s/unused-argument.wast2
-rw-r--r--test/dot_s/varargs.wast2
-rw-r--r--test/dot_s/vtable.wast12
-rw-r--r--test/unit.2asm.js1
-rw-r--r--test/unit.wast3
-rw-r--r--test/wasm_backend/globals.cpp21
-rw-r--r--test/wasm_backend/globals.txt5
59 files changed, 128 insertions, 91 deletions
diff --git a/test/dot_s/alternate-lcomm.wast b/test/dot_s/alternate-lcomm.wast
index 0d3c48333..955ce11ea 100644
--- a/test/dot_s/alternate-lcomm.wast
+++ b/test/dot_s/alternate-lcomm.wast
@@ -1,4 +1,4 @@
(module
(memory 0 4294967295)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/asm_const.wast b/test/dot_s/asm_const.wast
index e800f8893..99fe21995 100644
--- a/test/dot_s/asm_const.wast
+++ b/test/dot_s/asm_const.wast
@@ -15,4 +15,4 @@
)
)
)
-;; METADATA: { "asmConsts": {"0": ["{ Module.print(\"hello, world!\"); }", ["vi"]]} }
+;; METADATA: { "asmConsts": {"0": ["{ Module.print(\"hello, world!\"); }", ["vi"]]},"staticBump": 50 }
diff --git a/test/dot_s/basics.s b/test/dot_s/basics.s
index b9c3baeed..c4f6776d6 100644
--- a/test/dot_s/basics.s
+++ b/test/dot_s/basics.s
@@ -47,6 +47,7 @@ BB0_3: # in Loop: Header=BB0_1 Depth=1
BB0_4:
i32.const $push11=, -12
i32.add $0=, $0, $pop11
+ i32.const $discard=, main # just take address for testing
BB0_5: # %.loopexit
return $0
func_end0:
@@ -58,4 +59,10 @@ func_end0:
.asciz "hello, world!\n"
.size .str, 15
+ .type a2,@object # @a2
+ .globl a2
+a2:
+ .int8 118 # 0x76
+ .ascii "cq"
+ .size a2, 3 # surprisingly large size
diff --git a/test/dot_s/basics.wast b/test/dot_s/basics.wast
index 7ac7ecc6e..7e59854d8 100644
--- a/test/dot_s/basics.wast
+++ b/test/dot_s/basics.wast
@@ -1,7 +1,8 @@
(module
- (memory 0 4294967295 (segment 16 "hello, world!\n\00"))
+ (memory 0 4294967295 (segment 16 "hello, world!\n\00") (segment 32 "vcq"))
(import $puts "env" "puts")
(export "main" $main)
+ (table $main)
(func $main (param $$0 i32) (param $$1 i32) (result i32)
(block $fake_return_waka123
(block
@@ -84,6 +85,7 @@
(i32.const -12)
)
)
+ (i32.const 1)
)
(br $fake_return_waka123
(get_local $$0)
@@ -92,4 +94,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 34 }
diff --git a/test/dot_s/call.wast b/test/dot_s/call.wast
index e7fa949cc..40ab83553 100644
--- a/test/dot_s/call.wast
+++ b/test/dot_s/call.wast
@@ -134,4 +134,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/cfg-stackify.wast b/test/dot_s/cfg-stackify.wast
index e170415cf..82fe8789b 100644
--- a/test/dot_s/cfg-stackify.wast
+++ b/test/dot_s/cfg-stackify.wast
@@ -1048,7 +1048,7 @@
(loop $BB21_8 $BB21_1
(block
(set_local $$1
- (i32.load align=8
+ (i32.load8_u align=1
(get_local $$0)
)
)
@@ -1150,4 +1150,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/comparisons_f32.wast b/test/dot_s/comparisons_f32.wast
index 83574f9b4..6a050b39f 100644
--- a/test/dot_s/comparisons_f32.wast
+++ b/test/dot_s/comparisons_f32.wast
@@ -267,4 +267,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/comparisons_f64.wast b/test/dot_s/comparisons_f64.wast
index ea85676da..29fb60481 100644
--- a/test/dot_s/comparisons_f64.wast
+++ b/test/dot_s/comparisons_f64.wast
@@ -267,4 +267,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/comparisons_i32.wast b/test/dot_s/comparisons_i32.wast
index c821cfad7..65fc3bad2 100644
--- a/test/dot_s/comparisons_i32.wast
+++ b/test/dot_s/comparisons_i32.wast
@@ -131,4 +131,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/comparisons_i64.wast b/test/dot_s/comparisons_i64.wast
index 16da05ef5..63166a543 100644
--- a/test/dot_s/comparisons_i64.wast
+++ b/test/dot_s/comparisons_i64.wast
@@ -131,4 +131,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/conv.wast b/test/dot_s/conv.wast
index d5933fd7e..0fe9776ff 100644
--- a/test/dot_s/conv.wast
+++ b/test/dot_s/conv.wast
@@ -316,4 +316,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/copysign-casts.wast b/test/dot_s/copysign-casts.wast
index 31f6145b4..0bee77732 100644
--- a/test/dot_s/copysign-casts.wast
+++ b/test/dot_s/copysign-casts.wast
@@ -31,4 +31,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/cpus.wast b/test/dot_s/cpus.wast
index aed7f5870..736a887bd 100644
--- a/test/dot_s/cpus.wast
+++ b/test/dot_s/cpus.wast
@@ -11,4 +11,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/data-offset-folding.wast b/test/dot_s/data-offset-folding.wast
index e0a60c70e..059d0e41c 100644
--- a/test/dot_s/data-offset-folding.wast
+++ b/test/dot_s/data-offset-folding.wast
@@ -1,4 +1,4 @@
(module
- (memory 0 4294967295 (segment 2 "\00\00\00\00") (segment 408 "X\00\00\00"))
+ (memory 0 4294967295 (segment 4 "\00\00\00\00") (segment 416 "`\00\00\00"))
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 419 }
diff --git a/test/dot_s/dead-vreg.wast b/test/dot_s/dead-vreg.wast
index ced7413ab..ad270b31a 100644
--- a/test/dot_s/dead-vreg.wast
+++ b/test/dot_s/dead-vreg.wast
@@ -111,4 +111,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/exit.wast b/test/dot_s/exit.wast
index c0af5a734..6b7d22bf3 100644
--- a/test/dot_s/exit.wast
+++ b/test/dot_s/exit.wast
@@ -11,4 +11,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/f32.wast b/test/dot_s/f32.wast
index e9e9a649e..aa0ec5920 100644
--- a/test/dot_s/f32.wast
+++ b/test/dot_s/f32.wast
@@ -203,4 +203,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/f64.wast b/test/dot_s/f64.wast
index 6541b20b8..5b8de4546 100644
--- a/test/dot_s/f64.wast
+++ b/test/dot_s/f64.wast
@@ -203,4 +203,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/fast-isel.wast b/test/dot_s/fast-isel.wast
index 0981fbe79..a172ea5e2 100644
--- a/test/dot_s/fast-isel.wast
+++ b/test/dot_s/fast-isel.wast
@@ -21,4 +21,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/frem.wast b/test/dot_s/frem.wast
index 6592622d0..8ba5ad97d 100644
--- a/test/dot_s/frem.wast
+++ b/test/dot_s/frem.wast
@@ -29,4 +29,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/func.wast b/test/dot_s/func.wast
index 0090df642..18402d018 100644
--- a/test/dot_s/func.wast
+++ b/test/dot_s/func.wast
@@ -72,4 +72,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/global.wast b/test/dot_s/global.wast
index 255b35617..63cec281a 100644
--- a/test/dot_s/global.wast
+++ b/test/dot_s/global.wast
@@ -1,5 +1,5 @@
(module
- (memory 0 4294967295 (segment 2 "9\05\00\00"))
+ (memory 0 4294967295 (segment 4 "9\05\00\00"))
(import $memcpy "env" "memcpy")
(export "foo" $foo)
(export "call_memcpy" $call_memcpy)
@@ -29,4 +29,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 11 }
diff --git a/test/dot_s/globl.wast b/test/dot_s/globl.wast
index 874d99a2b..b36657b8f 100644
--- a/test/dot_s/globl.wast
+++ b/test/dot_s/globl.wast
@@ -9,4 +9,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/i32.wast b/test/dot_s/i32.wast
index 6025fedd7..7466c5b6c 100644
--- a/test/dot_s/i32.wast
+++ b/test/dot_s/i32.wast
@@ -230,4 +230,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/i64.wast b/test/dot_s/i64.wast
index ace3135f3..d193b2cb5 100644
--- a/test/dot_s/i64.wast
+++ b/test/dot_s/i64.wast
@@ -230,4 +230,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/ident.wast b/test/dot_s/ident.wast
index 0d3c48333..955ce11ea 100644
--- a/test/dot_s/ident.wast
+++ b/test/dot_s/ident.wast
@@ -1,4 +1,4 @@
(module
(memory 0 4294967295)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/immediates.wast b/test/dot_s/immediates.wast
index ce9b8520f..257421fd9 100644
--- a/test/dot_s/immediates.wast
+++ b/test/dot_s/immediates.wast
@@ -241,4 +241,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/lcomm-in-text-segment.wast b/test/dot_s/lcomm-in-text-segment.wast
index 0d3c48333..955ce11ea 100644
--- a/test/dot_s/lcomm-in-text-segment.wast
+++ b/test/dot_s/lcomm-in-text-segment.wast
@@ -1,4 +1,4 @@
(module
(memory 0 4294967295)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/legalize.wast b/test/dot_s/legalize.wast
index 2fcc9aeac..72230965a 100644
--- a/test/dot_s/legalize.wast
+++ b/test/dot_s/legalize.wast
@@ -3972,4 +3972,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/load-ext.wast b/test/dot_s/load-ext.wast
index e569cfd33..422828010 100644
--- a/test/dot_s/load-ext.wast
+++ b/test/dot_s/load-ext.wast
@@ -14,7 +14,7 @@
(block $fake_return_waka123
(block
(br $fake_return_waka123
- (i32.load align=8
+ (i32.load8_s align=1
(get_local $$0)
)
)
@@ -25,7 +25,7 @@
(block $fake_return_waka123
(block
(br $fake_return_waka123
- (i32.load align=8
+ (i32.load8_u align=1
(get_local $$0)
)
)
@@ -36,7 +36,7 @@
(block $fake_return_waka123
(block
(br $fake_return_waka123
- (i32.load align=16
+ (i32.load16_s align=2
(get_local $$0)
)
)
@@ -47,7 +47,7 @@
(block $fake_return_waka123
(block
(br $fake_return_waka123
- (i32.load align=16
+ (i32.load16_u align=2
(get_local $$0)
)
)
@@ -58,7 +58,7 @@
(block $fake_return_waka123
(block
(br $fake_return_waka123
- (i64.load align=8
+ (i64.load8_s align=1
(get_local $$0)
)
)
@@ -69,7 +69,7 @@
(block $fake_return_waka123
(block
(br $fake_return_waka123
- (i64.load align=8
+ (i64.load8_u align=1
(get_local $$0)
)
)
@@ -80,7 +80,7 @@
(block $fake_return_waka123
(block
(br $fake_return_waka123
- (i64.load align=16
+ (i64.load16_s align=2
(get_local $$0)
)
)
@@ -91,7 +91,7 @@
(block $fake_return_waka123
(block
(br $fake_return_waka123
- (i64.load align=16
+ (i64.load16_u align=2
(get_local $$0)
)
)
@@ -102,7 +102,7 @@
(block $fake_return_waka123
(block
(br $fake_return_waka123
- (i64.load align=32
+ (i64.load align=4
(get_local $$0)
)
)
@@ -113,7 +113,7 @@
(block $fake_return_waka123
(block
(br $fake_return_waka123
- (i64.load align=32
+ (i64.load align=4
(get_local $$0)
)
)
@@ -121,4 +121,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/load-store-i1.wast b/test/dot_s/load-store-i1.wast
index 644fe798b..d9b67382b 100644
--- a/test/dot_s/load-store-i1.wast
+++ b/test/dot_s/load-store-i1.wast
@@ -10,7 +10,7 @@
(block $fake_return_waka123
(block
(br $fake_return_waka123
- (i32.load align=8
+ (i32.load8_u align=1
(get_local $$0)
)
)
@@ -27,7 +27,7 @@
(br $fake_return_waka123
(i32.shr_s
(i32.shl
- (i32.load align=8
+ (i32.load8_u align=1
(get_local $$0)
)
(get_local $$1)
@@ -42,7 +42,7 @@
(block $fake_return_waka123
(block
(br $fake_return_waka123
- (i64.load align=8
+ (i64.load8_u align=1
(get_local $$0)
)
)
@@ -59,7 +59,7 @@
(br $fake_return_waka123
(i64.shr_s
(i64.shl
- (i64.load align=8
+ (i64.load8_u align=1
(get_local $$0)
)
(get_local $$1)
@@ -99,4 +99,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/load.wast b/test/dot_s/load.wast
index 4d2071d41..ac52dcda0 100644
--- a/test/dot_s/load.wast
+++ b/test/dot_s/load.wast
@@ -49,4 +49,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/memops.wast b/test/dot_s/memops.wast
index 4f23804b7..6f0c884f4 100644
--- a/test/dot_s/memops.wast
+++ b/test/dot_s/memops.wast
@@ -132,7 +132,7 @@
(set_local $$6
(i32.add
(i32.and
- (i32.load align=8
+ (i32.load8_u align=1
(i32.add
(get_local $$11)
(get_local $$5)
@@ -219,4 +219,4 @@
)
)
)
-;; METADATA: { "asmConsts": {"0": ["{ Module.print(\"hello, world! \" + HEAP32[8>>2]); }", ["vi"]]} }
+;; METADATA: { "asmConsts": {"0": ["{ Module.print(\"hello, world! \" + HEAP32[8>>2]); }", ["vi"]]},"staticBump": 66 }
diff --git a/test/dot_s/memory-addr32.wast b/test/dot_s/memory-addr32.wast
index bd182046b..c056c10d9 100644
--- a/test/dot_s/memory-addr32.wast
+++ b/test/dot_s/memory-addr32.wast
@@ -20,4 +20,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/memory-addr64.wast b/test/dot_s/memory-addr64.wast
index 03a27c8ed..49c56ea9b 100644
--- a/test/dot_s/memory-addr64.wast
+++ b/test/dot_s/memory-addr64.wast
@@ -20,4 +20,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/minimal.wast b/test/dot_s/minimal.wast
index ef408ea14..67e714d3f 100644
--- a/test/dot_s/minimal.wast
+++ b/test/dot_s/minimal.wast
@@ -11,4 +11,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/offset.wast b/test/dot_s/offset.wast
index d8a1a4a7a..432216519 100644
--- a/test/dot_s/offset.wast
+++ b/test/dot_s/offset.wast
@@ -1,5 +1,5 @@
(module
- (memory 0 4294967295 (segment 2 "\00\00\00\00"))
+ (memory 0 4294967295 (segment 4 "\00\00\00\00"))
(export "load_i32_with_folded_offset" $load_i32_with_folded_offset)
(export "load_i32_with_unfolded_offset" $load_i32_with_unfolded_offset)
(export "load_i64_with_folded_offset" $load_i64_with_folded_offset)
@@ -130,7 +130,7 @@
(block $fake_return_waka123
(block
(br $fake_return_waka123
- (i32.load align=4 offset=2
+ (i32.load align=4 offset=4
(i32.const 0)
)
)
@@ -159,7 +159,7 @@
(set_local $$0
(i32.const 0)
)
- (i32.store align=4 offset=2
+ (i32.store align=4 offset=4
(get_local $$0)
(get_local $$0)
)
@@ -171,7 +171,7 @@
(block $fake_return_waka123
(block
(br $fake_return_waka123
- (i32.load align=8 offset=24
+ (i32.load8_s align=1 offset=24
(get_local $$0)
)
)
@@ -182,7 +182,7 @@
(block $fake_return_waka123
(block
(br $fake_return_waka123
- (i32.load align=8 offset=24
+ (i32.load8_u align=1 offset=24
(get_local $$0)
)
)
@@ -201,4 +201,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 7 }
diff --git a/test/dot_s/permute.wast b/test/dot_s/permute.wast
index e535422c9..2af67ec99 100644
--- a/test/dot_s/permute.wast
+++ b/test/dot_s/permute.wast
@@ -1,4 +1,4 @@
(module
- (memory 0 4294967295 (segment 4 "hE?\8ds\0e7\db[g\8f\955it\c4k\0b\e2\ef\bcld\e0\fd\8c\9e\86&~\d8\94\89+\c8\a4\c2\f2\fb\12\1cej\d99\b7\b3W\c6w\af\ae\caM>\92ub\96\84\b6\b0N\ec;q\11\f7\bf\e31\e6\a7\90\fc\03\e4\aa\d7\cc- \15\83DH\80r\fa\01X\eb:_\00A\cd\e9o`n\ac(\ad\ba0\dcyS#\f4$\"\82\7f}\8e\f6\93L\'\bb\bdZ\ed4\18\f3\c0\cf\ff\a3\f8\07\05\9c\d3\0f\a0\06m%\\\f9^B<\e7\b1\17\98]\0c\dd\c5\f5p\e5\fezJ\ab,F\a5@\08R\85!\b8\1a\ce\d5\04\nI\a6\d1\9f\8a\c9\a9|\97\9aG\be8Y\8b\c1\1b\d4\ea\b9\19\14\9b\9163\d0\1d\d2\df=C\1f\0dc\e1\c7QUv\02\b5aK\b4\tV\c3x\e8\a1\1e\81\de/{\da\d6Pf\10T\f0)\88\16\ee\a8\9d\f1\cbO*\b2\99\132\87.\a2"))
+ (memory 0 4294967295 (segment 16 "hE?\8ds\0e7\db[g\8f\955it\c4k\0b\e2\ef\bcld\e0\fd\8c\9e\86&~\d8\94\89+\c8\a4\c2\f2\fb\12\1cej\d99\b7\b3W\c6w\af\ae\caM>\92ub\96\84\b6\b0N\ec;q\11\f7\bf\e31\e6\a7\90\fc\03\e4\aa\d7\cc- \15\83DH\80r\fa\01X\eb:_\00A\cd\e9o`n\ac(\ad\ba0\dcyS#\f4$\"\82\7f}\8e\f6\93L\'\bb\bdZ\ed4\18\f3\c0\cf\ff\a3\f8\07\05\9c\d3\0f\a0\06m%\\\f9^B<\e7\b1\17\98]\0c\dd\c5\f5p\e5\fezJ\ab,F\a5@\08R\85!\b8\1a\ce\d5\04\nI\a6\d1\9f\8a\c9\a9|\97\9aG\be8Y\8b\c1\1b\d4\ea\b9\19\14\9b\9163\d0\1d\d2\df=C\1f\0dc\e1\c7QUv\02\b5aK\b4\tV\c3x\e8\a1\1e\81\de/{\da\d6Pf\10T\f0)\88\16\ee\a8\9d\f1\cbO*\b2\99\132\87.\a2"))
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 271 }
diff --git a/test/dot_s/phi.wast b/test/dot_s/phi.wast
index e5690e69d..9d61cfa77 100644
--- a/test/dot_s/phi.wast
+++ b/test/dot_s/phi.wast
@@ -79,4 +79,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/reg-stackify.wast b/test/dot_s/reg-stackify.wast
index 8306dfc8f..434e704b2 100644
--- a/test/dot_s/reg-stackify.wast
+++ b/test/dot_s/reg-stackify.wast
@@ -118,4 +118,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/relocation.wast b/test/dot_s/relocation.wast
index 2bddedb89..3f667f823 100644
--- a/test/dot_s/relocation.wast
+++ b/test/dot_s/relocation.wast
@@ -1,5 +1,5 @@
(module
- (memory 0 4294967295 (segment 2 "\06\00\00\00") (segment 6 "\02\00\00\00"))
+ (memory 0 4294967295 (segment 4 "\08\00\00\00") (segment 8 "\04\00\00\00"))
(export "main" $main)
(func $main (result i32)
(local $$0 i32)
@@ -7,11 +7,11 @@
(block
(br $fake_return_waka123
(i32.load align=4
- (i32.const 0)
+ (i32.const 8)
)
)
)
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 11 }
diff --git a/test/dot_s/return-int32.wast b/test/dot_s/return-int32.wast
index e9e4e8250..57bf9538b 100644
--- a/test/dot_s/return-int32.wast
+++ b/test/dot_s/return-int32.wast
@@ -11,4 +11,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/return-void.wast b/test/dot_s/return-void.wast
index 0f0c72a49..8cfa247b0 100644
--- a/test/dot_s/return-void.wast
+++ b/test/dot_s/return-void.wast
@@ -9,4 +9,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/returned.wast b/test/dot_s/returned.wast
index 0d73621e3..e63c40964 100644
--- a/test/dot_s/returned.wast
+++ b/test/dot_s/returned.wast
@@ -32,4 +32,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/select.wast b/test/dot_s/select.wast
index 4877c7057..bb5a4e575 100644
--- a/test/dot_s/select.wast
+++ b/test/dot_s/select.wast
@@ -169,4 +169,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/signext-zeroext.wast b/test/dot_s/signext-zeroext.wast
index f4c6ba47f..480223851 100644
--- a/test/dot_s/signext-zeroext.wast
+++ b/test/dot_s/signext-zeroext.wast
@@ -77,4 +77,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/store-results.wast b/test/dot_s/store-results.wast
index 5f801cd3b..7001cd0e7 100644
--- a/test/dot_s/store-results.wast
+++ b/test/dot_s/store-results.wast
@@ -34,7 +34,7 @@
(i32.const 1)
)
)
- (i32.store align=4 offset=2
+ (i32.store align=4 offset=4
(get_local $$0)
(get_local $$0)
)
@@ -70,7 +70,7 @@
(f32.const 1)
)
)
- (i32.store align=4 offset=2
+ (i32.store align=4 offset=4
(get_local $$0)
(get_local $$0)
)
@@ -88,4 +88,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 15 }
diff --git a/test/dot_s/store-trunc.wast b/test/dot_s/store-trunc.wast
index 07807cd19..44b400534 100644
--- a/test/dot_s/store-trunc.wast
+++ b/test/dot_s/store-trunc.wast
@@ -61,4 +61,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/store.wast b/test/dot_s/store.wast
index 256b86fd1..d3a89a131 100644
--- a/test/dot_s/store.wast
+++ b/test/dot_s/store.wast
@@ -49,4 +49,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/switch.wast b/test/dot_s/switch.wast
index ba55e42f3..7be3d417e 100644
--- a/test/dot_s/switch.wast
+++ b/test/dot_s/switch.wast
@@ -97,4 +97,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/symbolic-offset.wast b/test/dot_s/symbolic-offset.wast
index 5b4904529..4dc52e77f 100644
--- a/test/dot_s/symbolic-offset.wast
+++ b/test/dot_s/symbolic-offset.wast
@@ -1,10 +1,10 @@
(module
- (memory 0 4294967295 (segment 2 "\01\00\00\00\00\00\00\00\00\00\00\00"))
+ (memory 0 4294967295 (segment 4 "\01\00\00\00\00\00\00\00\00\00\00\00"))
(export "f" $f)
(func $f (param $$0 i32) (param $$1 i32)
(block $fake_return_waka123
(block
- (i32.store align=4 offset=6
+ (i32.store align=4 offset=8
(get_local $$0)
(get_local $$1)
)
@@ -13,4 +13,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 15 }
diff --git a/test/dot_s/unreachable.wast b/test/dot_s/unreachable.wast
index ec31d0395..d760ef119 100644
--- a/test/dot_s/unreachable.wast
+++ b/test/dot_s/unreachable.wast
@@ -27,4 +27,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/unused-argument.wast b/test/dot_s/unused-argument.wast
index 3d18cee7d..29ebad529 100644
--- a/test/dot_s/unused-argument.wast
+++ b/test/dot_s/unused-argument.wast
@@ -31,4 +31,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/varargs.wast b/test/dot_s/varargs.wast
index f502d0d91..7f5e0cb7e 100644
--- a/test/dot_s/varargs.wast
+++ b/test/dot_s/varargs.wast
@@ -157,4 +157,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 0 }
diff --git a/test/dot_s/vtable.wast b/test/dot_s/vtable.wast
index 0ad2840c6..bf4a08a54 100644
--- a/test/dot_s/vtable.wast
+++ b/test/dot_s/vtable.wast
@@ -1,5 +1,5 @@
(module
- (memory 0 4294967295 (segment 16 "1A\00") (segment 32 "1B\00") (segment 48 "1C\00") (segment 64 "1D\00") (segment 68 "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (segment 88 "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (segment 108 "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (segment 128 "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (segment 150 "\00\00\00\00\10\00\00\00") (segment 159 "\00\00\00\00\00\00\00\00\96\00\00\00") (segment 171 "\00\00\00\00\00\00\00\00\96\00\00\00") (segment 183 "\00\00\00\00\00\00\00\00\9f\00\00\00") (segment 196 "\00\00\00\00"))
+ (memory 0 4294967295 (segment 16 "1A\00") (segment 32 "1B\00") (segment 48 "1C\00") (segment 64 "1D\00") (segment 68 "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (segment 88 "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (segment 108 "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (segment 128 "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (segment 152 "\00\00\00\00\10\00\00\00") (segment 160 "\00\00\00\00\00\00\00\00\98\00\00\00") (segment 176 "\00\00\00\00\00\00\00\00\98\00\00\00") (segment 192 "\00\00\00\00\00\00\00\00\a0\00\00\00") (segment 204 "\00\00\00\00"))
(import $_ZdlPv "env" "_ZdlPv")
(export "_ZN1A3fooEv" $_ZN1A3fooEv)
(export "_ZN1B3fooEv" $_ZN1B3fooEv)
@@ -13,7 +13,7 @@
(func $_ZN1A3fooEv (param $$0 i32)
(block $fake_return_waka123
(block
- (i32.store align=4 offset=196
+ (i32.store align=4 offset=204
(i32.const 0)
(i32.const 2)
)
@@ -24,7 +24,7 @@
(func $_ZN1B3fooEv (param $$0 i32)
(block $fake_return_waka123
(block
- (i32.store align=4 offset=196
+ (i32.store align=4 offset=204
(i32.const 0)
(i32.const 4)
)
@@ -35,7 +35,7 @@
(func $_ZN1C3fooEv (param $$0 i32)
(block $fake_return_waka123
(block
- (i32.store align=4 offset=196
+ (i32.store align=4 offset=204
(i32.const 0)
(i32.const 6)
)
@@ -46,7 +46,7 @@
(func $_ZN1D3fooEv (param $$0 i32)
(block $fake_return_waka123
(block
- (i32.store align=4 offset=196
+ (i32.store align=4 offset=204
(i32.const 0)
(i32.const 8)
)
@@ -104,4 +104,4 @@
)
)
)
-;; METADATA: { "asmConsts": {} }
+;; METADATA: { "asmConsts": {},"staticBump": 207 }
diff --git a/test/unit.2asm.js b/test/unit.2asm.js
index 72eb53461..953437f63 100644
--- a/test/unit.2asm.js
+++ b/test/unit.2asm.js
@@ -12,6 +12,7 @@ function asmFunc(global, env, buffer) {
var Math_fround = global.Math.fround;
var Math_abs = global.Math.abs;
var Math_clz32 = global.Math.clz32;
+ var _emscripten_asm_const_vi = env._emscripten_asm_const_vi;
var f64_to_int = env.f64_to_int;
var f64_rem = env.f64_rem;
function big_negative() {
diff --git a/test/unit.wast b/test/unit.wast
index 488e1de99..4311a2a33 100644
--- a/test/unit.wast
+++ b/test/unit.wast
@@ -1,6 +1,7 @@
(module
- (memory 16777216 16777216)
+ (memory 4096 4096 (segment 1026 "\14\00"))
(type $FUNCSIG$vf (func (param f32)))
+ (import $_emscripten_asm_const_vi "env" "_emscripten_asm_const_vi")
(import $f64-to-int "asm2wasm" "f64-to-int" (param f64) (result i32))
(import $f64-rem "asm2wasm" "f64-rem" (param f64 f64) (result f64))
(export "big_negative" $big_negative)
diff --git a/test/wasm_backend/globals.cpp b/test/wasm_backend/globals.cpp
new file mode 100644
index 000000000..9a2f1bcc8
--- /dev/null
+++ b/test/wasm_backend/globals.cpp
@@ -0,0 +1,21 @@
+#include <emscripten.h>
+
+char c = 10;
+short s = 20;
+int i = 55;
+
+void print(int v) {
+ int *x = (int*)8;
+ *x = v;
+ EM_ASM({
+ Module.print("print: " + HEAP32[8>>2]);
+ });
+}
+
+int main() {
+ print(1);
+ print(c);
+ print(s);
+ print(i);
+}
+
diff --git a/test/wasm_backend/globals.txt b/test/wasm_backend/globals.txt
new file mode 100644
index 000000000..56248691d
--- /dev/null
+++ b/test/wasm_backend/globals.txt
@@ -0,0 +1,5 @@
+print: 1
+print: 10
+print: 20
+print: 55
+