aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-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 a220fe09..8c537346 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -6755,6 +6755,26 @@ BOOST_AUTO_TEST_CASE(internal_library_function_return_var_size)
BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(2)));
}
+BOOST_AUTO_TEST_CASE(iszero_bnot_correct)
+{
+ // A long time ago, some opcodes were renamed, which involved the opcodes
+ // "iszero" and "not".
+ char const* sourceCode = R"(
+ contract C {
+ function f() returns (bool) {
+ bytes32 x = 1;
+ assembly { x := not(x) }
+ if (x != ~bytes32(1)) return false;
+ assembly { x := iszero(x) }
+ if (x != bytes32(0)) return false;
+ return true;
+ }
+ }
+ )";
+ compileAndRun(sourceCode, 0, "C");
+ BOOST_CHECK(callContractFunction("f()") == encodeArgs(true));
+}
+
BOOST_AUTO_TEST_SUITE_END()
}