Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion clang/test/Verify/suite/extent_separation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ void copy(const int *a, int *out, int n)
// VCR-NEXT: a
// VCR-NEXT: post

// A copy that writes zeros: its invariant fails where a holds anything else,
// which the solver finds at once (a reversed copy took 30 to 60 s, and on a
// slow runner timed out).
void wrong_copy(const int *a, int *out, int n)
cppverify::pre(n >= 0 && valid(a, n) && valid(out, n))
cppverify::modifies(*out)
Expand All @@ -61,7 +64,7 @@ void wrong_copy(const int *a, int *out, int n)
cppverify::invariant(cppverify::forall(j, 0, i, out[j] == a[j]))
cppverify::decreases(n - i)
{
out[i] = a[n - 1 - i];
out[i] = 0;
i = i + 1;
}
}
Expand Down
Loading