Changeset e99e43f for tests/sum.cfa


Ignore:
Timestamp:
Jan 10, 2019, 3:50:34 PM (3 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer
Children:
d97c3a4
Parents:
aeb8f70 (diff), 08222c7 (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.
git-author:
Aaron Moss <a3moss@…> (01/10/19 14:46:09)
git-committer:
Aaron Moss <a3moss@…> (01/10/19 15:50:34)
Message:

Merge remote-tracking branch 'plg/master' into deferred_resn

File:
1 moved

Legend:

Unmodified
Added
Removed
  • tests/sum.cfa

    raeb8f70 re99e43f  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // sum.c -- test resolvers ability to deal with many variables with the same name and to use the minimum number of casts
    8 //    necessary to disambiguate overloaded variable names.
     7// sum.cfa -- test resolvers ability to deal with many variables with the same name and to use the minimum number of
     8//    casts necessary to disambiguate overloaded variable names.
    99//
    1010// Author           : Peter A. Buhr
    1111// Created On       : Wed May 27 17:56:53 2015
    1212// Last Modified By : Peter A. Buhr
    13 // Last Modified On : Thu Aug  2 08:03:09 2018
    14 // Update Count     : 279
     13// Last Modified On : Sun Dec 23 23:00:38 2018
     14// Update Count     : 287
    1515//
    1616
     
    5656        } // for
    5757        sout | "sum from" | low | "to" | High | "is"
    58                  | sum( size, (unsigned char *)a ) | ", check" | (int)s | endl;
     58                 | sum( size, (unsigned char *)a ) | ", check" | (int)s;
    5959
    6060        int s = 0, a[size], v = low;
     
    6464        } // for
    6565        sout | "sum from" | low | "to" | High | "is"
    66                  | sum( size, (int *)a ) | ", check" | (int)s | endl;
     66                 | sum( size, (int *)a ) | ", check" | (int)s;
    6767
    6868        float s = 0.0f, a[size], v = low / 10.0f;
     
    7272        } // for
    7373        sout | "sum from" | low / 10.0f | "to" | High / 10.0f | "is"
    74                  | sum( size, (float *)a ) | ", check" | (float)s | endl;
     74                 | sum( size, (float *)a ) | ", check" | (float)s;
    7575
    7676        double s = 0.0, a[size], v = low / 10.0;
     
    8080        } // for
    8181        sout | "sum from" | low / 10.0 | "to" | High / 10.0 | "is"
    82                  | sum( size, (double *)a ) | ", check" | (double)s | endl;
     82                 | sum( size, (double *)a ) | ", check" | (double)s;
    8383
    8484        struct S { int i, j; };
     
    9393        S ?++( S & t ) { S temp = t; t += (S){1}; return temp; }
    9494        ofstream & ?|?( ofstream & os, S v ) { return os | v.i | v.j; }
     95        void ?|?( ofstream & os, S v ) { (ofstream &)(os | v); nl( os ); }
    9596
    9697        S s = (S){0}, a[size], v = { low, low };
     
    100101        } // for
    101102        sout | "sum from" | low | "to" | High | "is"
    102                  | sum( size, (S *)a ) | ", check" | (S)s | endl;
     103                 | sum( size, (S *)a ) | ", check" | (S)s;
    103104
    104105        forall( otype Impl | sumable( Impl ) )
     
    114115        } // for
    115116        sout | "sum from" | low | "to" | High | "is"
    116                  | sum( size, gs.x ) | ", check" | (int)s | endl; // add field array in generic type
     117                 | sum( size, gs.x ) | ", check" | (int)s;              // add field array in generic type
    117118        delete( gs.x );
    118119} // main
     
    120121// Local Variables: //
    121122// tab-width: 4 //
    122 // compile-command: "cfa sum.c" //
     123// compile-command: "cfa sum.cfa" //
    123124// End: //
Note: See TracChangeset for help on using the changeset viewer.