示例#1
0
文件: main.c 项目: aaasz/SHP
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;
}
示例#2
0
int
main()
{
    function_two();
    function_three();

    exit(EXIT_SUCCESS);
}
示例#3
0
文件: foo.c 项目: ggcov/ggcov
					    /* 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) */
}
示例#4
0
文件: foo.c 项目: ggcov/ggcov
					    /* 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) */
}
	// Allocate a new array to make sure the stack is uncorrupted
	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 );
}
示例#6
0
void function_two (Node * nn) {
  printf ("%c", nn->data);
  for (nn = nn->cld; NULL != nn; nn = nn->sbl) {
    function_two (nn);
  }
}
示例#7
0
文件: main.c 项目: easonnie/unixlab
int main()
{
    function_two();
    function_three();
    return(0);
}
示例#8
0
文件: main.c 项目: Alan-sw/Leecode
int main(void)
{
    function_two();
    function_three();
    return EXIT_SUCCESS;
}