aboutsummaryrefslogtreecommitdiff
path: root/tests/runtime/sylib.h
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.001@gmail.com>2026-09-15 08:16:43 +0800
committerRichard Qin <richard.qin.001@gmail.com>2026-09-15 08:16:43 +0800
commit4022e5c95210631e4aceb08eaf9d9071aa5aefc4 (patch)
treea5922559836e45fb3459a3d070367912e1035b1a /tests/runtime/sylib.h
downloadrcc-4022e5c95210631e4aceb08eaf9d9071aa5aefc4.tar.gz
rcc-4022e5c95210631e4aceb08eaf9d9071aa5aefc4.tar.xz
Set up a git repoHEADmaster
Diffstat (limited to 'tests/runtime/sylib.h')
-rw-r--r--tests/runtime/sylib.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/runtime/sylib.h b/tests/runtime/sylib.h
new file mode 100644
index 0000000..de9066b
--- /dev/null
+++ b/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