diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/passes/optimize-instructions-memory64.wast | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/lit/passes/optimize-instructions-memory64.wast b/test/lit/passes/optimize-instructions-memory64.wast new file mode 100644 index 000000000..f74dad7a8 --- /dev/null +++ b/test/lit/passes/optimize-instructions-memory64.wast @@ -0,0 +1,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) + ) + ) +) + |