From 7ff44bec94dd72acb73c2caa26786113c24c8360 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 25 Jan 2017 10:37:33 +0000 Subject: Add test for shadowing inline assembly instruction --- test/libsolidity/SolidityParser.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/libsolidity') diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp index a3bfab75..22766358 100644 --- a/test/libsolidity/SolidityParser.cpp +++ b/test/libsolidity/SolidityParser.cpp @@ -1479,6 +1479,19 @@ BOOST_AUTO_TEST_CASE(function_type_state_variable) BOOST_CHECK(successParse(text)); } +BOOST_AUTO_TEST_CASE(inline_assembly_shadowed_instruction) +{ + char const* text = R"( + contract A { + function f() { + assembly { + let gas := 1 + } + } + } + )"; + CHECK_PARSE_ERROR(text, "Cannot shadow instructions with variable declaration."); +} BOOST_AUTO_TEST_SUITE_END() -- cgit