source: doc/papers/general/evaluation/cfa-bench.c @ 4b1c8da

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 4b1c8da was 9d6f011, checked in by Aaron Moss <a3moss@…>, 7 years ago

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

  • Property mode set to 100644
File size: 628 bytes
Line 
1#include "bench.h"
2#include "cfa-stack.h"
3#include "cfa-pair.h"
4
5int main() {
6        int max = 0, val = 42;
7        stack( int ) si, ti;
8
9        REPEAT_TIMED( "push_int", N, push( si, val ); )
10        TIMED( "copy_int", ti{ si }; )
11        TIMED( "clear_int", clear( si ); )
12        REPEAT_TIMED( "pop_int", N, int x = pop( ti ); if ( x > max ) max = x; )
13
14        pair( short, char ) max = { 0h, '\0' }, val = { 42h, 'a' };
15        stack( pair( short, char ) ) sp, tp;
16
17        REPEAT_TIMED( "push_pair", N, push( sp, val ); )
18        TIMED( "copy_pair", tp{ sp }; )
19        TIMED( "clear_pair", clear( sp ); )
20        REPEAT_TIMED( "pop_pair", N, pair(short, char) x = pop( tp ); if ( x > max ) max = x; )
21}
Note: See TracBrowser for help on using the repository browser.