Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/papers/general/evaluation/cfa-bench.c

    r986dd36 r79d4186  
    1 #include <stdio.h>
    21#include "bench.h"
    32#include "cfa-stack.h"
    43#include "cfa-pair.h"
    5 #include "cfa-print.h"
    64
    7 int main( int argc, char *argv[] ) {
    8         FILE * out = fopen( "/dev/null", "w" );
    9         int maxi = 0, vali = 42;
    10         stack(int) si, ti;
     5int main( int argc, char * argv[] ) {
     6        int max = 0, val = 42;
     7        stack( int ) si, ti;
    118
    12         REPEAT_TIMED( "push_int", N, push( si, vali ); )
     9        REPEAT_TIMED( "push_int", N, push( si, val ); )
    1310        TIMED( "copy_int", ti = si; )
    1411        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" ); )
     12        REPEAT_TIMED( "pop_int", N,
     13                int x = pop( ti ); if ( x > max ) max = x; )
    1914
    20         pair(_Bool, char) maxp = { (_Bool)0, '\0' }, valp = { (_Bool)1, 'a' };
    21         stack(pair(_Bool, char)) sp, tp;
     15        pair( _Bool, char ) max = { (_Bool)0 /***/, '\0' }, val = { (_Bool)1 /***/, 'a' };
     16        stack( pair( _Bool, char ) ) sp, tp;
    2217
    23         REPEAT_TIMED( "push_pair", N, push( sp, valp ); )
     18        REPEAT_TIMED( "push_pair", N, push( sp, val ); )
    2419        TIMED( "copy_pair", tp = sp; )
    2520        TIMED( "clear_pair", clear( sp ); )
    2621        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);
     22                pair(_Bool, char) x = pop( tp ); if ( x > max ) max = x; )
    3123}
Note: See TracChangeset for help on using the changeset viewer.