This is an archive of the discontinued LLVM Phabricator instance.

[test] Properly test -Werror-implicit-function-declaration and -Wvec-elem-size
ClosedPublic

Authored by MaskRay on Nov 5 2020, 12:26 PM.

Diff Detail

Event Timeline

MaskRay created this revision.Nov 5 2020, 12:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 5 2020, 12:26 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
MaskRay requested review of this revision.Nov 5 2020, 12:26 PM

Thanks for taking a look at this!

clang/test/Sema/implicit-decl.c
2

I probably wouldn't bother testing this - presumably we don't test the -Wno- variant of every warning, given that it's implemented in a generic fashion?

If this is removed, I expect the verifier prefixes don't need to be changed?

clang/test/Sema/vecshift.c
5–6

The previous version of the test had this without -DERR, right? Why the change here?

MaskRay added inline comments.Nov 5 2020, 3:18 PM
clang/test/Sema/implicit-decl.c
2

Yes. I can remove -Wno-implicit-function-declaration

clang/test/Sema/vecshift.c
5–6

I think the previous version was wrongly structured. It probably wanted to test what -Wvec-elem-size checks but Wno-error=vec-elem-size would not check anything.

MaskRay updated this revision to Diff 303273.Nov 5 2020, 3:20 PM

comments

MaskRay updated this revision to Diff 303277.Nov 5 2020, 3:30 PM

Discard an unintentional change

dblaikie added inline comments.Nov 5 2020, 5:41 PM
clang/test/Sema/vecshift.c
5–6

Not sure I follow - could you walk me through it in a bit more detail/few more steps?

It seems surprising to me that all 4 check lines this test has as you're proposing have -DERR, if that's correct, why have it a as a preprocessor variable (ie: all the non-ERR parts of the test are dead in this proposed version, it seems)? But the test as committed in 9941ca8af6b4c39fd0b9e47dc7e593d884b55710 tested both with -DERR and without it.

MaskRay updated this revision to Diff 303310.Nov 5 2020, 5:58 PM

Fix vecshift.c

MaskRay marked 2 inline comments as done.Nov 5 2020, 5:59 PM
MaskRay added inline comments.
clang/test/Sema/vecshift.c
5–6

OK, I misunderstood the intention of the original test.

-Wvec-elem-size is an error. To test that the error can be downgraded to a warning, -Wno-error=vec-elem-size is needed.

Fixed the RUN lines.

MaskRay marked 2 inline comments as done.Nov 5 2020, 5:59 PM
dblaikie accepted this revision.Nov 5 2020, 7:43 PM

Looks good - thanks!

This revision is now accepted and ready to land.Nov 5 2020, 7:43 PM
This revision was landed with ongoing or failed builds.Nov 5 2020, 8:08 PM
This revision was automatically updated to reflect the committed changes.