This is an archive of the discontinued LLVM Phabricator instance.

[test, x86] Fix spurious x86-target-features.c failure
ClosedPublic

Authored by thopre on May 6 2022, 1:53 AM.

Details

Summary

x86-target-features.c can spuriously fail when checking for absence of
the string "lvi" in the compiler output due to the temporary path used
for the output file. For example:
"-o" "/tmp/lit-tmp-981j7lvi/x86-target-features-670b86.o"
will make the test fail. This commit checks specifically for lvi as a
target feature, in a similar way to the positive CHECK directive just
above.

Test Plan: fails when using -mlvi-hardening and pass otherwise

Diff Detail

Event Timeline

thopre created this revision.May 6 2022, 1:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 6 2022, 1:53 AM
thopre requested review of this revision.May 6 2022, 1:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 6 2022, 1:53 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
pengfei added inline comments.May 17 2022, 6:18 AM
clang/test/Driver/x86-target-features.c
173

How about just // NO-LVIHARDENING-NOT: "+lvi-? It should be distinct enough. We intentionally use less combination on a negative test.

thopre updated this revision to Diff 430029.May 17 2022, 6:38 AM
thopre marked an inline comment as done.

Be more conservative in what we reject

pengfei accepted this revision.May 17 2022, 8:00 AM

LGTM. Thanks!

This revision is now accepted and ready to land.May 17 2022, 8:00 AM
This revision was automatically updated to reflect the committed changes.