This is an archive of the discontinued LLVM Phabricator instance.

[Clang][test] Avoid FileCheck error when matching `-cc1`
ClosedPublic

Authored by hzq on Jan 16 2023, 7:29 PM.

Details

Summary

If the version number starts with cc1, such as: clang-cc1514432c58
In the test case the -cc1 option will match the version number instead of the command line. resulting in a check failure.

Diff Detail

Event Timeline

hzq created this revision.Jan 16 2023, 7:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 16 2023, 7:29 PM
hzq requested review of this revision.Jan 16 2023, 7:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 16 2023, 7:29 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Thanks for the patch. I just have some simple suggestions.

clang/test/Driver/modules-ts.cpp
23

An easier-to-understand fix is to simply combine this line and the next:

// CHECK-USE: -cc1 {{.*}} -emit-obj
clang/test/OpenMP/driver.c
6

With -### on the command line, a better fix for this is:

// CHECK-DEFAULT: "-cc1"
hzq updated this revision to Diff 489705.Jan 16 2023, 10:52 PM
hzq retitled this revision from [Clang][Test] Avoid matching version numbers to [Clang][test] Avoid FileCheck error when matching `-cc1`.

Add -### to the command line and update the check content.

hzq marked an inline comment as done.Jan 16 2023, 10:54 PM
This comment was removed by hzq.
bryanpkc requested changes to this revision.Jan 17 2023, 10:47 AM
bryanpkc added inline comments.
clang/test/Driver/modules-ts.cpp
23

Adding -### to this test totally changes the meaning of the test, and is not what I asked for. See lines 5 and 14 for examples of the correct approach.

clang/test/Driver/modules.cpp
25–26

Do not add -###, which totally changes the meaning of the test. See line 17 for an example of what you need to do here.

This revision now requires changes to proceed.Jan 17 2023, 10:47 AM
hzq updated this revision to Diff 489995.Jan 17 2023, 5:17 PM
hzq marked an inline comment as not done.

Update the check content.

hzq added a comment.Jan 17 2023, 5:20 PM

@bryanpkc Modified, Thanks for detailed guidance..

This revision is now accepted and ready to land.Jan 20 2023, 4:29 AM
This revision was landed with ongoing or failed builds.Jan 20 2023, 8:37 PM
This revision was automatically updated to reflect the committed changes.