1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-07-01 03:22:01 +03:00

b2/test/sub{break,cont}: code after named and unnamed jump is handled differently

Now we handle both code paths. Should probably unify the diagnostic some
day, too.
This commit is contained in:
Werner Almesberger 2012-06-03 21:17:31 -03:00
parent fa20078840
commit ed8df3f94e
2 changed files with 31 additions and 2 deletions

View File

@ -112,7 +112,22 @@ EOF
#------------------------------------------------------------------------------
tst_fail "substitutions: break inside block " -q <<EOF
tst_fail "substitutions: unnamed break inside block " -q <<EOF
!-s
foo = x
foo = * {
break
foo = x
}
EOF
expect <<EOF
s:4: syntax error
EOF
#------------------------------------------------------------------------------
tst_fail "substitutions: nmbed break inside block " -q <<EOF
!-s
foo = x
foo = * {

View File

@ -97,7 +97,7 @@ EOF
#------------------------------------------------------------------------------
tst_fail "substitutions: continue inside block" <<EOF
tst_fail "substitutions: unnamed continue inside block" <<EOF
!-s
foo = * {
continue
@ -111,6 +111,20 @@ EOF
#------------------------------------------------------------------------------
tst_fail "substitutions: named continue inside block" <<EOF
!-s
foo = * {
continue foo
bar = x
}
EOF
expect <<EOF
s:4: unreachable code
EOF
#------------------------------------------------------------------------------
tst_fail "substitutions: named continue to unknown block" -q <<EOF
!-s
x = foo