Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions scripts/update_help_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ def main():
out.write(f';; RUN: {tool} --help | filecheck %s' + os.linesep)
first = True
for line in output.splitlines():
if first:
out.write(f';; CHECK: {line}'.strip() + os.linesep)
if not line:
out.write(';; CHECK-EMPTY:' + os.linesep)
elif first:
out.write(f';; CHECK: {line}' + os.linesep)
first = False
else:
out.write(f';; CHECK-NEXT: {line}'.strip() + os.linesep)
out.write(f';; CHECK-NEXT: {line}' + os.linesep)


if __name__ == '__main__':
Expand Down
12 changes: 9 additions & 3 deletions scripts/update_lit_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def update_test(args, test, lines, tmp):

prefixes = {prefix for module_output in command_output for prefix in module_output.keys()}
check_line_re = re.compile(r'^\s*;;\s*(' + '|'.join(prefixes) +
r')(?:-NEXT|-LABEL|-NOT)?:.*$')
r')(?:-[A-Z0-9]+)?:.*$')

# Filter out whitespace between check blocks
if lines:
Expand All @@ -353,8 +353,14 @@ def update_test(args, test, lines, tmp):
def emit_checks(indent, prefix, lines):
def pad(line):
return line if not line or line.startswith(' ') else ' ' + line
output_lines.append(f'{indent};; {prefix}: {pad(lines[0])}')
output_lines.extend(f'{indent};; {prefix}-NEXT:{pad(line)}' for line in lines[1:])

for i, line in enumerate(lines):
if not line.strip():
output_lines.append(f'{indent};; {prefix}-EMPTY:')
elif i == 0:
output_lines.append(f'{indent};; {prefix}: {pad(line)}')
else:
output_lines.append(f'{indent};; {prefix}-NEXT:{pad(line)}')

