int main() { int one_out1, one_out2, one_out3; int two_out, three_out, four_out; int five_out1, five_out2; int six_out, seven_out; int eight_out; xil_printf("Microblaze:\n"); XTmrCtr_Initialize(&TimerInst, 0); XTmrCtr_SetResetValue(&TimerInst, 0, 0); XTmrCtr_Start(&TimerInst, 0); StartIF_TS = XTmrCtr_GetValue(&TimerInst, 0); function_one(10000000, &one_out1, &one_out2, &one_out3); function_two(one_out1, &two_out); function_three(one_out2, &three_out); function_four(one_out3, &four_out); function_five(two_out, three_out, four_out, &five_out1, &five_out2); function_six(five_out1, &six_out); function_seven(five_out2, &seven_out); function_eight(six_out, seven_out, &eight_out); xil_printf("Rezultat = %d \n", eight_out); FinishIF_TS = XTmrCtr_GetValue(&TimerInst, 0); TimeSA = (FinishIF_TS - StartIF_TS) / (50000000 / 1000); xil_printf("0\n"); xil_printf("%d\n", TimeSA); xil_printf("SERIALSTOP"); return 0; }
void function_three (Node * nn) { Node * tmp; for (tmp = nn->cld; NULL != tmp; tmp = tmp->sbl) { function_three (tmp); } printf ("%c", nn->data); }
int main() { function_two(); function_three(); exit(EXIT_SUCCESS); }
/* C(-) */ int function_one(int x) { if (x & 1) /* C(11) */ x += function_two(x); /* C(7) */ else x += function_three(x); /* C(4) */ return x; /* C(11) */ }
/* C(-) */ int main(int argc, char **argv) { int x; printf("foo running\n"); /* C(4) */ x = atoi(argv[1]); /* C(4) */ function_one(--x); function_two(--x) ; function_three(--x); /* C(4) */ x += 4; /* C(1) */ return 0; /* C(1) */ }
int args_2 [ ] = { 20 }; result = call_function ( &function_one, 1, args_2 ); std::cout << "\nResult: " << result; return 0; } //*/ TEST_CASE ( "Calling C++ version of each function", "[c-all-methods]" ) { REQUIRE ( function_zero ( ) == 200 ); REQUIRE ( function_one ( 10 ) == 30 ); REQUIRE ( function_two ( 10, 20 ) == 30 ); REQUIRE ( function_three ( 10, 20, 30 ) == 60 ); REQUIRE ( function_four ( 10, 20, 30, 40 ) == 100 ); REQUIRE ( function_five ( 10, 20, 30, 40, 50 ) == 150 ); REQUIRE ( function_six ( 10, 20, 30, 40, 50, 60 ) == 210 ); } TEST_CASE ( "Calling 0-parameter assembly function", "[c-method-0-parm]" ) { REQUIRE ( func_0 ( ) == 300 ); } TEST_CASE ( "Calling 1-parameter assembly function", "[c-method-1-parm]" ) { REQUIRE ( func_1 ( 10 ) == 30 ); REQUIRE ( func_1 ( 20 ) == 60 ); REQUIRE ( func_1 ( 30 ) == 90 ); }
int main() { function_two(); function_three(); return(0); }
int main(void) { function_two(); function_three(); return EXIT_SUCCESS; }