Ignore:
Timestamp:
Apr 19, 2017, 10:15:45 AM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
cd348e7
Parents:
221c2de (diff), de4ce0e (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
  • doc/generic_types/evaluation/cfa-bench.c

    r221c2de r154fdc8  
    1 #include <stdlib.h>
     1#include <stdio.h>
    22#include "bench.h"
    33#include "cfa-stack.h"
     4#include "cfa-pair.h"
     5#include "cfa-print.h"
    46
    5 int main(int argc, char** argv) {
    6         srand(20171025);
     7int main( int argc, char *argv[] ) {
     8        FILE * out = fopen( "cfa-out.txt", "w" );
     9        int maxi = 0, vali = 42;
     10        stack(int) si, ti;
    711
    8         stack(int) s;
     12        REPEAT_TIMED( "push_int", N, push( &si, vali ); )
     13        TIMED( "copy_int", ti = si; )
     14        TIMED( "clear_int", clear( &si ); )
     15        REPEAT_TIMED( "pop_int", N,
     16                int xi = pop( &ti );
     17                if ( xi > maxi ) { maxi = xi; } )
     18        REPEAT_TIMED( "print_int", N/2, print( out, vali, ":", vali, "\n" ); )
    919
    10         REPEAT_TIMED( "push_int",
    11                 push( &s, rand() );
    12         )
     20        pair(_Bool, char) maxp = { (_Bool)0, '\0' }, valp = { (_Bool)1, 'a' };
     21        stack(pair(_Bool, char)) sp, tp;
     22
     23        REPEAT_TIMED( "push_pair", N, push( &sp, valp ); )
     24        TIMED( "copy_pair", tp = sp; )
     25        TIMED( "clear_pair", clear( &sp ); )
     26        REPEAT_TIMED( "pop_pair", N,
     27                pair(_Bool, char) xp = pop( &tp );
     28                if ( xp > maxp ) { maxp = xp; } )
     29        REPEAT_TIMED( "print_pair", N/2, print( out, valp, ":", valp, "\n" ); )
     30        fclose(out);
    1331}
Note: See TracChangeset for help on using the changeset viewer.