1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-29 17:23:44 +02:00

b2/test/hierred: test for redundant conditions

This commit is contained in:
Werner Almesberger 2012-06-01 14:52:32 -03:00
parent 9cafe23fb8
commit 6d4c71586d

135
b2/test/hierred Executable file
View File

@ -0,0 +1,135 @@
#!/bin/bash
. ./Common
###############################################################################
tst "hierarchy: == 1 followed by == 2" <<EOF
N=## {
1: { X=* };
2: { Y=* };
};
EOF
expect <<EOF
N=## {
1: { X=* }
2: { Y=* }
}
EOF
#------------------------------------------------------------------------------
tst "hierarchy: == 2 followed by unreachable == 2" <<EOF
N=## {
2: { X=* };
2: { Y=* };
};
EOF
expect <<EOF
h:4: warning: unreachable condition
N=## {
2: { X=* }
2: { Y=* }
}
EOF
#------------------------------------------------------------------------------
tst "hierarchy: < 2 followed by < 3" <<EOF
N=## {
<2: { X=* };
<3: { Y=* };
};
EOF
expect <<EOF
N=## {
<2: { X=* }
<3: { Y=* }
}
EOF
#------------------------------------------------------------------------------
tst "hierarchy: < 3 followed by unreachable < 2" <<EOF
N=## {
<3: { X=* };
<2: { Y=* };
};
EOF
expect <<EOF
h:4: warning: unreachable condition
N=## {
<3: { X=* }
<2: { Y=* }
}
EOF
#------------------------------------------------------------------------------
tst "hierarchy: < 2 followed by <= 2" <<EOF
N=## {
<2: { X=* };
<=2: { Y=* };
};
EOF
expect <<EOF
N=## {
<2: { X=* }
<=2: { Y=* }
}
EOF
#------------------------------------------------------------------------------
tst "hierarchy: <= 2 followed by unreachable < 2" <<EOF
N=## {
<=2: { X=* };
<2: { Y=* };
};
EOF
expect <<EOF
h:4: warning: unreachable condition
N=## {
<=2: { X=* }
<2: { Y=* }
}
EOF
#------------------------------------------------------------------------------
tst "hierarchy: < 3 followed by > 1" <<EOF
N=## {
<3: { X=* };
>1: { Y=* };
};
EOF
expect <<EOF
N=## {
<3: { X=* }
>1: { Y=* }
}
EOF
#------------------------------------------------------------------------------
tst "hierarchy: < 3 followed by predictable but reachable > 2" <<EOF
N=## {
<3: { X=* };
>2: { Y=* };
};
EOF
expect <<EOF
N=## {
<3: { X=* }
>2: { Y=* }
}
EOF
###############################################################################