Skip to content

Commit

Permalink
Pass evmVersion and eofVersion to YulStack in ObjectCompilerTest
Browse files Browse the repository at this point in the history
  • Loading branch information
rodiazet committed Oct 11, 2024
1 parent 3edd2e1 commit a5fd106
Show file tree
Hide file tree
Showing 28 changed files with 46 additions and 4 deletions.
6 changes: 3 additions & 3 deletions test/libyul/ObjectCompilerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ using namespace solidity::frontend;
using namespace solidity::frontend::test;

ObjectCompilerTest::ObjectCompilerTest(std::string const& _filename):
TestCase(_filename)
solidity::frontend::test::EVMVersionRestrictedTestCase(_filename)
{
m_source = m_reader.source();
m_optimisationPreset = m_reader.enumSetting<OptimisationPreset>(
Expand All @@ -65,8 +65,8 @@ ObjectCompilerTest::ObjectCompilerTest(std::string const& _filename):
TestCase::TestResult ObjectCompilerTest::run(std::ostream& _stream, std::string const& _linePrefix, bool const _formatted)
{
YulStack stack(
EVMVersion(),
std::nullopt,
solidity::test::CommonOptions::get().evmVersion(),
solidity::test::CommonOptions::get().eofVersion(),
YulStack::Language::StrictAssembly,
OptimiserSettings::preset(m_optimisationPreset),
DebugInfoSelection::All()
Expand Down
2 changes: 1 addition & 1 deletion test/libyul/ObjectCompilerTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct Block;
namespace solidity::yul::test
{

class ObjectCompilerTest: public solidity::frontend::test::TestCase
class ObjectCompilerTest: public solidity::frontend::test::EVMVersionRestrictedTestCase
{
public:
static std::unique_ptr<TestCase> create(Config const& _config)
Expand Down
2 changes: 2 additions & 0 deletions test/libyul/objectCompiler/datacopy.yul
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ object "a" {
data "data1" "Hello, World!"
}
}
// ====
// EVMVersion: >=shanghai
// ----
// Assembly:
// /* "source":77:92 */
Expand Down
2 changes: 2 additions & 0 deletions test/libyul/objectCompiler/dataoffset_code.yul
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ object "a" {
data "data1" "Hello, World!"
}
}
// ====
// EVMVersion: >=shanghai
// ----
// Assembly:
// /* "source":44:61 */
Expand Down
2 changes: 2 additions & 0 deletions test/libyul/objectCompiler/dataoffset_data.yul
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ object "a" {
code { sstore(0, dataoffset("data1")) }
data "data1" "Hello, World!"
}
// ====
// EVMVersion: >=shanghai
// ----
// Assembly:
// /* "source":56:75 */
Expand Down
2 changes: 2 additions & 0 deletions test/libyul/objectCompiler/dataoffset_self.yul
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ object "a" {
code { sstore(0, dataoffset("a")) }
data "data1" "Hello, World!"
}
// ====
// EVMVersion: >=shanghai
// ----
// Assembly:
// /* "source":44:59 */
Expand Down
2 changes: 2 additions & 0 deletions test/libyul/objectCompiler/datasize_code.yul
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ object "a" {
data "data1" "Hello, World!"
}
}
// ====
// EVMVersion: >=shanghai
// ----
// Assembly:
// /* "source":44:59 */
Expand Down
2 changes: 2 additions & 0 deletions test/libyul/objectCompiler/datasize_data.yul
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ object "a" {
code { sstore(0, datasize("data1")) }
data "data1" "Hello, World!"
}
// ====
// EVMVersion: >=shanghai
// ----
// Assembly:
// /* "source":44:61 */
Expand Down
2 changes: 2 additions & 0 deletions test/libyul/objectCompiler/datasize_self.yul
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ object "a" {
code { sstore(0, datasize("a")) }
data "data1" "Hello, World!"
}
// ====
// EVMVersion: >=shanghai
// ----
// Assembly:
// /* "source":36:49 */
Expand Down
1 change: 1 addition & 0 deletions test/libyul/objectCompiler/function_series.yul
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ object "Contract" {
}

// ====
// EVMVersion: >=shanghai
// optimizationPreset: none
// ----
// Assembly:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ object "A" {
}
}
// ====
// EVMVersion: >=shanghai
// optimizationPreset: full
// ----
// Assembly:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ object "A" {
}
}
// ====
// EVMVersion: >=shanghai
// optimizationPreset: full
// ----
// Assembly:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ object "A" {
}
}
// ====
// EVMVersion: >=shanghai
// optimizationPreset: full
// ----
// Assembly:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ object "A" {
}
}
// ====
// EVMVersion: >=shanghai
// optimizationPreset: full
// ----
// Assembly:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ object "A" {
}
}
// ====
// EVMVersion: >=shanghai
// optimizationPreset: full
// ----
// Assembly:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ object "a" {
)
}
}
// ====
// EVMVersion: >=shanghai
// ----
// Assembly:
// /* "source":143:185 */
Expand Down
2 changes: 2 additions & 0 deletions test/libyul/objectCompiler/leading_and_trailing_dots.yul
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
}
g(2)
}
// ====
// EVMVersion: >=shanghai
// ----
// Assembly:
// /* "source":53:54 */
Expand Down
2 changes: 2 additions & 0 deletions test/libyul/objectCompiler/linkersymbol.yul
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ object "a" {
let success := call(gas(), addr, 0, 128, 4, 128, 0)
}
}
// ====
// EVMVersion: >=shanghai
// ----
// Assembly:
// /* "source":190:191 */
Expand Down
1 change: 1 addition & 0 deletions test/libyul/objectCompiler/long_object_name.yul
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ object "t" {
}
}
// ====
// EVMVersion: >=shanghai
// optimizationPreset: full
// ----
// Assembly:
Expand Down
2 changes: 2 additions & 0 deletions test/libyul/objectCompiler/manySubObjects.yul
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ object "root" {
}
}
}
// ====
// EVMVersion: >=shanghai
// ----
// Assembly:
// /* "source":59:75 */
Expand Down
2 changes: 2 additions & 0 deletions test/libyul/objectCompiler/metadata.yul
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ object "A" {
data ".metadata" "M2"
data "x" "Hello, World2!"
}
// ====
// EVMVersion: >=shanghai
// ----
// Assembly:
// /* "source":55:68 */
Expand Down
2 changes: 2 additions & 0 deletions test/libyul/objectCompiler/namedObjectCode.yul
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
object "a" {
code { sstore(0, 1) }
}
// ====
// EVMVersion: >=shanghai
// ----
// Assembly:
// /* "source":36:37 */
Expand Down
1 change: 1 addition & 0 deletions test/libyul/objectCompiler/nested_optimizer.yul
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ object "a" {
}
}
// ====
// EVMVersion: >=shanghai
// optimizationPreset: full
// ----
// Assembly:
Expand Down
2 changes: 2 additions & 0 deletions test/libyul/objectCompiler/simple.yul
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
sstore(0, 1)
}
// ====
// EVMVersion: >=shanghai
// ----
// Assembly:
// /* "source":41:42 */
Expand Down
1 change: 1 addition & 0 deletions test/libyul/objectCompiler/simple_optimizer.yul
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
sstore(add(x, 0), z)
}
// ====
// EVMVersion: >=shanghai
// optimizationPreset: full
// ----
// Assembly:
Expand Down
2 changes: 2 additions & 0 deletions test/libyul/objectCompiler/sourceLocations.yul
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ object "a" {
data "data1" "Hello, World!"
}
}
// ====
// EVMVersion: >=shanghai
// ----
// Assembly:
// /* "abc.sol":0:2 */
Expand Down
2 changes: 2 additions & 0 deletions test/libyul/objectCompiler/subObjectAccess.yul
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ object "A" {
}
}
}
// ====
// EVMVersion: >=shanghai
// ----
// Assembly:
// /* "source":57:72 */
Expand Down
1 change: 1 addition & 0 deletions test/libyul/objectCompiler/verbatim_bug.yul
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ object "a" {
}
}
// ====
// EVMVersion: >=shanghai
// optimizationPreset: full
// ----
// Assembly:
Expand Down

0 comments on commit a5fd106

Please sign in to comment.