⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 args.c

📁 Small Device C Compiler 面向Inter8051
💻 C
字号:
/** Tests argument passing to functions.    Assumes that up to the first two arguments can be passed in registers.    type1: char, int, long    type2: char, int, long    type3: char, int, long */#include <testfwk.h>static {type1}returnFirstArg({type1} arg1, {type2} arg2, {type3} arg3){    UNUSED(arg2);    UNUSED(arg3);    return arg1;}static {type2}returnSecondArg({type1} arg1, {type2} arg2, {type3} arg3){    UNUSED(arg1);    UNUSED(arg3);    return arg2;}static {type3}returnThirdArg({type1} arg1, {type2} arg2, {type3} arg3){    UNUSED(arg1);    UNUSED(arg2);    return arg3;}static voidtestArgs(void){    ASSERT(returnFirstArg(123, 45, 67) == 123);    ASSERT(returnFirstArg(-123, 45, 67) == -123);    ASSERT(returnSecondArg(1, -23, 64) == -23);    ASSERT(returnSecondArg(1, 8, 64) == 8);    ASSERT(returnThirdArg(-33, -34, -35) == -35);    ASSERT(returnThirdArg(-33, -34, 35) == 35);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -