-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix instrumentation of location invariants at labels
- Loading branch information
Showing
3 changed files
with
71 additions
and
4 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
trunk/examples/witness-checking/regression/sequential/correctness/many-labels.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
extern void abort(void); | ||
extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); | ||
extern int __VERIFIER_nondet_int(); | ||
void reach_error() { __assert_fail("0", "many-labels.c", 3, "reach_error"); } | ||
|
||
int main() { | ||
int x = __VERIFIER_nondet_int(); | ||
if (x < 0) { | ||
return; | ||
} | ||
|
||
if (x == -8) { | ||
goto LABEL_A; | ||
} | ||
if (x == -16) { | ||
goto LABEL_B; | ||
} | ||
if (x == -32) { | ||
goto LABEL_C; | ||
} | ||
if (x == -64) { | ||
goto LABEL_D; | ||
} | ||
return (0); | ||
|
||
LABEL_A: | ||
LABEL_B: | ||
LABEL_C: | ||
LABEL_D: {reach_error();abort();} | ||
return (-1); | ||
} | ||
|
25 changes: 25 additions & 0 deletions
25
...xamples/witness-checking/regression/sequential/correctness/many-labels.c-witness_v01.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
- entry_type: location_invariant | ||
metadata: | ||
format_version: '0.1' | ||
uuid: 386b0121-a302-415f-af28-bf0db7c36d11 | ||
creation_time: '2024-09-07T13:26:54+01:00' | ||
producer: | ||
name: UNUSED | ||
version: 0.2.4-dev-25b2402-m | ||
task: | ||
input_files: | ||
- C:\ultimate\trunk\examples\witness-checking\regression\correctness\many-labels.c | ||
input_file_hashes: | ||
C:\ultimate\trunk\examples\witness-checking\regression\correctness\many-labels.c: UNUSED | ||
specification: UNUSED | ||
data_model: UNUSED | ||
language: C | ||
location: | ||
file_name: C:\ultimate\trunk\examples\witness-checking\regression\correctness\many-labels.c | ||
file_hash: UNUSED | ||
line: 29 | ||
function: main | ||
location_invariant: | ||
string: '0' | ||
type: assertion | ||
format: C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters