[PATCH] D24799: [XRay] Check in Clang whether XRay supports the target when -fxray-instrument is passed
Dean Michael Berris via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 17 17:24:16 PDT 2016
dberris added a comment.
In https://reviews.llvm.org/D24799#566507, @rSerge wrote:
> I have extended this feature to check for OS support too (currently Linux only). I can't commit it so far because I don't know how to implement a test. XFAIL cannot check for both CPU and OS: it can only check for one of them. I tried to implement 2 tests instead like these:
> Test 1:
>
> // RUN: not %clang -v -fxray-instrument -c %s
> // XFAIL: Linux
> // REQUIRES-ANY: amd64-, x86_64, x86_64h, arm
> typedef int a;
>
>
> Test 2:
>
> // RUN: not %clang -v -fxray-instrument -c %s
> // XFAIL: amd64-, x86_64, x86_64h, arm
> // REQUIRES: Linux
> typedef int a;
>
>
> However the problem with REQUIRES / REQUIRES-ANY is that they only check in LIT features, but not in the target triple. So everything becomes unsupported.
>
> Does anyone have any ideas on how to implement the tests for Clang checking for both OS and CPU? I have 2 options in mind:
>
> 1. extend LIT, putting OS and CPU into the feature list
This should be configurable in the various `lit.site.cfg` files for Clang. I suspect though that just relying on the `REQUIRES` exclusively should work -- i.e. define a list of features that you actually require.
http://llvm.org/docs/TestingGuide.html#requires-and-requires-any-directive
> 2. implement the test via GTest, rather than LIT
Probably won't work since this is a test of the compiler, unless you had something more specific?
https://reviews.llvm.org/D24799
More information about the cfe-commits
mailing list