aboutsummaryrefslogtreecommitdiff
path: root/rcc-legacy/tests/runtime/sylib.h
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-06-08 17:10:31 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-06-08 17:10:31 +0800
commit72af0dedf9e18911da65b9a5c4906689e868d9fc (patch)
tree2ecbad93f96ab8ad7e26dc02cd02d802f853ab97 /rcc-legacy/tests/runtime/sylib.h
parent8faf6d290d6703b1775e0ad7a8928a4ebea4b11b (diff)
downloadrcc-project-72af0dedf9e18911da65b9a5c4906689e868d9fc.tar.gz
rcc-project-72af0dedf9e18911da65b9a5c4906689e868d9fc.tar.xz
[legacy] Add functional and performance test suites
Diffstat (limited to 'rcc-legacy/tests/runtime/sylib.h')
-rw-r--r--rcc-legacy/tests/runtime/sylib.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/rcc-legacy/tests/runtime/sylib.h b/rcc-legacy/tests/runtime/sylib.h
new file mode 100644
index 0000000..de9066b
--- /dev/null
+++ b/rcc-legacy/tests/runtime/sylib.h
@@ -0,0 +1,31 @@
+#ifndef __SYLIB_H_
+#define __SYLIB_H_
+
+#include<stdio.h>
+#include<stdarg.h>
+#include<sys/time.h>
+/* 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