Skip to content

Run C regression tests using clang and gcc when both are available #6670

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 2 commits into from
Feb 26, 2022

Conversation

tautschnig
Copy link
Collaborator

Our C front-end seeks to conform to whatever interpretation of the C
standard the underlying host C compiler has. To avoid incompatibilities
as documented in #2370, run regression tests using both Clang and GCC,
if available on a particular system.

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@tautschnig tautschnig self-assigned this Feb 15, 2022
@tautschnig tautschnig force-pushed the bugfixes/2370-clang-ansi-c branch from 10c28e9 to f6600cf Compare February 15, 2022 11:54
@tautschnig tautschnig marked this pull request as ready for review February 15, 2022 13:01
@tautschnig tautschnig assigned kroening and chris-ryder and unassigned tautschnig Feb 15, 2022
@codecov
Copy link

codecov bot commented Feb 15, 2022

Codecov Report

Merging #6670 (272fe76) into develop (1154f13) will increase coverage by 0.20%.
The diff coverage is 86.66%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #6670      +/-   ##
===========================================
+ Coverage    76.92%   77.13%   +0.20%     
===========================================
  Files         1583     1582       -1     
  Lines       183314   182625     -689     
===========================================
- Hits        141018   140868     -150     
+ Misses       42296    41757     -539     
Impacted Files Coverage Δ
src/cpp/cpp_typecheck_conversions.cpp 85.14% <0.00%> (+0.10%) ⬆️
src/goto-instrument/dump_c.cpp 80.49% <0.00%> (+0.28%) ⬆️
src/goto-instrument/dump_c_class.h 100.00% <ø> (ø)
src/goto-instrument/goto_program2code.cpp 68.84% <0.00%> (+0.06%) ⬆️
src/goto-programs/xml_expr.cpp 51.21% <0.00%> (ø)
src/util/expr_util.h 100.00% <ø> (ø)
src/util/pointer_predicates.cpp 93.10% <ø> (-0.45%) ⬇️
src/util/pointer_predicates.h 66.66% <ø> (ø)
src/analyses/custom_bitvector_analysis.cpp 55.96% <44.44%> (+0.07%) ⬆️
src/solvers/smt2/smt2_conv.cpp 67.57% <66.66%> (-0.04%) ⬇️
... and 39 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a5092cb...272fe76. Read the comment docs.

@tautschnig tautschnig force-pushed the bugfixes/2370-clang-ansi-c branch from f6600cf to bde4f66 Compare February 16, 2022 21:42
@tautschnig tautschnig force-pushed the bugfixes/2370-clang-ansi-c branch from bde4f66 to 1e58f14 Compare February 26, 2022 17:17
Copy link

@chris-ryder chris-ryder left a comment

Choose a reason for hiding this comment

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

Seems like an improvement, so approving as is - but just wondering slightly what the reasoning behind enabling these test profiles only when there is both clang and gcc available? Could the different profiles not just run when based on the availability of the single compiler needed? (e.g. ansi-c-clang running only if clang is available, ansi-c-gcc only if gcc is available, etc? rather than having a semperate 'else' block for running if only one of those two is available?

…ration

The preprocessor variant is only relevant for c_preprocess, and isn't
actually set by goto-cc (which does not use c_preprocess).

Fixes: diffblue#2370
Our C front-end seeks to conform to whatever interpretation of the C
standard the underlying host C compiler has. To avoid incompatibilities
as documented in diffblue#2370, run regression tests using both Clang and GCC,
if available on a particular system.
@tautschnig tautschnig force-pushed the bugfixes/2370-clang-ansi-c branch from 1e58f14 to 272fe76 Compare February 26, 2022 21:33
@tautschnig
Copy link
Collaborator Author

Seems like an improvement, so approving as is - but just wondering slightly what the reasoning behind enabling these test profiles only when there is both clang and gcc available? Could the different profiles not just run when based on the availability of the single compiler needed? (e.g. ansi-c-clang running only if clang is available, ansi-c-gcc only if gcc is available, etc? rather than having a semperate 'else' block for running if only one of those two is available?

Yes, I now cannot think of a good reason why I restricted it to both having to be available. I have now changed this as suggested.

@tautschnig tautschnig assigned tautschnig and unassigned kroening and chris-ryder Feb 26, 2022
@tautschnig tautschnig merged commit e9793ef into diffblue:develop Feb 26, 2022
@tautschnig tautschnig deleted the bugfixes/2370-clang-ansi-c branch February 26, 2022 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants