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

;; Test that function names containing non-ASCII bytes (>= 0x80) are correctly
;; escaped when round-tripping through binary format. The escaped hex digits
;; must use unsigned interpretation of each byte.

;; RUN: wasm-as %s -g -o %t.wasm
;; RUN: wasm-dis %t.wasm -o - | filecheck %s

(module
  ;; UTF-8 for "é" (U+00E9) = bytes 0xC3, 0xA9. Both bytes are >= 0x80.
  ;; CHECK:      (func $test\c3\a9
  ;; CHECK-NEXT:  (nop)
  ;; CHECK-NEXT: )
  (func $test\c3\a9 (nop))

  ;; UTF-8 for "ñ" (U+00F1) = bytes 0xC3, 0xB1.
  ;; CHECK:      (func $test\c3\b1
  ;; CHECK-NEXT:  (nop)
  ;; CHECK-NEXT: )
  (func $test\c3\b1 (nop))

  ;; UTF-8 for a CJK character (U+4E16 "世") = bytes 0xE4, 0xB8, 0x96.
  ;; CHECK:      (func $test\e4\b8\96
  ;; CHECK-NEXT:  (nop)
  ;; CHECK-NEXT: )
  (func $test\e4\b8\96 (nop))
)
