group unsupported warnings

This commit is contained in:
Leo Alt
2023-03-15 17:06:06 +01:00
parent 0aa85153e5
commit aacbe72079
20 changed files with 126 additions and 22 deletions
+8
View File
@@ -47,6 +47,14 @@ SMTCheckerTest::SMTCheckerTest(string const& _filename): SyntaxTest(_filename, E
else
BOOST_THROW_EXCEPTION(runtime_error("Invalid SMT \"show unproved\" choice."));
auto const& showUnsupported = m_reader.stringSetting("SMTShowUnsupported", "yes");
if (showUnsupported == "no")
m_modelCheckerSettings.showUnsupported = false;
else if (showUnsupported == "yes")
m_modelCheckerSettings.showUnsupported = true;
else
BOOST_THROW_EXCEPTION(runtime_error("Invalid SMT \"show unsupported\" choice."));
m_modelCheckerSettings.solvers = smtutil::SMTSolverChoice::None();
auto const& choice = m_reader.stringSetting("SMTSolvers", "z3");
if (choice == "none")
@@ -16,7 +16,7 @@ contract C {
// Warning 6031: (182-186): Internal error: Expression undefined for SMT solver.
// Warning 6031: (190-194): Internal error: Expression undefined for SMT solver.
// Warning 7229: (206-212): Assertion checker does not yet implement the type function (uint256) returns (uint256) for comparisons
// Warning 6328: (175-195): CHC: Assertion violation happens here.\nCounterexample:\na = 0, b = 0\n\nTransaction trace:\nC.constructor()\nState: a = 0, b = 0\nC.g()\n C.f(0, 0) -- internal call
// Warning 6328: (199-213): CHC: Assertion violation happens here.\nCounterexample:\na = 0, b = 0\n\nTransaction trace:\nC.constructor()\nState: a = 0, b = 0\nC.g()\n C.f(0, 0) -- internal call
// Warning 5729: (182-186): BMC does not yet implement this type of function call.
// Warning 5729: (190-194): BMC does not yet implement this type of function call.
// Warning 6328: (175-195): CHC: Assertion violation happens here.
// Warning 6328: (199-213): CHC: Assertion violation happens here.
@@ -0,0 +1,18 @@
contract C {
function f(uint x, uint y) public pure {
assembly {}
assert(x < y);
}
function g(uint x, uint y) public pure {
assembly {}
assert(x < y);
}
}
// ====
// SMTEngine: all
// SMTShowUnsupported: no
// ----
// Warning 5724: SMTChecker: 2 unsupported language feature(s). Enable the model checker option "show unsupported" to see all of them.
// Warning 6328: (86-99): CHC: Assertion violation happens here.
// Warning 6328: (181-194): CHC: Assertion violation happens here.
+3
View File
@@ -149,6 +149,7 @@ BOOST_AUTO_TEST_CASE(cli_mode_options)
"--model-checker-invariants=contract,reentrancy",
"--model-checker-show-proved-safe",
"--model-checker-show-unproved",
"--model-checker-show-unsupported",
"--model-checker-solvers=z3,smtlib2",
"--model-checker-targets=underflow,divByZero",
"--model-checker-timeout=5",
@@ -217,6 +218,7 @@ BOOST_AUTO_TEST_CASE(cli_mode_options)
{{InvariantType::Contract, InvariantType::Reentrancy}},
true,
true,
true,
{false, false, true, true},
{{VerificationTargetType::Underflow, VerificationTargetType::DivByZero}},
5,
@@ -414,6 +416,7 @@ BOOST_AUTO_TEST_CASE(invalid_options_input_modes_combinations)
{"--metadata-hash=swarm", {"--assemble", "--yul", "--strict-assembly", "--standard-json", "--link"}},
{"--model-checker-show-proved-safe", {"--assemble", "--yul", "--strict-assembly", "--standard-json", "--link"}},
{"--model-checker-show-unproved", {"--assemble", "--yul", "--strict-assembly", "--standard-json", "--link"}},
{"--model-checker-show-unsupported", {"--assemble", "--yul", "--strict-assembly", "--standard-json", "--link"}},
{"--model-checker-div-mod-no-slacks", {"--assemble", "--yul", "--strict-assembly", "--standard-json", "--link"}},
{"--model-checker-engine=bmc", {"--assemble", "--yul", "--strict-assembly", "--standard-json", "--link"}},
{"--model-checker-invariants=contract,reentrancy", {"--assemble", "--yul", "--strict-assembly", "--standard-json", "--link"}},
+1
View File
@@ -112,6 +112,7 @@ void FuzzerUtil::testCompiler(
frontend::ModelCheckerInvariants::All(),
/*showProvedSafe=*/false,
/*showUnproved=*/false,
/*showUnsupported=*/false,
smtutil::SMTSolverChoice::All(),
frontend::ModelCheckerTargets::Default(),
/*timeout=*/1