source:
CIVL/examples/arrayLambda/arrayLambdaCompoundLiterals-bad.cvl
| Last change on this file was 1b85498, checked in by , 14 months ago | |
|---|---|
|
|
| File size: 328 bytes | |
| Line | |
|---|---|
| 1 | $input int n; |
| 2 | $assume(n > 0); |
| 3 | |
| 4 | typedef struct { |
| 5 | int x; |
| 6 | float y; |
| 7 | } simple_t; |
| 8 | |
| 9 | int main() { |
| 10 | simple_t s2[n] = (simple_t[n])$lambda(int i) (simple_t){.y = .9, .x = 42}; |
| 11 | |
| 12 | $assert($forall (int i : 0 .. n-1) s2[i].x == 42 && s2[i].y == 0.0); // '.y' is explicitly initialized so it won't be implicitly initialized after '.x' |
| 13 | } |
Note:
See TracBrowser
for help on using the repository browser.
