Changeset cdbab55 for examples/Tuple.c


Ignore:
Timestamp:
Aug 21, 2018, 2:24:29 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
Children:
2a6292d
Parents:
2b79a70 (diff), efa8b6af (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:/u/cforall/software/cfa/cfa-cc

File:
1 moved

Legend:

Unmodified
Added
Removed
  • examples/Tuple.c

    r2b79a70 rcdbab55  
    11int f( int, int );
    22int g( int, int, int );
    3 static [ int, int *, * int, int ] h( int a, int b, * int c, [] char d );
     3static
     4[ int, int *, * int, int ] h( int a, int b, * int c, [] char d );
    45
    56struct inner {
     
    1415
    1516const volatile [ int, int ] t1;
    16 static const [ int, const int ] t2;
     17static const [ int, int ] t2;
    1718const static [ int, const int ] t3;
    1819
     
    2122
    2223[ short x, unsigned y ] f1( int w ) {
    23         [ y, x ] = [ x, y ] = [ w, 23 ];
     24//      return [ y, x ] = [ x, y ] = [ w, 23 ];
    2425}
    2526
    2627[ [ int, char, long, int ] r ] g1() {
    27         short x, p;
     28        short int x, p;
    2829        unsigned int y;
    2930        [ int, int ] z;
    3031
    31         [ x, y, z ] = [ p, f( 17 ), 3 ];
    32         [ x, y, z ] = ([short, unsigned int, [int, int]])([ p, f( 17 ), 3 ]);
     32        [ x, y, z ] = [ p, f( 17, 18 ), 4, 3 ];
     33//      [ x, y, z ] = ([short, unsigned int, [int, int]])([ p, f( 17, 18 ), 4, 3 ]);
    3334        r = [ x, y, z ];
    3435}
     
    3637[ int rc ] main( int argc, ** char argv ) {
    3738        int a, b, c, d;
    38         struct outer t = { .[ f1,f4 ] : [ 1,7.0 ] };
     39//      struct outer t = { .[ f1, f4 ] : [ 1, 7.0 ] };
    3940        f( [ 3,5 ] );
    4041        g( [ 3,5 ], 3 );
     
    4243        g( t1, 3 );
    4344
    44         [ , , , ];                                              /* empty tuple */
     45//      [ , , , ];                                              /* empty tuple */
    4546        [ 3, 5 ];
    4647        [ a, b ] = 3;
    47         [ a, b ] = [ 4.6 ];
     48//      [ a, b ] = [ 4.6 ];
     49        [ a, b ] = 4.6;
    4850        [ a, b ] = [ c, d ] = [ 3, 5 ];
    49         [ a, b, [ c ] ] = [ 2,[ a, b ] ];
     51//      [ a, b, [ c ] ] = [ 2, [ a, b ] ];
     52        [ a, b, c ] = [ 2, [ a, b ] ];
    5053        [ a, b ] = 3 > 4 ? [ b, 6 ] : [ 7, 8 ];
    5154
     
    5659        [ a, b ] = t1 = [ c, d ];
    5760        [ a, b ] = t1 = t2 = [ c, d ];
    58         t1 = [ 3, 4 ] = [ 3, 4 ] = t1 = [ 3, 4 ];
     61//      t1 = [ 3, 4 ] = [ 3, 4 ] = t1 = [ 3, 4 ];
    5962
    6063        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//      s.[ f1, i.[ f2, f3 ], f4 ] = h( 3, 3, (* int)0, "abc" );
     65//      [ a, , b, ] = h( 3, 3, 0, "abc" );                      /* ignore some results */
     66        sp->[ f4, f1 ] = sp->[ f1, f4 ];
    6467        printf( "expecting 3, 17, 23, 4; got %d, %d, %d, %d\n", s.[ f4, i.[ f3, f2 ], f1 ] );
    6568        rc = 0;
Note: See TracChangeset for help on using the changeset viewer.