Ignore:
Timestamp:
Jun 5, 2015, 9:34:43 AM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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
Message:

regression testing, second attempt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Tests/SynTree/Tuple.c

    r44b5ca0 ra65d92e  
    44
    55struct inner {
    6     int f2, f3;
     6        int f2, f3;
    77};
    88
    99struct outer {
    10     int f1;
    11     struct inner i;
    12     double f4;
     10        int f1;
     11        struct inner i;
     12        double f4;
    1313} s, *sp;
    1414
     
    2121
    2222[ short x, unsigned y ] f1( int w ) {
    23     [ y, x ] = [ x, y ] = [ w, 23 ];
     23        [ y, x ] = [ x, y ] = [ w, 23 ];
    2424}
    2525
    2626[ [ int, char, long, int ] r ] g1() {
    27     short x, p;
    28     unsigned int y;
    29     [ int, int ] z;
     27        short x, p;
     28        unsigned int y;
     29        [ int, int ] z;
    3030
    31     [ x, y, z ] = [ p, f( 17 ), 3 ];
    32     r = [ x, y, z ];
     31        [ x, y, z ] = [ p, f( 17 ), 3 ];
     32        r = [ x, y, z ];
    3333}
    3434
    3535[ 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     [ 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 ];
     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 ];
    4848
    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 ];
     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 ];
    5656
    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;
     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;
    6262}
     63
     64// Local Variables: //
     65// tab-width: 4 //
     66// End: //
Note: See TracChangeset for help on using the changeset viewer.