Changeset 8e4aa05 for tests/sum.cfa


Ignore:
Timestamp:
Mar 4, 2021, 7:40:25 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
77d601f
Parents:
342af53 (diff), a5040fe (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:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/sum.cfa

    r342af53 r8e4aa05  
    1818#include <stdlib.hfa>
    1919
    20 trait sumable( otype T ) {
     20trait sumable( T ) {
    2121        void ?{}( T &, zero_t );                                                        // 0 literal constructor
    2222        T ?+?( T, T );                                                                          // assortment of additions
     
    2626}; // sumable
    2727
    28 forall( otype T | sumable( T ) )                                                // use trait
     28forall( T | sumable( T ) )                                              // use trait
    2929T sum( size_t size, T a[] ) {
    3030        T total = 0;                                                                            // initialize by 0 constructor
     
    107107                 | sum( size, (S *)a ) | ", check" | (S)s;
    108108
    109         forall( otype Impl | sumable( Impl ) )
     109        forall( Impl | sumable( Impl ) )
    110110        struct GS {
    111111                Impl * x, * y;
     
    194194                 sum( size, (S *)a ).[i, j], s.[i, j] );
    195195
    196         forall( otype Impl | sumable( Impl ) )
     196        forall( Impl | sumable( Impl ) )
    197197        struct GS {
    198198                Impl * x, * y;
Note: See TracChangeset for help on using the changeset viewer.