diff options
author | Michael Forney <mforney@mforney.org> | 2019-02-22 12:25:50 -0800 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-02-22 12:25:50 -0800 |
commit | 2cbd75bbab472b6861dc0ae806e41cf139518fe6 (patch) | |
tree | 15435cabe49771c07664df83824297cfa3d9f008 /tests | |
parent | f2a079fa1a94b6a99e7ce432b6df17fdb4c9b554 (diff) |
Implement __builtin_alloca
Diffstat (limited to 'tests')
-rw-r--r-- | tests/builtin-alloca.c | 3 | ||||
-rw-r--r-- | tests/builtin-alloca.qbe | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/builtin-alloca.c b/tests/builtin-alloca.c new file mode 100644 index 0000000..f086f19 --- /dev/null +++ b/tests/builtin-alloca.c @@ -0,0 +1,3 @@ +void f(void) { + int *x = __builtin_alloca(32); +} diff --git a/tests/builtin-alloca.qbe b/tests/builtin-alloca.qbe new file mode 100644 index 0000000..75a1fe1 --- /dev/null +++ b/tests/builtin-alloca.qbe @@ -0,0 +1,12 @@ +export +function $f() { +@start.1 + %.1 =l alloc8 8 +@body.2 + %.2 =l add %.1, 0 + %.3 =l extsw 32 + %.4 =l alloc16 %.3 + %.5 =l copy %.4 + storel %.5, %.2 + ret +} |