aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-04-18 20:36:20 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-04-20 06:59:06 +0800
commit38460d8b473052bd9d4871ed7f10e72f8fb65615 (patch)
tree907f8f132c325df13bfdc2df1506fe0e2fedab09 /test/libsolidity
parent27d7990684dcd16486f107b61f8d6540530a2200 (diff)
downloaddexon-solidity-38460d8b473052bd9d4871ed7f10e72f8fb65615.tar.gz
dexon-solidity-38460d8b473052bd9d4871ed7f10e72f8fb65615.tar.zst
dexon-solidity-38460d8b473052bd9d4871ed7f10e72f8fb65615.zip
Remove unnecessary masking of the result of known short instructions
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 789b89d1..71386010 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -11881,6 +11881,26 @@ BOOST_AUTO_TEST_CASE(bitwise_shifting_constants_constantinople)
BOOST_CHECK(callContractFunction("shr_3()") == encodeArgs(u256(1)));
}
+BOOST_AUTO_TEST_CASE(senders_balance)
+{
+ char const* sourceCode = R"(
+ contract C {
+ function f() public view returns (uint) {
+ return msg.sender.balance;
+ }
+ }
+ contract D {
+ C c = new C();
+ constructor() payable { }
+ function f() public view returns (uint) {
+ return c.f();
+ }
+ }
+ )";
+ compileAndRun(sourceCode, 27, "D");
+ BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(27)));
+}
+
BOOST_AUTO_TEST_SUITE_END()
}