-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test case for branching on unions for union-map-domain.
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
tests/regression/27-inv_invariants/20-union-map-domain-float-int.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,28 @@ | ||
// PARAM: --enable ana.float.interval --set ana.base.unions.domain map | ||
#include <goblint.h> | ||
union u { | ||
int x; | ||
float f; | ||
}; | ||
|
||
int main(){ | ||
union u a; | ||
union u b; | ||
|
||
a.x = 12; | ||
b.f = 129.0; | ||
|
||
int i = 0; | ||
if(a.x == b.x){ | ||
i++; | ||
} | ||
// Should not be dead after if | ||
__goblint_check(1); | ||
|
||
if(a.f == b.f){ | ||
i++; | ||
} | ||
// Should not be dead after if | ||
__goblint_check(1); | ||
return 0; | ||
} |