|
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 |
| 15 | + ;; CHECK: (type $0 (func)) |
| 16 | + |
8 | 17 | ;; CHECK: (global $em_asm_start i32 (i32.const 1000)) |
9 | 18 | (global $em_asm_start i32 (i32.const 1000)) |
10 | 19 | ;; CHECK: (global $em_asm_stop i32 (i32.const 1011)) |
11 | 20 | (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)) |
| 21 | + ;; CHECK: (global $em_js_start i32 (i32.const -1294967290)) |
| 22 | + (global $em_js_start i32 (i32.const 3000000006)) |
| 23 | + ;; CHECK: (global $em_js_stop i32 (i32.const -1294967281)) |
| 24 | + (global $em_js_stop i32 (i32.const 3000000015)) |
16 | 25 | ;; CHECK: (global $em_lib_deps_start i32 (i32.const 3000)) |
17 | 26 | (global $em_lib_deps_start i32 (i32.const 3000)) |
18 | 27 | ;; CHECK: (global $em_lib_deps_stop i32 (i32.const 3009)) |
|
21 | 30 | (global $foo_start i32 (i32.const 4000)) |
22 | 31 | ;; CHECK: (global $foo_stop i32 (i32.const 4015)) |
23 | 32 | (global $foo_stop i32 (i32.const 4015)) |
24 | | - (memory 10 10) |
25 | | - ;; CHECK: (memory $0 10 10) |
26 | | - |
| 33 | + ;; CHECK: (memory $mem 10 10) |
| 34 | + (memory $mem 10 10) |
27 | 35 | ;; CHECK: (data $data1 (i32.const 1000) "") |
28 | 36 | (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") |
| 37 | + ;; CHECK: (data $data2 "hello \00\00\00\00\00\00\00\00\00 world") |
| 38 | + (data $data2 "hello DELETE ME world") |
31 | 39 | ;; CHECK: (data $data3 (i32.const 3000) "") |
32 | 40 | (data $data3 (i32.const 3000) "some deps") |
33 | 41 | (export "__start_em_asm" (global $em_asm_start)) |
|
40 | 48 | (export "__start_foo" (global $foo_start)) |
41 | 49 | ;; CHECK: (export "__stop_foo" (global $foo_stop)) |
42 | 50 | (export "__stop_foo" (global $foo_stop)) |
| 51 | + ;; CHECK: (func $meminit |
| 52 | + ;; CHECK-NEXT: (memory.init $data2 |
| 53 | + ;; CHECK-NEXT: (i32.const -1294967296) |
| 54 | + ;; CHECK-NEXT: (i32.const 0) |
| 55 | + ;; CHECK-NEXT: (i32.const 21) |
| 56 | + ;; CHECK-NEXT: ) |
| 57 | + ;; CHECK-NEXT: ) |
| 58 | + (func $meminit |
| 59 | + (memory.init $mem $data2 |
| 60 | + (i32.const 3000000000) |
| 61 | + (i32.const 0) |
| 62 | + (i32.const 21) |
| 63 | + ) |
| 64 | + ) |
43 | 65 | ) |
0 commit comments