From 82cac0ae5d4e335719445857ab16ffdf05413222 Mon Sep 17 00:00:00 2001 From: lemon Date: Wed, 31 May 2023 23:31:58 +0200 Subject: regalloc skeleton --- test.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test.c') 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; +} + // -- cgit v1.2.3