ppcg_kernel: initialize array field as soon as ppcg_kernel is created
[ppcg.git] / tests / struct3.c
blobde383b65cdf2ac1ba1c55cd89a474ca8b13b991d
1 #include <stdlib.h>
3 struct s {
4 int a;
5 int b;
6 };
8 int main()
10 struct s a, b[10];
12 a.b = 57;
13 #pragma scop
14 a.a = 42;
15 for (int i = 0; i < 10; ++i)
16 b[i] = a;
17 #pragma endscop
18 for (int i = 0; i < 10; ++i)
19 if (b[i].a != 42)
20 return EXIT_FAILURE;
21 if (a.b != 57)
22 return EXIT_FAILURE;
24 return EXIT_SUCCESS;