source: doc/papers/general/evaluation/cfa-bench.c @ 0a2168f

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 0a2168f was 82c367d, checked in by Peter A. Buhr <pabuhr@…>, 6 years ago

updates

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