Skip to content

Migrate 3C regression tests from %clang_cc1 to %clang. #596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2021

Conversation

mattmccutchen-cci
Copy link
Member

This requires replacing %clang_cc1 -verify with %clang -Xclang -verify in the tests that use it.

This is one part of the RUN command cleanup that we've wanted to do for a while in #346, and now it is blocking part of #576. This is because the single behavior difference we know of between %clang_cc1 and %clang (other than the need for -Xclang) is that %clang_cc1 turns off the system headers, and we want two of our tests that currently use %clang_cc1 to be able to get checked declarations from the system headers.

As recently as dac3f97 (August 2020), all of the tests that used %clang_cc1 used -verify. Since then, a few tests have been added that use %clang_cc1 and not -verify. This lends support to my theory that the only reason we used %clang_cc1 was that we were unaware that -verify could be used with %clang via -Xclang, and some subsequently added tests copied the use of %clang_cc1 only because the authors didn't know any better. Thus, I believe that the risk of the migration affecting the validity of the tests (e.g., causing them to falsely pass) is low.


Aaron, it looks like you added all of the tests that use %clang_cc1 and not -verify (see git grep '%clang_cc1' origin | grep -v -e '-verify') except for ptrtoconstarr.c. Did you have a reason for using %clang_cc1? Since I want to ask you this question anyway, I propose that you would be a good person to review the whole PR.

This requires replacing `%clang_cc1 -verify` with `%clang -Xclang
-verify` in the tests that use it.

This is one part of the RUN command cleanup that we've wanted to do for
a while in #346, and now it is blocking part of #576. This is because
the single behavior difference we know of between %clang_cc1 and %clang
(other than the need for `-Xclang`) is that %clang_cc1 turns off the
system headers, and we want two of our tests that currently use
%clang_cc1 to be able to get checked declarations from the system
headers.

As recently as dac3f97 (August 2020),
all of the tests that used %clang_cc1 used -verify. Since then, a few
tests have been added that use %clang_cc1 and not -verify. This lends
support to my theory that the only reason we used %clang_cc1 was that we
were unaware that -verify could be used with %clang via -Xclang, and
some subsequently added tests copied the use of %clang_cc1 only because
the authors didn't know any better. Thus, I believe that the risk of the
migration affecting the validity of the tests (e.g., causing them to
falsely pass) is low.
@aaronjeline
Copy link
Collaborator

I absolutely just copied the clang_cc1 use and had no specific reason for wanting it.

@aaronjeline
Copy link
Collaborator

My only comment is that we should have documentation somewhere that explains why use the options we use. This will hopefully prevent people in the future from blindly copying options. Do we have this?

@mattmccutchen-cci
Copy link
Member Author

My only comment is that we should have documentation somewhere that explains why use the options we use. This will hopefully prevent people in the future from blindly copying options. Do we have this?

The thread of #346 is probably the best source of information right now. I just added a brief "Writing regression tests" section to our 3C Google document that links to that thread. IMO, it wouldn't be a good use of time to write more formal documentation right now. If you feel strongly that we should start writing better developer documentation, I'm open to that, but I would want such a policy to be applied fairly to all of our work and not just to this PR.

Realistically, copy and paste is going to remain a significant development technique for us, so sometimes just removing all (or almost all) instances of the deprecated code pattern is the most important thing to do.

Copy link
Collaborator

@aaronjeline aaronjeline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change is good.

@mattmccutchen-cci mattmccutchen-cci merged commit 1fac188 into main May 21, 2021
@mattmccutchen-cci mattmccutchen-cci deleted the regtests-clang_cc1 branch May 21, 2021 15:54
mattmccutchen-cci added a commit that referenced this pull request May 21, 2021
…nto regtests-checked-decls

Merging #596 into this PR subsumes the migration of two tests from
%clang_cc1 to %clang that was previously done in
aa138e8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants