Add ast2 union support
This commit is contained in:
parent
3f500898aa
commit
1a9911fc25
3 changed files with 76 additions and 13 deletions
|
|
@ -35,8 +35,8 @@ typedef struct A20 { char a1; } A20, A21, *A21p;
|
|||
typedef struct A22 { int **f1; int *f2[123+132]; } A22;
|
||||
|
||||
//Unions
|
||||
//union UNION1 {int f1; };
|
||||
//typedef union UNION2 { int **f1; int abc[123+132]; } UNION2;
|
||||
union U1 {int f1; float f2; };
|
||||
typedef union U2 { int **f1; int abc[123+132]; } U2;
|
||||
|
||||
// Anonymous
|
||||
//typedef struct { char a1; };
|
||||
|
|
|
|||
|
|
@ -71,4 +71,10 @@ assert A21 is A20
|
|||
assert A21p is ptr A20
|
||||
|
||||
assert A22 is object
|
||||
testFields(A22, {"f1": "ptr ptr cint", "f2": "array[0..254, ptr cint]"}.toTable())
|
||||
testFields(A22, {"f1": "ptr ptr cint", "f2": "array[0..254, ptr cint]"}.toTable())
|
||||
|
||||
assert U1 is object
|
||||
assert sizeof(U1) == sizeof(cfloat)
|
||||
|
||||
assert U2 is object
|
||||
assert sizeof(U2) == 256 * sizeof(cint)
|
||||
Loading…
Add table
Add a link
Reference in a new issue