;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.

;; RUN: wasm-opt -all             %s -S -o - | filecheck %s
;; RUN: wasm-opt -all --roundtrip %s -S -o - | filecheck %s

;; Test text and binary handling of @binaryen.idempotent.

(module
  ;; CHECK:      (type $0 (func))

  ;; CHECK:      (@binaryen.idempotent)
  ;; CHECK-NEXT: (func $func-annotation (type $0)
  ;; CHECK-NEXT:  (drop
  ;; CHECK-NEXT:   (i32.const 0)
  ;; CHECK-NEXT:  )
  ;; CHECK-NEXT: )
  (@binaryen.idempotent)
  (func $func-annotation
    (drop
      (i32.const 0)
    )
  )

  ;; CHECK:      (func $call (type $0)
  ;; CHECK-NEXT:  (@binaryen.idempotent)
  ;; CHECK-NEXT:  (call $call)
  ;; CHECK-NEXT: )
  (func $call
    (@binaryen.idempotent)
    (call $call)
  )
)

