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/Forall.c

    r44b5ca0 ra65d92e  
    22
    33forall( type T )
    4     void swap( T left, T right ) {
     4void swap( T left, T right ) {
    55        T temp = left;
    66        left = right;
    77        right = temp;
    8     }
     8}
    99
    1010context sumable( type T ) {
     
    1616
    1717type T1 | { const T1 0; T1 ?+?(T1, T1); T1 ?++(T1); [T1] ?+=?(T1,T1); },
    18      T2(type P1, type P2 ),
    19      T3 | sumable(T3);
     18        T2(type P1, type P2 ),
     19        T3 | sumable(T3);
    2020
    2121type T2(type P1, type P2) | sumable(T2(P1,P2)) = struct { P1 i; P2 j; };
     
    2828
    2929forall( type T | sumable( T ) )
    30     T sum( int n, T a[] ) {
     30T sum( int n, T a[] ) {
    3131        T total = 0;
    3232        int i;
     
    3434            total = total + a[i];
    3535        return total;
    36     }
     36}
    3737
    3838forall( type T | { const T 0; T ?+?(T, T); T ?++(T); [T] ?+=?(T,T); } )
    39     T twice( T t ) {
     39T twice( T t ) {
    4040        return t + t;
    41     }
     41}
    4242
    4343int main() {
     
    5050    sum( 10, a );
    5151}
     52
     53// Local Variables: //
     54// tab-width: 4 //
     55// End: //
Note: See TracChangeset for help on using the changeset viewer.