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

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

David Chisnall via cfe-dev
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.

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-lit] llvm-lit RUN line specific REQUIRES clause?

David Chisnall via cfe-dev

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 <[hidden email]> On Behalf Of Balázs Benics via cfe-dev
Sent: Wednesday, July 8, 2020 4:42 AM
To: cfe-dev <[hidden email]>
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.


_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-lit] llvm-lit RUN line specific REQUIRES clause?

David Chisnall via cfe-dev
Awesome, thanks!

Robinson, Paul <[hidden email]> ezt írta (időpont: 2020. júl. 8., Sze, 13:28):

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 <[hidden email]> On Behalf Of Balázs Benics via cfe-dev
Sent: Wednesday, July 8, 2020 4:42 AM
To: cfe-dev <[hidden email]>
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.


_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev