|
1 | 1 | ;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. |
2 | | -;; RUN: wasm-opt %s --post-emscripten -S -o - | filecheck %s |
| 2 | +;; RUN: wasm-opt %s --enable-bulk-memory --post-emscripten -S -o - | filecheck %s |
3 | 3 |
|
4 | 4 | ;; Checks that the start/stop exports are removed and that the data they |
5 | 5 | ;; refer to is either zero'd out, or the segment emptied. |
6 | 6 |
|
| 7 | +;; Two of the segments used here are active, so their offsets are trivial |
| 8 | +;; to dirive. One segment is passive and its offset is derived from the |
| 9 | +;; memory.init instruction. |
| 10 | + |
| 11 | +;; Explictly use a data address that is larger then INT_MAX to verify |
| 12 | +;; that these offset are correctly interpreted as unsigned. |
| 13 | + |
7 | 14 | (module |
8 | 15 | ;; CHECK: (global $em_asm_start i32 (i32.const 1000)) |
9 | 16 | (global $em_asm_start i32 (i32.const 1000)) |
10 | 17 | ;; CHECK: (global $em_asm_stop i32 (i32.const 1011)) |
11 | 18 | (global $em_asm_stop i32 (i32.const 1011)) |
12 | | - ;; CHECK: (global $em_js_start i32 (i32.const 2006)) |
13 | | - (global $em_js_start i32 (i32.const 2006)) |
14 | | - ;; CHECK: (global $em_js_stop i32 (i32.const 2015)) |
15 | | - (global $em_js_stop i32 (i32.const 2015)) |
| 19 | + ;; CHECK: (global $em_js_start i32 (i32.const -1294967290)) |
| 20 | + (global $em_js_start i32 (i32.const 3000000006)) |
| 21 | + ;; CHECK: (global $em_js_stop i32 (i32.const -1294967281)) |
| 22 | + (global $em_js_stop i32 (i32.const 3000000015)) |
16 | 23 | ;; CHECK: (global $em_lib_deps_start i32 (i32.const 3000)) |
17 | 24 | (global $em_lib_deps_start i32 (i32.const 3000)) |
18 | 25 | ;; CHECK: (global $em_lib_deps_stop i32 (i32.const 3009)) |
|
21 | 28 | (global $foo_start i32 (i32.const 4000)) |
22 | 29 | ;; CHECK: (global $foo_stop i32 (i32.const 4015)) |
23 | 30 | (global $foo_stop i32 (i32.const 4015)) |
24 | | - (memory 10 10) |
25 | | - ;; CHECK: (memory $0 10 10) |
| 31 | + (memory $mem 10 10) |
| 32 | + ;; CHECK: (memory $mem 10 10) |
26 | 33 |
|
27 | 34 | ;; CHECK: (data $data1 (i32.const 1000) "") |
28 | 35 | (data $data1 (i32.const 1000) "hello world") |
29 | | - ;; CHECK: (data $data2 (i32.const 2000) "hello \00\00\00\00\00\00\00\00\00 world") |
30 | | - (data $data2 (i32.const 2000) "hello DELETE ME world") |
| 36 | + ;; CHECK: (data $data2 "hello \00\00\00\00\00\00\00\00\00 world") |
| 37 | + (data $data2 "hello DELETE ME world") |
31 | 38 | ;; CHECK: (data $data3 (i32.const 3000) "") |
32 | 39 | (data $data3 (i32.const 3000) "some deps") |
33 | 40 | (export "__start_em_asm" (global $em_asm_start)) |
|
40 | 47 | (export "__start_foo" (global $foo_start)) |
41 | 48 | ;; CHECK: (export "__stop_foo" (global $foo_stop)) |
42 | 49 | (export "__stop_foo" (global $foo_stop)) |
| 50 | + (func $meminit |
| 51 | + (memory.init $mem $data2 |
| 52 | + (i32.const 3000000000) |
| 53 | + (i32.const 0) |
| 54 | + (i32.const 21) |
| 55 | + ) |
| 56 | + ) |
43 | 57 | ) |
0 commit comments