summaryrefslogtreecommitdiff
path: root/test/lit/passes/optimize-instructions-memory64.wast
blob: f74dad7a81286260342d62536e82ed2b25fbb415 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.
;; RUN: wasm-opt %s --optimize-instructions -all -S -o - | filecheck %s

(module
 ;; CHECK:      (memory $0 i64 16 17)
 (memory $0 i64 16 17)

 ;; CHECK:      (func $offsets (type $0)
 ;; CHECK-NEXT:  (i64.store
 ;; CHECK-NEXT:   (i64.const 10)
 ;; CHECK-NEXT:   (i64.const 42)
 ;; CHECK-NEXT:  )
 ;; CHECK-NEXT:  (f32.store offset=4
 ;; CHECK-NEXT:   (i64.const -3)
 ;; CHECK-NEXT:   (f32.const 3.141590118408203)
 ;; CHECK-NEXT:  )
 ;; CHECK-NEXT: )
 (func $offsets
  ;; It is safe to combine the offset and constant here.
  (i64.store offset=4
   (i64.const 6)
   (i64.const 42)
  )
  ;; This would overflow, so do not optimize.
  (f32.store offset=4
   (i64.const -3)
   (f32.const 3.14159)
  )
 )
)