1 // Test declaration and initialization of structs (C code)
2 %module struct_initialization
3 
4 %inline %{
5 
6 /* Named types */
7 struct StructA {
8    int x;
9 } instanceA1;
10 
11 struct StructB {
12    int x;
13 } instanceB1, instanceB2, instanceB3;
14 
15 struct StructC {
16    int x;
17 } instanceC1 = { 10 };
18 
19 struct StructD {
20    int x;
21 } instanceD1 = { 10 }, instanceD2 = { 20 }, instanceD3 = { 30 };
22 
23 struct StructE {
24    int x;
25 } instanceE1[3] = { { 1 }, { 2 }, { 3} };
26 
27 struct StructF {
28    int x;
29 } instanceF1[3] = { { 1 }, { 2 } }, instanceF2[2] = { { -1 }, { -2 } }, instanceF3[2] = { { 11 }, { 22 } };
30 
31 %}
32