2022-12-30 16:29:57 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
int testf4(int, int);
|
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
int testf1() {
|
|
|
|
|
puts("testf1 called!");
|
|
|
|
|
int r = 1029;
|
2023-01-21 21:53:55 +00:00
|
|
|
|
if (r == 1029) {
|
2022-12-30 16:29:57 +00:00
|
|
|
|
printf("testf1 will return %D...\r\n", r);
|
|
|
|
|
}
|
|
|
|
|
return r;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int testf2() {
|
|
|
|
|
puts("testf2 called!");
|
|
|
|
|
return 1000;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void testf3(char *msg)
|
|
|
|
|
{
|
|
|
|
|
puts(msg);
|
2023-01-31 06:55:01 +00:00
|
|
|
|
return; //not required just for testing
|
2023-01-21 21:53:55 +00:00
|
|
|
|
}
|
2022-12-30 16:29:57 +00:00
|
|
|
|
|
|
|
|
|
int testf4(int arg1, int arg2) {
|
|
|
|
|
printf("arg1=%D, arg2=%D\r\n", arg1, arg2);
|
|
|
|
|
return arg1 + arg2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
// unreachable code
|
|
|
|
|
|
|
|
|
|
printf("i=%D\r\n", i);
|
|
|
|
|
|
|
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
|
|
|
|
|
|
int r=testf1();
|
|
|
|
|
printf("testf1() returned %D\r\n", r);
|
2023-01-21 21:53:55 +00:00
|
|
|
|
getchar();
|
2022-12-30 16:29:57 +00:00
|
|
|
|
r=testf2();
|
|
|
|
|
printf("testf2() returned %D\r\n", r);
|
2023-01-21 21:53:55 +00:00
|
|
|
|
getchar();
|
2022-12-30 16:29:57 +00:00
|
|
|
|
testf3("testf3() void function...");
|
2023-01-21 21:53:55 +00:00
|
|
|
|
getchar();
|
2022-12-30 16:29:57 +00:00
|
|
|
|
i = testf4(34, 43);
|
|
|
|
|
printf("testf4() returned %D\r\n", i);
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
printf("main() argc=%D\r\n", argc);
|
2023-01-21 21:53:55 +00:00
|
|
|
|
getchar();
|
2023-01-06 14:02:35 +00:00
|
|
|
|
|
2023-01-21 21:53:55 +00:00
|
|
|
|
for(int i=0; i<=argc; i++) printf(" argv[%D]=%s\r\n", i, argv[i]);
|
|
|
|
|
|
|
|
|
|
printf("i = %D\r\n", i);
|
|
|
|
|
puts("set main() return code=0x73");
|
|
|
|
|
return 115; // return E_INUM
|
2022-12-30 16:29:57 +00:00
|
|
|
|
}
|
|
|
|
|
MAN
|
|
|
|
|
TEXT root/ctest/testargs.c
|