Skip to content

Commit e93ad30

Browse files
committed
Remove obsolete enforce-via-yul logic and CI run.
1 parent 0cb9590 commit e93ad30

30 files changed

+34
-46
lines changed

.circleci/config.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,16 +1035,6 @@ jobs:
10351035
condition: true
10361036
<<: *steps_soltest
10371037

1038-
t_ubu_soltest_enforce_yul: &t_ubu_soltest_enforce_yul
1039-
<<: *base_ubuntu2004
1040-
parallelism: 20
1041-
environment:
1042-
EVM: << pipeline.parameters.evm-version >>
1043-
SOLTEST_FLAGS: --enforce-via-yul
1044-
OPTIMIZE: 0
1045-
TERM: xterm
1046-
<<: *steps_soltest
1047-
10481038
t_ubu_clang_soltest: &t_ubu_clang_soltest
10491039
<<: *base_ubuntu2004_clang
10501040
parallelism: 20
@@ -1515,7 +1505,6 @@ workflows:
15151505
- t_ubu_cli: *workflow_ubuntu2004
15161506
- t_ubu_locale: *workflow_ubuntu2004
15171507
- t_ubu_soltest_all: *workflow_ubuntu2004
1518-
- t_ubu_soltest_enforce_yul: *workflow_ubuntu2004
15191508
- b_ubu_clang: *workflow_trigger_on_tags
15201509
- t_ubu_clang_soltest: *workflow_ubuntu2004_clang
15211510
- t_ubu_lsp: *workflow_ubuntu2004

test/Common.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ void CommonOptions::addOptions()
107107
("no-semantic-tests", po::bool_switch(&disableSemanticTests)->default_value(disableSemanticTests), "disable semantic tests")
108108
("no-smt", po::bool_switch(&disableSMT)->default_value(disableSMT), "disable SMT checker")
109109
("optimize", po::bool_switch(&optimize)->default_value(optimize), "enables optimization")
110-
("enforce-via-yul", po::value<bool>(&enforceViaYul)->default_value(enforceViaYul)->implicit_value(true), "Enforce compiling all tests via yul to see if additional tests can be activated.")
111110
("enforce-compile-to-ewasm", po::bool_switch(&enforceCompileToEwasm)->default_value(enforceCompileToEwasm), "Enforce compiling all tests to Ewasm to see if additional tests can be activated.")
112111
("enforce-gas-cost", po::value<bool>(&enforceGasTest)->default_value(enforceGasTest)->implicit_value(true), "Enforce checking gas cost in semantic tests.")
113112
("enforce-gas-cost-min-value", po::value(&enforceGasTestMinValue)->default_value(enforceGasTestMinValue), "Threshold value to enforce adding gas checks to a test.")

test/Common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ struct CommonOptions
6060
boost::filesystem::path testPath;
6161
bool ewasm = false;
6262
bool optimize = false;
63-
bool enforceViaYul = false;
6463
bool enforceCompileToEwasm = false;
6564
bool enforceGasTest = false;
6665
u256 enforceGasTestMinValue = 100000;

test/TestCase.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class TestCase
4040
std::string filename;
4141
langutil::EVMVersion evmVersion;
4242
std::vector<boost::filesystem::path> vmPaths;
43-
bool enforceCompileViaYul = false;
4443
bool enforceCompileToEwasm = false;
4544
bool enforceGasCost = false;
4645
u256 enforceGasCostMinValue;

