aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-05-24 21:33:10 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-05-26 10:20:34 +0800
commitc64bd3378427b46b0ae37e5d39e8ca6586d697c2 (patch)
tree20ed5ed92e856db88a9d3c30dc3ca1d1ac477f3f /test/libsolidity
parentd745dd6542d488432453035763211fdad78c3a06 (diff)
downloaddexon-solidity-c64bd3378427b46b0ae37e5d39e8ca6586d697c2.tar.gz
dexon-solidity-c64bd3378427b46b0ae37e5d39e8ca6586d697c2.tar.zst
dexon-solidity-c64bd3378427b46b0ae37e5d39e8ca6586d697c2.zip
Disallow instructions as a switch expression
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/InlineAssembly.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/libsolidity/InlineAssembly.cpp b/test/libsolidity/InlineAssembly.cpp
index 18ee9553..f695e1d1 100644
--- a/test/libsolidity/InlineAssembly.cpp
+++ b/test/libsolidity/InlineAssembly.cpp
@@ -230,7 +230,6 @@ BOOST_AUTO_TEST_CASE(switch_statement)
BOOST_CHECK(successParse("{ switch 42 case 1 {} case 2 {} }"));
BOOST_CHECK(successParse("{ switch 42 case 1 {} default {} }"));
BOOST_CHECK(successParse("{ switch 42 case 1 {} case 2 {} default {} }"));
- BOOST_CHECK(successParse("{ 1 2 switch mul case 1 {} case 2 {} default {} }"));
BOOST_CHECK(successParse("{ switch mul(1, 2) case 1 {} case 2 {} default {} }"));
BOOST_CHECK(successParse("{ function f() -> x {} switch f() case 1 {} case 2 {} default {} }"));
}
@@ -248,6 +247,7 @@ BOOST_AUTO_TEST_CASE(switch_duplicate_case)
BOOST_AUTO_TEST_CASE(switch_invalid_expression)
{
CHECK_PARSE_ERROR("{ switch {} default {} }", ParserError, "Expected elementary inline assembly operation.");
+ CHECK_PARSE_ERROR("{ 1 2 switch mul default {} }", ParserError, "Instructions are not supported as expressions for switch.");
}
BOOST_AUTO_TEST_CASE(switch_default_before_case)