Skip to content
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

Add llvm-16 build to CI, switch from --cppstd to --std + remove default -std=c++03 #1817

Merged
merged 36 commits into from
May 9, 2024

Conversation

fbrausse
Copy link
Collaborator

@fbrausse fbrausse commented May 7, 2024

This PR:

  • Switches from --cppstd N to --std c++N or --std gnu++N in accordance with earlier discussion; closes [option] language standard #1050. Also, there is no default C++ standard selected anymore (closes [C++ verification] Shall we consider C++11 as the default standard in ESBMC? #1740 as per @mikhailramalho's comment there): If --std is not given, Clang's default is used: gnu++14 up until Clang-15, gnu++17 since v16. This could be a breaking change for users, so it must be mentioned in the Release Notes.
    • This caused some existing C++ tests to fail which didn't specify --std. I've duplicated those tests to be KNOWNBUG without the option and CORE with the correct --std.
    • The config.language field becomes a struct containing language_id and the string from the --std option.
  • Adds a Clang-16 based build to the CI and adds support for clang::UsingType (exists since Clang-14, but seems to be generated only by Clang-16+).
  • Fixes Clang-16 compatibility #862 by adding the corresponding -Wno-error= flags to the failing C test cases. The reason for choosing this solution over others mentioned in a comment below is that "regression tests are not wrong, only their status is", but keeping unmodifed "parsing error" ones doesn't test anything besides Clang's defaults. So only the command line is changed.

Fixes 3 knownbug and adds duplicated tests for 36 new knownbug tests. These bugs are actually not known, but most of them seem to have to do with std::sort and potentially std::move, so they are related to the first item above. This is the list of all new knownbug:

  • regression/esbmc-cpp/algorithm/algorithm108
  • regression/esbmc-cpp/algorithm/algorithm109
  • regression/esbmc-cpp/algorithm/algorithm110
  • regression/esbmc-cpp/algorithm/algorithm111
  • regression/esbmc-cpp/algorithm/algorithm112
  • regression/esbmc-cpp/algorithm/algorithm113
  • regression/esbmc-cpp/algorithm/algorithm122
  • regression/esbmc-cpp/algorithm/algorithm123
  • regression/esbmc-cpp/algorithm/algorithm15
  • regression/esbmc-cpp/algorithm/algorithm16
  • regression/esbmc-cpp/algorithm/algorithm17
  • regression/esbmc-cpp/algorithm/algorithm33
  • regression/esbmc-cpp/algorithm/algorithm40
  • regression/esbmc-cpp/algorithm/algorithm40_sort1
  • regression/esbmc-cpp/algorithm/algorithm40_sort2
  • regression/esbmc-cpp/algorithm/algorithm42
  • regression/esbmc-cpp/algorithm/algorithm42_partial_sort1
  • regression/esbmc-cpp/algorithm/algorithm79
  • regression/esbmc-cpp/algorithm/algorithm80
  • regression/esbmc-cpp/algorithm/algorithm92
  • regression/esbmc-cpp/algorithm/algorithm94
  • regression/esbmc-cpp/algorithm/algorithm99
  • regression/esbmc-cpp/algorithm/algorithm_swap
  • regression/esbmc-cpp/cpp/llbmc_sort-test02
  • regression/esbmc-cpp/multiset/multiset-begin
  • regression/esbmc-cpp/multiset/multiset-end-bug
  • regression/esbmc-cpp/multiset/multiset-end
  • regression/esbmc-cpp/set/set-begin
  • regression/esbmc-cpp/set/set-end-bug
  • regression/esbmc-cpp/set/set-end
  • regression/esbmc-cpp/set/set-swap
  • regression/esbmc-cpp/set/set-value_comp-c++03
  • regression/esbmc-cpp/template/algorithm32
  • regression/esbmc-cpp/vector/ch11_25
  • regression/esbmc-cpp/vector/vector22
  • regression/esbmc-cpp/vector/vector35

@fbrausse fbrausse force-pushed the fb/llvm-16+ branch 5 times, most recently from fe57871 to d75db5c Compare May 7, 2024 15:13
@fbrausse fbrausse changed the title Support building against llvm-16, see #862 Add llvm-16 build to CI, see #862 May 7, 2024
@fbrausse fbrausse force-pushed the fb/llvm-16+ branch 5 times, most recently from 7a6cb8c to 6c6eedb Compare May 8, 2024 06:21
@fbrausse fbrausse changed the title Add llvm-16 build to CI, see #862 Add llvm-16 build to CI, switch from --cppstd to --std + remove default -std=c++03 May 9, 2024
@lucasccordeiro
Copy link
Contributor

Hi @fbrausse,

I'm fine with your proposed solution (disable -Werror for the tests affected).

@fbrausse
Copy link
Collaborator Author

fbrausse commented May 9, 2024

Hi @fbrausse,

I'm fine with your proposed solution (disable -Werror for the tests affected).

OK, great!

The 3 tests failing on the clang-16 CI actually already fail with clang-15 in local tests (edit: they work with clang-14):

	2217 - regression/esbmc-cpp11/constructors/MoveAssignOperator (Failed)
	2219 - regression/esbmc-cpp11/constructors/MoveConstructor (Failed)
	2232 - regression/esbmc-cpp11/reference/Reference4 (Failed)

@fbrausse
Copy link
Collaborator Author

fbrausse commented May 9, 2024

These tests failing on clang-11 and clang-13 (and clang-14, locally) work on clang-15 and beyond:

	3757 - regression/esbmc-cpp/vector/ch11_25 (Failed)
	3797 - regression/esbmc-cpp/vector/vector22 (Failed)
	3812 - regression/esbmc-cpp/vector/vector35 (Failed)

@fbrausse fbrausse marked this pull request as ready for review May 9, 2024 14:33
Copy link
Member

@mikhailramalho mikhailramalho left a comment

Choose a reason for hiding this comment

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

LGTM, although I'm still annoyed that we use --std= instead of -std= like the clang cmdline

@fbrausse
Copy link
Collaborator Author

fbrausse commented May 9, 2024

LGTM, although I'm still annoyed that we use --std= instead of -std= like the clang cmdline

Me too. It's due to boost, though. @kunjsong01 has looked into it before and found -option not to be supported. :(

@mikhailramalho
Copy link
Member

mikhailramalho commented May 9, 2024 via email

@fbrausse
Copy link
Collaborator Author

fbrausse commented May 9, 2024

Master:

Statistics:          23805 Files
  correct:           14204
    correct true:     7814
    correct false:    6390
  incorrect:            42
    incorrect true:     13
    incorrect false:    29
  unknown:            9559
  Score:             21138 (max: 38482)

https://github.com/esbmc/esbmc/actions/runs/9018938790

This PR:

Statistics:          23805 Files
  correct:           14182
    correct true:     7795
    correct false:    6387
  incorrect:            42
    incorrect true:     13
    incorrect false:    29
  unknown:            9581
  Score:             21097 (max: 38482)

https://github.com/esbmc/esbmc/actions/runs/9018942491

@lucasccordeiro lucasccordeiro merged commit ae774f7 into master May 9, 2024
12 of 13 checks passed
@lucasccordeiro lucasccordeiro deleted the fb/llvm-16+ branch May 9, 2024 20:51
@lucasccordeiro
Copy link
Contributor

Thanks for submitting this PR, @fbrausse.

@XLiZHI: can I ask you to check the failed test case and submit another PR to fix them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants