fix Issue 22429 - importC: designator-list not supported yet (#14435)

This commit is contained in:
Walter Bright 2022-09-15 02:55:15 -07:00 committed by GitHub
parent 882a655bad
commit 8dc0d27927
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -701,6 +701,20 @@ void test42()
assert(i == 3, __LINE__);
}
/*******************************************/
void test43()
{
static int a[2] = { [0] = 1, [1] = 2, };
assert(a[0] == 1, __LINE__);
assert(a[1] == 2, __LINE__);
typedef struct S { int x; } S;
S s = {.x = 3};
assert(s.x == 3, __LINE__);
}
/*******************************************/
int main()
@ -743,6 +757,7 @@ int main()
test41();
test23230();
test42();
test43();
return 0;
}