[cfe-dev] [llvm-lit] llvm-lit RUN line specific REQUIRES clause?

Robinson, Paul via cfe-dev cfe-dev at lists.llvm.org
Wed Jul 8 04:28:22 PDT 2020


There isn’t a way to achieve this in a single test file.  What you can do, though, is create a second file that has the necessary REQUIRES and RUN lines, and just names the first file instead of %s on the RUN lines.  For example:

most-cases.cpp
// Note, also used by special-case.cpp
// RUN: %clang_cc1 -c -whatever %s | FileCheck %s

special-case.cpp
// REQUIRES: z3
// RUN: %clang_cc1 -c -whatever %S/most-cases.cpp | FileCheck %S/most-cases.cpp

I’ve seen this tactic used a number of times in the codebase.  Sometimes a shared source file will be put into an “Inputs” subdirectory, sometimes not.
--paulr

From: cfe-dev <cfe-dev-bounces at lists.llvm.org> On Behalf Of Balázs Benics via cfe-dev
Sent: Wednesday, July 8, 2020 4:42 AM
To: cfe-dev <cfe-dev at lists.llvm.org>
Subject: [cfe-dev] [llvm-lit] llvm-lit RUN line specific REQUIRES clause?

Can I add a REQUIRES clause to a specific RUN line?

I want to run a specific RUN line only if a given requirement satisfied (eg. REQUIRES: z3).
Even if the requirement would not met, all the rest of the RUN lines should still run.

If there is no way of achieving this, I can of course copy-paste the test file, but I would seek a better solution.
Thanks, Balazs.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200708/99e3b428/attachment.html>


More information about the cfe-dev mailing list