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

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors deferred_resn demangler enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum resolv-new with_gc
Last change on this file since caa649b was 82c367d, checked in by Peter A. Buhr <pabuhr@…>, 8 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.