source:
benchmark/ctxswitch/cfa_gen.cfa
@
26fd986
Last change on this file since 26fd986 was 2316525, checked in by , 5 years ago | |
---|---|
|
|
File size: 404 bytes |
Rev | Line | |
---|---|---|
[fe065c3] | 1 | #include "../bench.h" |
2 | ||
3 | typedef struct { | |
4 | void * next; | |
[2316525] | 5 | } C; |
[fe065c3] | 6 | |
[2316525] | 7 | void comain( C * c ) { |
8 | if ( __builtin_expect(c->next != 0, 1) ) goto *(c->next); | |
9 | c->next = &&s1; | |
[fe065c3] | 10 | for () { |
[b4107c8] | 11 | return; |
[fe065c3] | 12 | s1: ; |
13 | } | |
14 | } | |
15 | ||
[b4107c8] | 16 | int main( int argc, char * argv[] ) { |
17 | BENCH_START() | |
[2316525] | 18 | C c = { 0 }; |
[fe065c3] | 19 | BENCH( |
[2316525] | 20 | for ( times ) { |
21 | comain( &c ); | |
[fe065c3] | 22 | }, |
23 | result | |
24 | ) | |
[b4107c8] | 25 | printf( "%g\n", result ); |
[fe065c3] | 26 | } |
[b4107c8] | 27 | |
28 | // Local Variables: // | |
29 | // tab-width: 4 // | |
30 | // End: // |
Note: See TracBrowser
for help on using the repository browser.