From 72af0dedf9e18911da65b9a5c4906689e868d9fc Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Mon, 8 Jun 2026 17:10:31 +0800 Subject: [legacy] Add functional and performance test suites --- rcc-legacy/tests/runtime/qbe | Bin 0 -> 679560 bytes rcc-legacy/tests/runtime/sylib.c | 83 +++++++++++++++++++++++++++++++++++++++ rcc-legacy/tests/runtime/sylib.h | 31 +++++++++++++++ 3 files changed, 114 insertions(+) create mode 100755 rcc-legacy/tests/runtime/qbe create mode 100644 rcc-legacy/tests/runtime/sylib.c create mode 100644 rcc-legacy/tests/runtime/sylib.h (limited to 'rcc-legacy/tests/runtime') diff --git a/rcc-legacy/tests/runtime/qbe b/rcc-legacy/tests/runtime/qbe new file mode 100755 index 0000000..cdb0653 Binary files /dev/null and b/rcc-legacy/tests/runtime/qbe differ diff --git a/rcc-legacy/tests/runtime/sylib.c b/rcc-legacy/tests/runtime/sylib.c new file mode 100644 index 0000000..dc3d92c --- /dev/null +++ b/rcc-legacy/tests/runtime/sylib.c @@ -0,0 +1,83 @@ +#include +#include +#include +#include"sylib.h" +/* Input & output functions */ +int getint(){int t; scanf("%d",&t); return t; } +int getch(){char c; scanf("%c",&c); return (int)c; } +float getfloat(){ + float n; + scanf("%a", &n); + return n; +} + +int getarray(int a[]){ + int n; + scanf("%d",&n); + for(int i=0;i +#include +#include +/* Input & output functions */ +int getint(),getch(),getarray(int a[]); +float getfloat(); +int getfarray(float a[]); + +void putint(int a),putch(int a),putarray(int n,int a[]); +void putfloat(float a); +void putfarray(int n, float a[]); + +void putf(char a[], ...); + +/* Timing function implementation */ +struct timeval _sysy_start,_sysy_end; +#define starttime() _sysy_starttime(__LINE__) +#define stoptime() _sysy_stoptime(__LINE__) +#define _SYSY_N 1024 +int _sysy_l1[_SYSY_N],_sysy_l2[_SYSY_N]; +int _sysy_h[_SYSY_N], _sysy_m[_SYSY_N],_sysy_s[_SYSY_N],_sysy_us[_SYSY_N]; +int _sysy_idx; +__attribute((constructor)) void before_main(); +__attribute((destructor)) void after_main(); +void _sysy_starttime(int lineno); +void _sysy_stoptime(int lineno); + +#endif -- cgit v1.2.3