From 514391c84ca173c80d9b0e36139f7a9c990d6d79 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Sun, 14 Apr 2024 22:33:09 -0700 Subject: [PATCH] [NFC] Fix tests that were polluting the test directory A few tests were creating files with the `%s` prefix, which expands to the test filename itself, so the test files were being created in the test directory and were never cleaned up. Another test was creating files called `%a.wast` and `%b.wast`, but `%a` and `%b` do not expand to anything, so this also polluted the test directory and caused problems with running other tests and fuzzing. Use the proper `%t` prefix to create all these files in a temporary location instead. Fixes #6429. --- test/lit/debug/source-map-stop.wast | 4 ++-- test/lit/downgrade-reftypes.wast | 4 ++-- test/lit/passes/experimental-new_eh.wast | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/lit/debug/source-map-stop.wast b/test/lit/debug/source-map-stop.wast index 90bf739c17d..d075d5686e0 100644 --- a/test/lit/debug/source-map-stop.wast +++ b/test/lit/debug/source-map-stop.wast @@ -1,7 +1,7 @@ ;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. -;; RUN: wasm-opt %s -g -o %s.wasm -osm %s.wasm.map -;; RUN: wasm-opt %s.wasm -ism %s.wasm.map -S -o - | filecheck %s +;; RUN: wasm-opt %s -g -o %t.wasm -osm %t.wasm.map +;; RUN: wasm-opt %t.wasm -ism %t.wasm.map -S -o - | filecheck %s ;; Verify that writing to a source map and reading it back does not "smear" ;; debug info across adjacent instructions. The debug info in the output should diff --git a/test/lit/downgrade-reftypes.wast b/test/lit/downgrade-reftypes.wast index 5bc9af65359..76d8d99750f 100644 --- a/test/lit/downgrade-reftypes.wast +++ b/test/lit/downgrade-reftypes.wast @@ -1,10 +1,10 @@ ;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. ;; Write to a binary, lowering away refined GC types. -;; RUN: wasm-as %s -all --disable-gc -g -o %s.wasm +;; RUN: wasm-as %s -all --disable-gc -g -o %t.wasm ;; Read it back and verify that the types were lowered away. -;; RUN: wasm-dis %s.wasm -all -o - | filecheck %s +;; RUN: wasm-dis %t.wasm -all -o - | filecheck %s (module diff --git a/test/lit/passes/experimental-new_eh.wast b/test/lit/passes/experimental-new_eh.wast index ee662467664..9ef847e5896 100644 --- a/test/lit/passes/experimental-new_eh.wast +++ b/test/lit/passes/experimental-new_eh.wast @@ -1,15 +1,15 @@ ;; When given alone, --experimental-new-eh just runs --translate-to-new-eh -;; RUN: wasm-opt %s -all --translate-to-new-eh -S -o %a.wasm -;; RUN: wasm-opt %s -all --experimental-new-eh -S -o %b.wasm -;; RUN: diff %a.wasm %b.wasm +;; RUN: wasm-opt %s -all --translate-to-new-eh -S -o %t1.wasm +;; RUN: wasm-opt %s -all --experimental-new-eh -S -o %t2.wasm +;; RUN: diff %t1.wasm %t2.wasm ;; When given with other flags, --experimental-new-eh runs the translator after ;; running other passes. If --optimize-level >=3, --experimenal-new-eh also runs ;; StackIR (+ local2stack) optimization. So running '-O --experimental-new-eh' ;; should be the same as running all these passes separately. -;; RUN: wasm-opt %s -all -O --translate-to-new-eh --optimize-level=3 --generate-stack-ir --optimize-stack-ir -o %a.wasm -;; RUN: wasm-opt %s -all -O --experimental-new-eh -o %b.wasm -;; RUN: diff %a.wasm %b.wasm +;; RUN: wasm-opt %s -all -O --translate-to-new-eh --optimize-level=3 --generate-stack-ir --optimize-stack-ir -o %t1.wasm +;; RUN: wasm-opt %s -all -O --experimental-new-eh -o %t2.wasm +;; RUN: diff %t1.wasm %t2.wasm (module (import "env" "foo" (func $foo))