int f( int, int );
int g( int, int, int );
static [ int, int *, * int, int ] h( int a, int b, * int c, [] char d );

struct inner {
    int f2, f3;
};

struct outer {
    int f1;
    struct inner i;
    double f4;
} s, *sp;

const volatile [ int, int ] t1;
static const [ int, const int ] t2;
const static [ int, const int ] t3;

[ int rc ] printf( * char fmt, ... );
int printf( char *fmt, ... );

[ short x, unsigned y ] f1( int w ) {
    [ y, x ] = [ x, y ] = [ w, 23 ];
}

[ [ int, char, long, int ] r ] g1() {
    short x, p;
    unsigned int y;
    [ int, int ] z;

    [ x, y, z ] = ([short, unsigned int, [int, int]])([ p, f( 17 ), 3 ]);
    r = [ x, y, z ];
}

[ int rc ] main( int argc, ** char argv ) {
    int a, b, c, d;
    struct outer t = { .[ f1,f4 ] : [ 1,7.0 ] };
    f( [ 3,5 ] );
    g( [ 3,5 ], 3 );
    f( t1 );
    g( t1, 3 );
    [ 3,5 ];
    [ a,b ] = 3;
    [ a,b ] = [ 4.6 ];
    [ a,b ] = [ c,d ] = [ 3,5 ];
    [ a,b,[ c ] ] = [ 2,[ a,b ] ];
    [ a,b ] = 3 > 4 ? [ b,6 ] : [ 7,8 ];

    t1 = [ a,b ];
    t1 = t2 = [ a,b ];
    [ a,b ] = [ c,d ] = d += c += 1;
    [ a,b ] = [ c,d ] = t1;
    [ a,b ] = t1 = [ c,d ];
    [ a,b ] = t1 = t2 = [ c,d ];
    t1 = [ 3,4 ] = [ 3,4 ] = t1 = [ 3,4 ];

    s.[ f1, i.[ f2, f3 ], f4 ] = [ 11, 12, 13, 3.14159 ];
    s.[ f1, i.[ f2, f3 ], f4 ] = h( 3, 3, 0, "abc" );
    sp->[ f4,f1 ] = sp->[ f1,f4 ];
    printf( "expecting 3, 17, 23, 4; got %d, %d, %d, %d\n", s.[ f4, i.[ f3,f2 ], f1 ] );
    rc = 0;
}
