Changeset a381b46 for doc/generic_types/evaluation/cfa-bench.c
- Timestamp:
- Apr 15, 2017, 7:09:59 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- c57d1935
- Parents:
- 308880c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/generic_types/evaluation/cfa-bench.c
r308880c ra381b46 10 10 int max = 0; 11 11 stack(int) s, t; 12 12 13 REPEAT_TIMED( "push_int", push( &s, _i ); ) 13 14 TIMED( "copy_int", t = s; ) 14 15 TIMED( "clear_int", clear( &s ); ) 15 REPEAT_TIMED( "pop_int", max = max( max, pop( &t ) ); ) 16 REPEAT_TIMED( "pop_int", 17 int x = pop(&t); 18 if ( x > max ) { max = x; } ) 16 19 REPEAT_TIMED( "print_int", print( out, _i, ":", _i, "\n" ); ) 17 20 18 21 stack(pair(_Bool, char)) s1, t1; 19 22 pair(_Bool, char) max = { (_Bool)0, '\0' }; 23 20 24 REPEAT_TIMED( "push_pair", push( &s1, (pair(_Bool, char)){ _i & 1, _i &0x7F } ); ) 21 25 TIMED( "copy_pair", t1 = s1; ) 22 26 TIMED( "clear_pair", clear( &s1 ); ) 23 REPEAT_TIMED( "pop_pair", max = max( max, pop( &t1 ) ); ) 27 REPEAT_TIMED( "pop_pair", 28 pair(_Bool, char) x = pop(&t1); 29 if ( x > max ) { max = x; } ) 24 30 REPEAT_TIMED( "print_pair", 25 print( out, (pair(_Bool, char)){ _i & 1, _i &0x7F }, ":", (pair(_Bool, char)){ _i & 1, _i &0x7F }, "\n" ); ) 31 print( out, (pair(_Bool, char)){ _i & 1, _i &0x7F }, ":", 32 (pair(_Bool, char)){ _i & 1, _i &0x7F }, "\n" ); ) 26 33 fclose(out); 27 34 }
Note: See TracChangeset
for help on using the changeset viewer.