diff options
author | chriseth <chris@ethereum.org> | 2017-04-12 17:12:02 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-04-25 22:49:04 +0800 |
commit | 4afd54b23594563036498943087bcd06ef021f94 (patch) | |
tree | 4a2865ec2767272e267a9083f8f35820f29f6e97 /test | |
parent | dfaab73efe1811848a52a218a207f2d4f007a2d8 (diff) | |
download | dexon-solidity-4afd54b23594563036498943087bcd06ef021f94.tar dexon-solidity-4afd54b23594563036498943087bcd06ef021f94.tar.gz dexon-solidity-4afd54b23594563036498943087bcd06ef021f94.tar.bz2 dexon-solidity-4afd54b23594563036498943087bcd06ef021f94.tar.lz dexon-solidity-4afd54b23594563036498943087bcd06ef021f94.tar.xz dexon-solidity-4afd54b23594563036498943087bcd06ef021f94.tar.zst dexon-solidity-4afd54b23594563036498943087bcd06ef021f94.zip |
Convert storge access tests to new explicit slot / offset access.
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 4cf4fa7f..019b0e4e 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -7426,15 +7426,19 @@ BOOST_AUTO_TEST_CASE(inline_assembly_storage_access) uint16 x; uint16 public y; uint public z; - function f() { - // we know that z is aligned because it is too large, so we just discard its - // intra-slot offset value - assembly { 7 z pop sstore } + function f() returns (bool) { + uint off; + assembly { + sstore(z$slot, 7) + off := z$offset + } + assert(off == 0); + return true; } } )"; compileAndRun(sourceCode, 0, "C"); - BOOST_CHECK(callContractFunction("f()") == encodeArgs()); + BOOST_CHECK(callContractFunction("f()") == encodeArgs(true)); BOOST_CHECK(callContractFunction("z()") == encodeArgs(u256(7))); } |