diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2016-10-21 06:36:05 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2016-10-21 06:57:14 +0800 |
commit | 13b2101ea7b55bc310682935bea4f4e5b07947c6 (patch) | |
tree | 422ff1843ea8f002e8a3d42a2c12f7265b13b971 /test/libsolidity/SolidityEndToEndTest.cpp | |
parent | d50204d8086ce34d11439394152d9fc5556b1cbf (diff) | |
download | dexon-solidity-13b2101ea7b55bc310682935bea4f4e5b07947c6.tar dexon-solidity-13b2101ea7b55bc310682935bea4f4e5b07947c6.tar.gz dexon-solidity-13b2101ea7b55bc310682935bea4f4e5b07947c6.tar.bz2 dexon-solidity-13b2101ea7b55bc310682935bea4f4e5b07947c6.tar.lz dexon-solidity-13b2101ea7b55bc310682935bea4f4e5b07947c6.tar.xz dexon-solidity-13b2101ea7b55bc310682935bea4f4e5b07947c6.tar.zst dexon-solidity-13b2101ea7b55bc310682935bea4f4e5b07947c6.zip |
Add tests for inline assembly in modifiers
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 088fe4d1..0a028a45 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -7304,6 +7304,28 @@ BOOST_AUTO_TEST_CASE(shift_negative_constant_right) BOOST_CHECK(callContractFunction("a()") == encodeArgs(u256(-0x42))); } +BOOST_AUTO_TEST_CASE(inline_assembly_in_modifiers) +{ + char const* sourceCode = R"( + contract C { + modifier m { + uint a = 1; + assembly { + a := 2 + } + if (a != 2) + throw; + _; + } + function f() m returns (bool) { + return true; + } + } + )"; + compileAndRun(sourceCode, 0, "C"); + BOOST_CHECK(callContractFunction("f()") == encodeArgs(true)); +} + BOOST_AUTO_TEST_SUITE_END() } |