aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/GasMeter.cpp3
-rw-r--r--test/libsolidity/Metadata.cpp5
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp14
3 files changed, 17 insertions, 5 deletions
diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp
index 704ae855..8b41e1db 100644
--- a/test/libsolidity/GasMeter.cpp
+++ b/test/libsolidity/GasMeter.cpp
@@ -49,8 +49,7 @@ public:
{
m_compiler.reset(false);
m_compiler.addSource("", "pragma solidity >=0.0;\n" + _sourceCode);
- /// NOTE: compiles without optimisations
- ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(), "Compiling contract failed");
+ ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(dev::test::Options::get().optimize), "Compiling contract failed");
AssemblyItems const* items = m_compiler.runtimeAssemblyItems("");
ASTNode const& sourceUnit = m_compiler.ast();
diff --git a/test/libsolidity/Metadata.cpp b/test/libsolidity/Metadata.cpp
index 32cf910b..ce1a7b18 100644
--- a/test/libsolidity/Metadata.cpp
+++ b/test/libsolidity/Metadata.cpp
@@ -44,10 +44,9 @@ BOOST_AUTO_TEST_CASE(metadata_stamp)
)";
CompilerStack compilerStack;
compilerStack.addSource("", std::string(sourceCode));
- /// NOTE: compiles without optimisations
- ETH_TEST_REQUIRE_NO_THROW(compilerStack.compile(), "Compiling contract failed");
+ ETH_TEST_REQUIRE_NO_THROW(compilerStack.compile(dev::test::Options::get().optimize), "Compiling contract failed");
bytes const& bytecode = compilerStack.runtimeObject("test").bytecode;
- std::string const& metadata = compilerStack.onChainMetadata("test");
+ std::string const& metadata = compilerStack.metadata("test");
BOOST_CHECK(dev::test::isValidMetadata(metadata));
bytes hash = dev::swarmHash(metadata).asBytes();
BOOST_REQUIRE(hash.size() == 32);
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index cb39101e..649e7970 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -6359,6 +6359,20 @@ BOOST_AUTO_TEST_CASE(explicit_literal_to_storage_string)
CHECK_ERROR(text, TypeError, "Explicit type conversion not allowed from \"literal_string \"abc\"\" to \"string storage pointer\"");
}
+BOOST_AUTO_TEST_CASE(modifiers_access_storage_pointer)
+{
+ char const* text = R"(
+ contract C {
+ struct S { }
+ modifier m(S storage x) {
+ x;
+ _;
+ }
+ }
+ )";
+ CHECK_SUCCESS_NO_WARNINGS(text);
+}
+
BOOST_AUTO_TEST_SUITE_END()
}