[llvm] update_llc_test_checks: better support for non-llc tools (PR #93135)

Jannik Silvanus via llvm-commits llvm-commits at lists.llvm.org
Mon May 27 04:37:38 PDT 2024


Nicolai =?utf-8?q?Hähnle?= <nicolai.haehnle at amd.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/93135 at github.com>


================
@@ -0,0 +1,22 @@
+## Checks two things:
+# - matching functions in AMDGPU assembly output without certain comments in the assembly
+# - using the --tool and --march arguments
+
+# Using `cat` as a tool requires some unusual setup (compared to the other test
+# of UpdateTestChecks tools), because update_llc_test_checks only reliably
+# substitutes %S (source directory) when evaluating RUN lines in the .ll file.
+# The .ll file used during the test is a temporary copy, so we also need to
+# provide a temporary copy of the cat'd .s file to avoid relying on
+# implementation details of how llvm-lit chooses %t.
+
+# RUN: rm -rf %t && mkdir %t
----------------
jasilvanus wrote:

Nit: Use `%t.dir` instead of `%t`. This makes it clear this is a directory, and (for paranoid me) seems to be safer if `%t` is incorrectly replaced.

https://github.com/llvm/llvm-project/pull/93135


More information about the llvm-commits mailing list