Prove "assert true".

This commit is contained in:
Nigel Tao committed 2017-05-20 13:30:15 +10:00
1 parent c736c1c509
commit d3eba13223
2 files changed
+7 -1

No files matched your search

+5 -1
View File
@@ -56,7 +56,11 @@ func (q *checker) bcheckStatement(n *a.Node) error {
n := n.Assert()
condition := n.Condition()
err := errFailed
if reasonID := n.Reason(); reasonID != 0 {
if cv := condition.ConstValue(); cv != nil {
if cv.Cmp(one) == 0 {
err = nil
}
} else if reasonID := n.Reason(); reasonID != 0 {
if reasonFunc := q.reasonMap[reasonID.Key()]; reasonFunc != nil {
err = reasonFunc(q, n)
} else {
+2
View File
@@ -68,6 +68,8 @@ func TestCheck(t *testing.T) {
var p i32
var q i32[0:8]
assert true
while p == q,
post p != q,
{