aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/ABIEncoderTests.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-08-25 23:04:31 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-09-16 03:44:49 +0800
commit73771f5bb2d8aee1b71dfcc909a60aa47c591dec (patch)
tree25e580641cc09f52c11447e2045dea747f3980b3 /test/libsolidity/ABIEncoderTests.cpp
parent7dd372ce5c9ea1cacf2c70a16f0285bb74314db8 (diff)
downloaddexon-solidity-73771f5bb2d8aee1b71dfcc909a60aa47c591dec.tar.gz
dexon-solidity-73771f5bb2d8aee1b71dfcc909a60aa47c591dec.tar.zst
dexon-solidity-73771f5bb2d8aee1b71dfcc909a60aa47c591dec.zip
Named assembly labels.
Diffstat (limited to 'test/libsolidity/ABIEncoderTests.cpp')
-rw-r--r--test/libsolidity/ABIEncoderTests.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/libsolidity/ABIEncoderTests.cpp b/test/libsolidity/ABIEncoderTests.cpp
index 297c4ef0..4ddf17ce 100644
--- a/test/libsolidity/ABIEncoderTests.cpp
+++ b/test/libsolidity/ABIEncoderTests.cpp
@@ -398,6 +398,34 @@ BOOST_AUTO_TEST_CASE(calldata)
)
}
+BOOST_AUTO_TEST_CASE(function_name_collision)
+{
+ // This tests a collision between a function name used by inline assembly
+ // and by the ABI encoder
+ string sourceCode = R"(
+ contract C {
+ function f(uint x) returns (uint) {
+ assembly {
+ function abi_encode_t_uint256_to_t_uint256() {
+ mstore(0, 7)
+ return(0, 0x20)
+ }
+ switch x
+ case 0 { abi_encode_t_uint256_to_t_uint256() }
+ }
+ return 1;
+ }
+ }
+ )";
+ BOTH_ENCODERS(
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callContractFunction("f(uint256)", encodeArgs(0)) == encodeArgs(7));
+ BOOST_CHECK(callContractFunction("f(uint256)", encodeArgs(1)) == encodeArgs(1));
+ )
+}
+
+
+
BOOST_AUTO_TEST_SUITE_END()
}