| 1 | int f( int, int ); | 
|---|
| 2 | int g( int, int, int ); | 
|---|
| 3 | static [ int, int, int, int ] h( int a, int b, * int c, [] char d ); | 
|---|
| 4 |  | 
|---|
| 5 | struct inner { | 
|---|
| 6 | int f2, f3; | 
|---|
| 7 | }; | 
|---|
| 8 |  | 
|---|
| 9 | struct outer { | 
|---|
| 10 | int f1; | 
|---|
| 11 | struct inner i; | 
|---|
| 12 | double f4; | 
|---|
| 13 | } s, *sp; | 
|---|
| 14 |  | 
|---|
| 15 | const volatile [ int, int ] t1; | 
|---|
| 16 | static const [ int, const int ] t2; | 
|---|
| 17 | const static [ int, const int ] t3; | 
|---|
| 18 |  | 
|---|
| 19 | [ int rc ] printf( * char fmt, ... ); | 
|---|
| 20 | int printf( char *fmt, ... ); | 
|---|
| 21 |  | 
|---|
| 22 | [ short x, unsigned y ] f1( int w ) { | 
|---|
| 23 | [ y, x ] = [ x, y ] = [ w, 23 ]; | 
|---|
| 24 | } | 
|---|
| 25 |  | 
|---|
| 26 | [ [ int, char, long, int ] r ] g1() { | 
|---|
| 27 | short x, p; | 
|---|
| 28 | unsigned int y; | 
|---|
| 29 | [ int, int ] z; | 
|---|
| 30 |  | 
|---|
| 31 | [ x, y, z ] = [ p, f( 17 ), 3 ]; | 
|---|
| 32 | r = [ x, y, z ]; | 
|---|
| 33 | } | 
|---|
| 34 |  | 
|---|
| 35 | [ int rc ] main( int argc, ** char argv ) { | 
|---|
| 36 | int a, b, c, d; | 
|---|
| 37 | struct outer t = { .[ f1,f4 ] : [ 1,7.0 ] }; | 
|---|
| 38 | f( [ 3,5 ] ); | 
|---|
| 39 | g( [ 3,5 ], 3 ); | 
|---|
| 40 | f( t1 ); | 
|---|
| 41 | g( t1, 3 ); | 
|---|
| 42 |  | 
|---|
| 43 | [ ,,, ];                                            /* empty tuple */ | 
|---|
| 44 | [ 3,5 ]; | 
|---|
| 45 | [ a,b ] = 3; | 
|---|
| 46 | [ a,b ] = [ 4.6 ]; | 
|---|
| 47 | [ a,b ] = [ c,d ] = [ 3,5 ]; | 
|---|
| 48 | [ a,b,[ c ] ] = [ 2,[ a,b ] ]; | 
|---|
| 49 | [ a,b ] = 3 > 4 ? [ b,6 ] : [ 7,8 ]; | 
|---|
| 50 |  | 
|---|
| 51 | t1 = [ a,b ]; | 
|---|
| 52 | t1 = [ a, ];                                        /* semantic error */ | 
|---|
| 53 | t1 = t2 = [ a,b ]; | 
|---|
| 54 | [ a,b ] = [ c,d ] = d += c += 1; | 
|---|
| 55 | [ a,b ] = [ c,d ] = t1; | 
|---|
| 56 | [ a,b ] = t1 = [ c,d ]; | 
|---|
| 57 | [ a,b ] = t1 = t2 = [ c,d ]; | 
|---|
| 58 | t1 = [ 3,4 ] = [ 3,4 ] = t1 = [ 3,4 ]; | 
|---|
| 59 |  | 
|---|
| 60 | s.[ f1, i.[ f2, f3 ], f4 ] = [ 11, 12, 13, 3.14159 ]; | 
|---|
| 61 | s.[ f1, i.[ f2, f3 ], f4 ] = h( 3, 3, 0, "abc" ); | 
|---|
| 62 | [ a, ,b, ] = h( 3, 3, 0, "abc" );                   /* ignore some results */ | 
|---|
| 63 | sp->[ f4,f1 ] = sp->[ f1,f4 ]; | 
|---|
| 64 | printf( "expecting 3, 17, 23, 4; got %d, %d, %d, %d\n", s.[ f4, i.[ f3,f2 ], f1 ] ); | 
|---|
| 65 | rc = 0; | 
|---|
| 66 | } | 
|---|