From: Jérémie Astor Date: Mon, 1 Nov 2021 15:30:08 +0000 (+0100) Subject: :bug: more fixes and tests X-Git-Tag: nightly~418 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=2303c52fa72fb988e6e32a0049e4c2f6f1de041c;p=gwion.git :bug: more fixes and tests --- diff --git a/src/emit/emit.c b/src/emit/emit.c index 9587c530..087a3a56 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -2252,16 +2252,12 @@ ANN static inline void unroll_init(const Emitter emit, const m_uint n) { } ANN static inline m_bool unroll_run(const Emitter emit, - const struct Looper *loop) { + struct Looper *const loop) { const Instr instr = loop->unroll ? loop->unroll(emit, loop) : NULL; CHECK_BB(scoped_stmt(emit, loop->stmt, 1)); if(instr) -// instr->m_val = emit_code_size(emit) + 13; // pass after goto -printf("code size %lu\n", emit_code_size(emit)); -// instr->m_val = 46; - vector_add(&loop->unroll_v, (m_uint)instr); + vector_add(&loop->unroll_v, (m_uint)instr); return GW_OK; -// return emit_stmt(emit, loop->stmt, 1); } ANN static m_bool _unroll(const Emitter emit, struct Looper *loop) { diff --git a/tests/pp/pragma.gw b/tests/pp/pragma_memoize.gw similarity index 100% rename from tests/pp/pragma.gw rename to tests/pp/pragma_memoize.gw diff --git a/tests/pp/pragma_unroll.gw b/tests/pp/pragma_unroll.gw new file mode 100644 index 00000000..9dd92231 --- /dev/null +++ b/tests/pp/pragma_unroll.gw @@ -0,0 +1,4 @@ +#! contains 23 +#pragma unroll 2 +foreach(a, i : [ 0, 1, 3 ]) + <<< a, i >>>;