diff options
author | chriseth <chris@ethereum.org> | 2018-02-20 02:21:16 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-02-20 02:22:39 +0800 |
commit | a680cbd47411c20b8bda59b535fc138974e72f0d (patch) | |
tree | 47c994e934b052a8ac53f183eeb58ec6513ce3af /test/libsolidity | |
parent | abc23ac6086fe724b82eb8ca7f9805cf7ff5ba10 (diff) | |
download | dexon-solidity-a680cbd47411c20b8bda59b535fc138974e72f0d.tar.gz dexon-solidity-a680cbd47411c20b8bda59b535fc138974e72f0d.tar.zst dexon-solidity-a680cbd47411c20b8bda59b535fc138974e72f0d.zip |
Test ``_offset`` for constants in inline assembly.
Diffstat (limited to 'test/libsolidity')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 2b102312..7c03d7cb 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -5776,6 +5776,21 @@ BOOST_AUTO_TEST_CASE(inline_assembly_storage_variable_access_out_of_functions) CHECK_SUCCESS_NO_WARNINGS(text); } +BOOST_AUTO_TEST_CASE(inline_assembly_constant_variable_via_offset) +{ + char const* text = R"( + contract test { + uint constant x = 2; + function f() pure public { + assembly { + let r := x_offset + } + } + } + )"; + CHECK_ERROR(text, TypeError, "Constant variables not supported by inline assembly."); +} + BOOST_AUTO_TEST_CASE(inline_assembly_calldata_variables) { char const* text = R"( |