aboutsummaryrefslogtreecommitdiffhomepage
path: root/test.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2023-05-31 23:31:58 +0200
committerlemon <lsof@mailbox.org>2023-05-31 23:31:58 +0200
commit82cac0ae5d4e335719445857ab16ffdf05413222 (patch)
tree51af015a1eed86d8a6c543f415d3b5107a5043bd /test.c
parente2d649f575c31d96f2fc7595594ba8c360f7bdc5 (diff)
regalloc skeleton
Diffstat (limited to 'test.c')
-rw-r--r--test.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/test.c b/test.c
index 5adb14f..5bb4e72 100644
--- a/test.c
+++ b/test.c
@@ -15,6 +15,7 @@ struct foo {
int x, y, z;
};
+
int test0(struct foo *foo) { return foo->x ? foo->y : foo->z; }
int test1(int x, int y, int z) { return x && y || z; }
int test2(int x, int y, int z) { return x || y && z; }
@@ -44,4 +45,22 @@ int test6(int x)
return !!!!x;
}
+float sqr(float x) { return x * x; }
+
+int mula(int x, int y, int z) {
+ if (x < 0)
+ return -x * y + z;
+ return x * y + z;
+}
+
+void *copy(char *d, char *s, int n) {
+ while (n--)
+ *d++ = *s++;
+ return d;
+}
+
+int hmm(float x, int a, char *p, char *q) {
+ return x > 1 ? a || p : p < q && a > 0;
+}
+
//