update pet for preserving array extents in case of empty context
[ppcg.git] / tests / struct5.c
blob8629176bec1299fc89ad4ee8b994480b2439fdf0
1 #include <stdlib.h>
3 struct s {
4 int a;
5 int b;
6 };
8 int main()
10 int a[10];
12 for (int i = 0; i < 10; ++i)
13 a[i] = 0;
14 #pragma scop
15 for (int i = 0; i < 10; ++i) {
16 struct s b[1];
17 b[0].a = 1;
18 b[0].b = i;
19 a[i] = b[0].a + b[0].b;
21 #pragma endscop
22 for (int i = 0; i < 10; ++i)
23 if (a[i] != 1 + i)
24 return EXIT_FAILURE;
26 return EXIT_SUCCESS;