source: doc/papers/general/evaluation/cfa-bench.c @ 2097cd4

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since 2097cd4 was c9b3a41, checked in by Peter A. Buhr <pabuhr@…>, 6 years ago

update CFA evaluation code

  • Property mode set to 100644
File size: 870 bytes
Line 
1#include <fstream>
2#include <stdlib>
3#include "bench.h"
4#include "cfa-stack.h"
5#include "cfa-pair.h"
6#include "cfa-print.h"
7
8int main( int argc, char * argv[] ) {
9        ofstream out = { "/dev/null" };
10        int max = 0, val = 42;
11        stack( int ) si, t;
12
13        REPEAT_TIMED( "push_int", N, push( si, val ); )
14        TIMED( "copy_int", t = si; )
15        TIMED( "clear_int", clear( si ); )
16        REPEAT_TIMED( "pop_int", N, int x = pop( t ); max = max( x, max ); )
17        REPEAT_TIMED( "print_int", N/2, out | val | ':' | val | endl; )
18
19        pair( _Bool, char ) max = { (_Bool)0, '\0' }, val = { (_Bool)1, 'a' };
20        stack( pair( _Bool, char ) ) s, t;
21
22        REPEAT_TIMED( "push_pair", N, push( s, val ); )
23        TIMED( "copy_pair", t = s; )
24        TIMED( "clear_pair", clear( s ); )
25        REPEAT_TIMED( "pop_pair", N, pair(_Bool, char) x = pop( t ); max = max( x, max ); )
26        REPEAT_TIMED( "print_pair", N/2, out | val | ':' | val | endl; )
27}
Note: See TracBrowser for help on using the repository browser.