;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. ;; RUN: wasm-opt %s --vacuum -all -S -o - | filecheck %s (module ;; CHECK: (func $compare (type $0) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (string.compare ;; CHECK-NEXT: (string.const "hello") ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (string.compare ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: (string.const "world") ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (string.compare ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $compare ;; We cannot vacuum away compares that might trap. (drop (string.compare (string.const "hello") (string.const "world") ) ) (drop (string.compare (string.const "hello") (ref.null none) ) ) (drop (string.compare (ref.null none) (string.const "world") ) ) (drop (string.compare (ref.null none) (ref.null none) ) ) ) ;; CHECK: (func $eq (type $0) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) (func $eq ;; Equals, however, never traps so all these can be removed. (drop (string.eq (string.const "hello") (string.const "world") ) ) (drop (string.eq (string.const "hello") (ref.null none) ) ) (drop (string.eq (ref.null none) (string.const "world") ) ) (drop (string.eq (ref.null none) (ref.null none) ) ) ) )