Created
August 9, 2009 21:38
-
-
Save simonask/164911 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int n = 0; | |
int make(int t) { return t; } | |
void foo_a() { ++n; } | |
void foo_b() { ++n; } | |
void foo_c() { ++n; } | |
void foo_d() { ++n; } | |
int foo(int t) | |
{ | |
switch (t) | |
{ | |
case 0: | |
foo_a(); | |
break; | |
case 1: | |
foo_b(); | |
break; | |
case 2: | |
foo_c(); | |
break; | |
case 3: | |
foo_d(); | |
break; | |
} | |
} | |
int main (int argc, char const *argv[]) | |
{ | |
int i; | |
for (i = 0; i < 10000000; ++i) | |
{ | |
int a = make(0); | |
foo(a); | |
int b = make(1); | |
foo(b); | |
int c = make(2); | |
foo(c); | |
int d = make(3); | |
foo(d); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment