Changeset 0b2961f for src/Tests/SynTree/Tuple.c
- Timestamp:
- Jun 9, 2015, 3:19:04 PM (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:
- 8a95629
- Parents:
- 81419b5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tests/SynTree/Tuple.c
r81419b5 r0b2961f 1 1 int f( int, int ); 2 2 int g( int, int, int ); 3 static [ int, int ,int, int ] h( int a, int b, * int c, [] char d );3 static [ int, int *, * int, int ] h( int a, int b, * int c, [] char d ); 4 4 5 5 struct inner { … … 30 30 31 31 [ x, y, z ] = [ p, f( 17 ), 3 ]; 32 [ x, y, z ] = ([short, unsigned int, [int, int]])([ p, f( 17 ), 3 ]); 32 33 r = [ x, y, z ]; 33 34 } … … 40 41 f( t1 ); 41 42 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 43 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 ]; 44 [ , , , ]; /* empty tuple */ 45 [ 3, 5 ]; 46 [ a, b ] = 3; 47 [ a, b ] = [ 4.6 ]; 48 [ a, b ] = [ c, d ] = [ 3, 5 ]; 49 [ a, b, [ c ] ] = [ 2,[ a, b ] ]; 50 [ a, b ] = 3 > 4 ? [ b, 6 ] : [ 7, 8 ]; 51 52 t1 = [ a, b ]; 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 ]; 56 59 57 60 s.[ f1, i.[ f2, f3 ], f4 ] = [ 11, 12, 13, 3.14159 ]; 58 61 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 ] ); 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 ] ); 61 65 rc = 0; 62 66 }
Note: See TracChangeset
for help on using the changeset viewer.