From e043811980db560fc2507bb53b644e54c80527dc Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 8 Sep 2025 22:05:33 +0200 Subject: regalloc: start implementing linear scan --- test/fact.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/fact.c (limited to 'test/fact.c') diff --git a/test/fact.c b/test/fact.c new file mode 100644 index 0000000..1147d8f --- /dev/null +++ b/test/fact.c @@ -0,0 +1,13 @@ +int +fact(int x) +{ + int y = 1; + while (x >= 1) { + y *= x; + x -= 1; + } + return y; +} + +extern int printf(); +int main() { printf("6! = %d\n", fact(6)); } -- cgit v1.2.3