From cee93d946d798a4076ab5df5f32c5687608defe8 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 5 May 2017 16:46:26 +0100 Subject: Support parsing let statements without a value --- test/libsolidity/InlineAssembly.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/libsolidity') diff --git a/test/libsolidity/InlineAssembly.cpp b/test/libsolidity/InlineAssembly.cpp index 5197f649..4bf4eb48 100644 --- a/test/libsolidity/InlineAssembly.cpp +++ b/test/libsolidity/InlineAssembly.cpp @@ -195,6 +195,11 @@ BOOST_AUTO_TEST_CASE(vardecl_bool) CHECK_PARSE_ERROR("{ let x := false }", ParserError, "True and false are not valid literals."); } +BOOST_AUTO_TEST_CASE(vardecl_empty) +{ + BOOST_CHECK(successParse("{ let x }")); +} + BOOST_AUTO_TEST_CASE(assignment) { BOOST_CHECK(successParse("{ let x := 2 7 8 add =: x }")); -- cgit From ee3a2c0599d3d5db65ab4b7de61e495ad2acd71c Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Mon, 3 Jul 2017 11:01:07 +0100 Subject: Add end-to-end test --- test/libsolidity/SolidityEndToEndTest.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/libsolidity') diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 7b130082..94d3e168 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -9723,6 +9723,24 @@ BOOST_AUTO_TEST_CASE(multi_modifiers) BOOST_CHECK(callContractFunction("x()") == encodeArgs(u256(12))); } +BOOST_AUTO_TEST_CASE(inlineasm_empty_let) +{ + char const* sourceCode = R"( + contract C { + function f() returns (uint a, uint b) { + assembly { + let x + let y, z + a := x + b := z + } + } + } + )"; + compileAndRun(sourceCode, 0, "C"); + BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(0), u256(0))); +} + BOOST_AUTO_TEST_SUITE_END() } -- cgit