If a variable was declared in all branches of a structures command, it
may or may not be declared as something else afterwards.
We need to test both options.
Signed-off-by: NeilBrown <neil@brown.name>
@mv *.gcov coverage ; [ -f .gcov ] && mv .gcov coverage || true
@ awk '/NOTEST/ { next } /^ *[1-9]/ {ran+=1} /^ *###/ {skip+=1} \
END {printf "coverage: %6.2f%%\n", ran * 100 / (ran + skip); \
- if (ran < (ran + skip) *0.9469) exit(1) }' \
+ if (ran < (ran + skip) *0.9495) exit(1) }' \
coverage/oceani.mdc.gcov
@rm -f .tmp*
print num,", ",
print
+ for i:=0; then i=i+1; while i < 5:
+ switch i:
+ case 0: num:="zero"
+ case 1: num:="one"
+ case 2: num:="two"
+ case 3: num:="three"
+ else num:="many"
+ // re-declare a CondScope variable
+ num := i*i
+ print num,", ",
+ print
+
###### output: varmerge
zero , one , two , three , many ,
+ 0 , 1 , 4 , 9 , 16 ,
## Conditions and Loops