input_modules = [m.split('\n') for m in split_modules('\n'.join(lines))]
if len(input_modules) > len(command_output):
Expand Down
4 changes: 2 additions & 2 deletions test/lit/fuzz-types.test
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
;; CHECK-NEXT: (type $18 (sub final $13 (describes $17) (struct (field (ref noextern)) (field (ref $10)) (field (mut i32)) (field (mut i16)) (field (mut (ref null $1))) (field i8))))
;; CHECK-NEXT: (type $19 (sub $8 (struct (field i32) (field (mut i8)))))
;; CHECK-NEXT: )
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: Inhabitable types:
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: Built 20 types:
;; CHECK-NEXT: (rec
;; CHECK-NEXT: (type $0 (sub (shared (func (param i64 f64 exnref (ref null $0)) (result (ref cont))))))
Expand Down
226 changes: 113 additions & 113 deletions test/lit/help/wasm-as.test
Original file line number Diff line number Diff line change
@@ -1,207 +1,207 @@
;; RUN: wasm-as --help | filecheck %s
;; CHECK: ================================================================================
;; CHECK-NEXT: wasm-as INFILE
;; CHECK-NEXT:
;; CHECK-NEXT: Assemble a .wat (WebAssembly text format) into a .wasm (WebAssembly binary
;; CHECK-EMPTY:
;; CHECK-NEXT: Assemble a .wat (WebAssembly text format) into a .wasm (WebAssembly binary
;; CHECK-NEXT: format)
;; CHECK-NEXT: ================================================================================
;; CHECK-NEXT:
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-EMPTY:
;; CHECK-NEXT: wasm-as options:
;; CHECK-NEXT: ----------------
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --output,-o Output file
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --validate,-v Control validation of the output module
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --debuginfo,-g Emit names section and debug info
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --source-map,-sm Emit source map to the specified file
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --source-map-url,-su Use specified string as source map URL
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --symbolmap,-s Emit a symbol map (indexes => names)
;; CHECK-NEXT:
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-EMPTY:
;; CHECK-NEXT: Tool options:
;; CHECK-NEXT: -------------
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --mvp-features,-mvp Disable all non-MVP features
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --all-features,-all Enable all features
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --detect-features (deprecated - this flag does nothing)
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --quiet,-q Emit less verbose output and hide trivial
;; CHECK-NEXT: warnings.
;; CHECK-NEXT:
;; CHECK-NEXT: --experimental-poppy Parse wast files as Poppy IR for testing
;; CHECK-EMPTY:
;; CHECK-NEXT: --experimental-poppy Parse wast files as Poppy IR for testing
;; CHECK-NEXT: purposes.
;; CHECK-NEXT:
;; CHECK-NEXT: --emit-module-names Emit module names, even if not emitting
;; CHECK-EMPTY:
;; CHECK-NEXT: --emit-module-names Emit module names, even if not emitting
;; CHECK-NEXT: the rest of the names section.
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-sign-ext Enable sign extension operations
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-sign-ext Disable sign extension operations
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-threads Enable atomic operations
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-threads Disable atomic operations
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-mutable-globals Enable mutable globals
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-mutable-globals Disable mutable globals
;; CHECK-NEXT:
;; CHECK-NEXT: --enable-nontrapping-float-to-int Enable nontrapping float-to-int
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-nontrapping-float-to-int Enable nontrapping float-to-int
;; CHECK-NEXT: operations
;; CHECK-NEXT:
;; CHECK-NEXT: --disable-nontrapping-float-to-int Disable nontrapping float-to-int
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-nontrapping-float-to-int Disable nontrapping float-to-int
;; CHECK-NEXT: operations
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-simd Enable SIMD operations and types
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-simd Disable SIMD operations and types
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-bulk-memory Enable bulk memory operations
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-bulk-memory Disable bulk memory operations
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-bulk-memory-opt Enable memory.copy and memory.fill
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-bulk-memory-opt Disable memory.copy and memory.fill
;; CHECK-NEXT:
;; CHECK-NEXT: --enable-call-indirect-overlong Enable LEB encoding of call-indirect
;; CHECK-NEXT: (Ignored for compatibility as it has no
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-call-indirect-overlong Enable LEB encoding of call-indirect
;; CHECK-NEXT: (Ignored for compatibility as it has no
;; CHECK-NEXT: effect on Binaryen)
;; CHECK-NEXT:
;; CHECK-NEXT: --disable-call-indirect-overlong Disable LEB encoding of call-indirect
;; CHECK-NEXT: (Ignored for compatibility as it has no
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-call-indirect-overlong Disable LEB encoding of call-indirect
;; CHECK-NEXT: (Ignored for compatibility as it has no
;; CHECK-NEXT: effect on Binaryen)
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-exception-handling Enable exception handling operations
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-exception-handling Disable exception handling operations
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-tail-call Enable tail call operations
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-tail-call Disable tail call operations
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-reference-types Enable reference types
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-reference-types Disable reference types
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-multivalue Enable multivalue functions
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-multivalue Disable multivalue functions
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-gc Enable garbage collection
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-gc Disable garbage collection
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-memory64 Enable memory64
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-memory64 Disable memory64
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-relaxed-simd Enable relaxed SIMD
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-relaxed-simd Disable relaxed SIMD
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-extended-const Enable extended const expressions
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-extended-const Disable extended const expressions
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-strings Enable strings
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-strings Disable strings
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-multimemory Enable multimemory
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-multimemory Disable multimemory
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-stack-switching Enable stack switching
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-stack-switching Disable stack switching
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-shared-everything Enable shared-everything threads
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-shared-everything Disable shared-everything threads
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-fp16 Enable float 16 operations
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-fp16 Disable float 16 operations
;; CHECK-NEXT:
;; CHECK-NEXT: --enable-custom-descriptors Enable custom descriptors (RTTs) and
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-custom-descriptors Enable custom descriptors (RTTs) and
;; CHECK-NEXT: exact references
;; CHECK-NEXT:
;; CHECK-NEXT: --disable-custom-descriptors Disable custom descriptors (RTTs) and
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-custom-descriptors Disable custom descriptors (RTTs) and
;; CHECK-NEXT: exact references
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-multibyte Enable multibyte array loads and stores
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-multibyte Disable multibyte array loads and stores
;; CHECK-NEXT:
;; CHECK-NEXT: --enable-acquire-release-atomics Enable acquire/release atomic memory
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-acquire-release-atomics Enable acquire/release atomic memory
;; CHECK-NEXT: operations
;; CHECK-NEXT:
;; CHECK-NEXT: --disable-acquire-release-atomics Disable acquire/release atomic memory
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-acquire-release-atomics Disable acquire/release atomic memory
;; CHECK-NEXT: operations
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-custom-page-sizes Enable custom page sizes
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-custom-page-sizes Disable custom page sizes
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-wide-arithmetic Enable wide arithmetic
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-wide-arithmetic Disable wide arithmetic
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-compact-imports Enable compact import section
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-compact-imports Disable compact import section
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-relaxed-atomics Enable relaxed atomic memory operations
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-relaxed-atomics Disable relaxed atomic memory operations
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --enable-typed-function-references Deprecated compatibility flag
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --disable-typed-function-references Deprecated compatibility flag
;; CHECK-NEXT:
;; CHECK-NEXT: --no-validation,-n Disables validation, assumes inputs are
;; CHECK-EMPTY:
;; CHECK-NEXT: --no-validation,-n Disables validation, assumes inputs are
;; CHECK-NEXT: correct
;; CHECK-NEXT:
;; CHECK-NEXT: --pass-arg,-pa An argument passed along to optimization
;; CHECK-NEXT: passes being run. Must be in the form
;; CHECK-NEXT: KEY@VALUE. If KEY is the name of a pass
;; CHECK-NEXT: then it applies to the closest instance
;; CHECK-EMPTY:
;; CHECK-NEXT: --pass-arg,-pa An argument passed along to optimization
;; CHECK-NEXT: passes being run. Must be in the form
;; CHECK-NEXT: KEY@VALUE. If KEY is the name of a pass
;; CHECK-NEXT: then it applies to the closest instance
;; CHECK-NEXT: of that pass before us. If KEY is not the
;; CHECK-NEXT: name of a pass then it is a global option
;; CHECK-NEXT: that applies to all pass instances that
;; CHECK-NEXT: that applies to all pass instances that
;; CHECK-NEXT: read it.
;; CHECK-NEXT:
;; CHECK-NEXT: --closed-world,-cw Assume code outside of the module does
;; CHECK-NEXT: not inspect or interact with GC and
;; CHECK-NEXT: function references, even if they are
;; CHECK-NEXT: passed out. The outside may hold on to
;; CHECK-NEXT: them and pass them back in, but not
;; CHECK-EMPTY:
;; CHECK-NEXT: --closed-world,-cw Assume code outside of the module does
;; CHECK-NEXT: not inspect or interact with GC and
;; CHECK-NEXT: function references, even if they are
;; CHECK-NEXT: passed out. The outside may hold on to
;; CHECK-NEXT: them and pass them back in, but not
;; CHECK-NEXT: inspect their contents or call them.
;; CHECK-NEXT:
;; CHECK-NEXT: --preserve-type-order Preserve the order of types from the
;; CHECK-EMPTY:
;; CHECK-NEXT: --preserve-type-order Preserve the order of types from the
;; CHECK-NEXT: input (useful for debugging and testing)
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --generate-stack-ir generate StackIR during writing
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --optimize-stack-ir optimize StackIR during writing
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --print-stack-ir print StackIR during writing
;; CHECK-NEXT:
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-EMPTY:
;; CHECK-NEXT: General options:
;; CHECK-NEXT: ----------------
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --version Output version information and exit
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --help,-h Show this help message and exit
;; CHECK-NEXT:
;; CHECK-EMPTY:
;; CHECK-NEXT: --debug,-d Print debug information to stderr
;; CHECK-NEXT:
;; CHECK-EMPTY:
Loading
Loading