test/boostTest.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ int registerTests(
133133
boost::unit_test::test_suite& _suite,
134134
boost::filesystem::path const& _basepath,
135135
boost::filesystem::path const& _path,
136-
bool _enforceViaYul,
137136
bool _enforceCompileToEwasm,
138137
vector<string> const& _labels,
139138
TestCase::TestCaseCreator _testCaseCreator,
@@ -146,7 +145,6 @@ int registerTests(
146145
fullpath.string(),
147146
solidity::test::CommonOptions::get().evmVersion(),
148147
solidity::test::CommonOptions::get().vmPaths,
149-
_enforceViaYul,
150148
_enforceCompileToEwasm,
151149
solidity::test::CommonOptions::get().enforceGasTest,
152150
solidity::test::CommonOptions::get().enforceGasTestMinValue,
@@ -165,7 +163,6 @@ int registerTests(
165163
numTestsAdded += registerTests(
166164
*sub_suite,
167165
_basepath, _path / entry.path().filename(),
168-
_enforceViaYul,
169166
_enforceCompileToEwasm,
170167
_labels,
171168
_testCaseCreator,
@@ -271,7 +268,6 @@ test_suite* init_unit_test_suite(int /*argc*/, char* /*argv*/[])
271268
master,
272269
options.testPath / ts.path,
273270
ts.subpath,
274-
options.enforceViaYul,
275271
options.enforceCompileToEwasm,
276272
ts.labels,
277273
ts.testCaseCreator,

test/libsolidity/SemanticTest.cpp

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ SemanticTest::SemanticTest(
4949
string const& _filename,
5050
langutil::EVMVersion _evmVersion,
5151
vector<boost::filesystem::path> const& _vmPaths,
52-
bool _enforceViaYul,
5352
bool _enforceCompileToEwasm,
5453
bool _enforceGasCost,
5554
u256 _enforceGasCostMinValue
@@ -60,27 +59,32 @@ SemanticTest::SemanticTest(
6059
m_lineOffset(m_reader.lineNumber()),
6160
m_builtins(makeBuiltins()),
6261
m_sideEffectHooks(makeSideEffectHooks()),
63-
m_enforceViaYul(_enforceViaYul),
6462
m_enforceCompileToEwasm(_enforceCompileToEwasm),
6563
m_enforceGasCost(_enforceGasCost),
6664
m_enforceGasCostMinValue(move(_enforceGasCostMinValue))
6765
{
68-
static set<string> const compileViaYulAllowedValues{"also", "true", "false", "default"};
66+
static set<string> const compileViaYulAllowedValues{"also", "true", "false"};
6967
static set<string> const yulRunTriggers{"also", "true"};
7068
static set<string> const legacyRunTriggers{"also", "false", "default"};
7169

70+
m_runWithABIEncoderV1Only = m_reader.boolSetting("ABIEncoderV1Only", false);
71+
if (m_runWithABIEncoderV1Only && !solidity::test::CommonOptions::get().useABIEncoderV1)
72+
m_shouldRun = false;
73+
7274
string compileViaYul = m_reader.stringSetting("compileViaYul", "default");
75+
if (m_runWithABIEncoderV1Only && compileViaYul != "false")
76+
BOOST_THROW_EXCEPTION(runtime_error(
77+
"ABIEncoderV1Only tests cannot be run via yul, "
78+
"so they need to also specify ``compileViaYul: false``"
79+
));
7380
if (!util::contains(compileViaYulAllowedValues, compileViaYul))
7481
BOOST_THROW_EXCEPTION(runtime_error("Invalid compileViaYul value: " + compileViaYul + "."));
7582
m_testCaseWantsYulRun = util::contains(yulRunTriggers, compileViaYul);
7683
m_testCaseWantsLegacyRun = util::contains(legacyRunTriggers, compileViaYul);
7784

78-
// Do not enforce via yul and ewasm, if via yul was explicitly denied.
85+
// Do not enforce ewasm, if via yul was explicitly denied.
7986
if (compileViaYul == "false")
80-
{
81-
m_enforceViaYul = false;
8287
m_enforceCompileToEwasm = false;
83-
}
8488

8589
string compileToEwasm = m_reader.stringSetting("compileToEwasm", "false");
8690
if (compileToEwasm == "also")
@@ -97,18 +101,6 @@ SemanticTest::SemanticTest(
97101
if (m_testCaseWantsEwasmRun && !m_supportsEwasm)
98102
m_testCaseWantsEwasmRun = false;
99103

100-
m_runWithABIEncoderV1Only = m_reader.boolSetting("ABIEncoderV1Only", false);
101-
if (m_runWithABIEncoderV1Only && !solidity::test::CommonOptions::get().useABIEncoderV1)
102-
m_shouldRun = false;
103-
104-
// Sanity check
105-
if (m_runWithABIEncoderV1Only && (compileViaYul == "true" || compileViaYul == "also"))
106-
BOOST_THROW_EXCEPTION(runtime_error(
107-
"ABIEncoderV1Only can not be used with compileViaYul=" + compileViaYul +
108-
", set it to false or omit the flag. The compileViaYul setting ignores the abicoder pragma"
109-
" and runs everything with ABICoder V2."
110-
));
111-
112104
auto revertStrings = revertStringsFromString(m_reader.stringSetting("revertStrings", "default"));
113105
soltestAssert(revertStrings, "Invalid revertStrings setting.");
114106
m_revertStrings = revertStrings.value();
@@ -307,7 +299,7 @@ TestCase::TestResult SemanticTest::run(ostream& _stream, string const& _linePref
307299
if (m_testCaseWantsLegacyRun)
308300
result = runTest(_stream, _linePrefix, _formatted, false, false);
309301

310-
if ((m_testCaseWantsYulRun || m_enforceViaYul) && result == TestResult::Success)
302+
if (m_testCaseWantsYulRun && result == TestResult::Success)
311303
result = runTest(_stream, _linePrefix, _formatted, true, false);
312304

313305
if ((m_testCaseWantsEwasmRun || m_enforceCompileToEwasm) && result == TestResult::Success)

test/libsolidity/SemanticTest.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ class SemanticTest: public SolidityExecutionFramework, public EVMVersionRestrict
5252
_options.filename,
5353
_options.evmVersion,
5454
_options.vmPaths,
55-
_options.enforceCompileViaYul,
5655
_options.enforceCompileToEwasm,
5756
_options.enforceGasCost,
5857
_options.enforceGasCostMinValue
@@ -63,7 +62,6 @@ class SemanticTest: public SolidityExecutionFramework, public EVMVersionRestrict
6362
std::string const& _filename,
6463
langutil::EVMVersion _evmVersion,
6564
std::vector<boost::filesystem::path> const& _vmPaths,
66-
bool _enforceViaYul = false,
6765
bool _enforceCompileToEwasm = false,
6866
bool _enforceGasCost = false,
6967
u256 _enforceGasCostMinValue = 100000
@@ -97,10 +95,9 @@ class SemanticTest: public SolidityExecutionFramework, public EVMVersionRestrict
9795
std::vector<TestFunctionCall> m_tests;
9896
std::map<std::string, Builtin> const m_builtins;
9997
std::vector<SideEffectHook> const m_sideEffectHooks;
100-
bool m_testCaseWantsYulRun = false;
98+
bool m_testCaseWantsYulRun = true;
10199
bool m_testCaseWantsEwasmRun = false;
102100
bool m_testCaseWantsLegacyRun = true;
103-
bool m_enforceViaYul = false;
104101
bool m_enforceCompileToEwasm = false;
105102
bool m_runWithABIEncoderV1Only = false;
106103
bool m_allowNonExistingFunctions = false;

test/libsolidity/semanticTests/abiEncoderV1/bool_out_of_bounds.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ contract C {
44
}
55
// ====
66
// ABIEncoderV1Only: true
7+
// compileViaYul: false
78
// ----
89
// f(bool): true -> true
910
// f(bool): false -> false

test/libsolidity/semanticTests/abiEncoderV1/cleanup/cleanup.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ contract C {
77
}
88
// ====
99
// ABIEncoderV1Only: true
10+
// compileViaYul: false
1011
// ----
1112
// f(uint16,int16,address,bytes3,bool): 1, 2, 3, "a", true -> 1, 2, 3, "a", true
1213
// f(uint16,int16,address,bytes3,bool): 0xffffff, 0x1ffff, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, "abcd", 1 -> 0xffff, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, 0xffffffffffffffffffffffffffffffffffffffff, "abc", true

test/libsolidity/semanticTests/abiEncoderV1/enums.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ contract C {
77
}
88
// ====
99
// ABIEncoderV1Only: true
10+
// compileViaYul: false
1011
// ----
1112
// f(uint8): 0 -> 0
1213
// f(uint8): 1 -> 1

0 commit comments

Comments
 (0)