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 82c367d was
82c367d,
checked in by Peter A. Buhr <pabuhr@…>, 7 years ago
|
updates
|
-
Property mode set to
100644
|
File size:
894 bytes
|
Rev | Line | |
---|
[c9b3a41] | 1 | #include <fstream> |
---|
| 2 | #include <stdlib> |
---|
[82c367d] | 3 | #include <stdbool.h> |
---|
[604e76d] | 4 | #include "bench.h" |
---|
| 5 | #include "cfa-stack.h" |
---|
| 6 | #include "cfa-pair.h" |
---|
| 7 | #include "cfa-print.h" |
---|
| 8 | |
---|
[c9b3a41] | 9 | int main( int argc, char * argv[] ) { |
---|
| 10 | ofstream out = { "/dev/null" }; |
---|
| 11 | int max = 0, val = 42; |
---|
[82c367d] | 12 | stack( int ) s, t; |
---|
[604e76d] | 13 | |
---|
[82c367d] | 14 | REPEAT_TIMED( "push_int", N, push( s, val ); ) |
---|
| 15 | TIMED( "copy_int", t = s; ) |
---|
| 16 | TIMED( "clear_int", clear( s ); ) |
---|
[c9b3a41] | 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; ) |
---|
[604e76d] | 19 | |
---|
[82c367d] | 20 | pair( _Bool, char ) max = { (_Bool)false, '\0' }, val = { (_Bool)true, 'a' }; |
---|
[c9b3a41] | 21 | stack( pair( _Bool, char ) ) s, t; |
---|
[604e76d] | 22 | |
---|
[c9b3a41] | 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; ) |
---|
[604e76d] | 28 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.