;;; TOOL: wat2wasm
;;; ARGS: --enable-function-references
;;; ERROR: 1
(module
  (global (import "mod" "val") (ref 9997))
  (global (ref null 9998) (ref.null 9998))
)
(;; STDERR ;;;
out/test/parse/bad-ref-globals.txt:5:42: error: reference 9997 is out of range (max: 0) in globals
  (global (import "mod" "val") (ref 9997))
                                         ^
out/test/parse/bad-ref-globals.txt:6:4: error: reference 9998 is out of range (max: 0) in globals
  (global (ref null 9998) (ref.null 9998))
   ^^^^^^
out/test/parse/bad-ref-globals.txt:6:37: error: function type variable out of range: 9998 (max 0)
  (global (ref null 9998) (ref.null 9998))
                                    ^^^^
;;; STDERR ;;)
