Changeset a65d92e for src/Tests/SynTree/Tuple.c
- Timestamp:
- Jun 5, 2015, 9:34:43 AM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 59db689
- Parents:
- 44b5ca0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tests/SynTree/Tuple.c
r44b5ca0 ra65d92e 4 4 5 5 struct inner { 6 6 int f2, f3; 7 7 }; 8 8 9 9 struct outer { 10 11 12 10 int f1; 11 struct inner i; 12 double f4; 13 13 } s, *sp; 14 14 … … 21 21 22 22 [ short x, unsigned y ] f1( int w ) { 23 23 [ y, x ] = [ x, y ] = [ w, 23 ]; 24 24 } 25 25 26 26 [ [ int, char, long, int ] r ] g1() { 27 28 29 27 short x, p; 28 unsigned int y; 29 [ int, int ] z; 30 30 31 32 31 [ x, y, z ] = [ p, f( 17 ), 3 ]; 32 r = [ x, y, z ]; 33 33 } 34 34 35 35 [ int rc ] main( int argc, ** char argv ) { 36 37 38 39 40 41 42 43 44 45 46 47 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 [ 3,5 ]; 43 [ a,b ] = 3; 44 [ a,b ] = [ 4.6 ]; 45 [ a,b ] = [ c,d ] = [ 3,5 ]; 46 [ a,b,[ c ] ] = [ 2,[ a,b ] ]; 47 [ a,b ] = 3 > 4 ? [ b,6 ] : [ 7,8 ]; 48 48 49 50 51 52 53 54 55 49 t1 = [ a,b ]; 50 t1 = t2 = [ a,b ]; 51 [ a,b ] = [ c,d ] = d += c += 1; 52 [ a,b ] = [ c,d ] = t1; 53 [ a,b ] = t1 = [ c,d ]; 54 [ a,b ] = t1 = t2 = [ c,d ]; 55 t1 = [ 3,4 ] = [ 3,4 ] = t1 = [ 3,4 ]; 56 56 57 58 59 60 61 57 s.[ f1, i.[ f2, f3 ], f4 ] = [ 11, 12, 13, 3.14159 ]; 58 s.[ f1, i.[ f2, f3 ], f4 ] = h( 3, 3, 0, "abc" ); 59 sp->[ f4,f1 ] = sp->[ f1,f4 ]; 60 printf( "expecting 3, 17, 23, 4; got %d, %d, %d, %d\n", s.[ f4, i.[ f3,f2 ], f1 ] ); 61 rc = 0; 62 62 } 63 64 // Local Variables: // 65 // tab-width: 4 // 66 // End: //
Note: See TracChangeset
for help on using the changeset viewer.