diff options
| author | Richard Qin <richard.qin.001@gmail.com> | 2026-09-15 08:16:43 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.001@gmail.com> | 2026-09-15 08:16:43 +0800 |
| commit | 4022e5c95210631e4aceb08eaf9d9071aa5aefc4 (patch) | |
| tree | a5922559836e45fb3459a3d070367912e1035b1a /tests/functional/80_int_float_mul.sy | |
| download | rcc-4022e5c95210631e4aceb08eaf9d9071aa5aefc4.tar.gz rcc-4022e5c95210631e4aceb08eaf9d9071aa5aefc4.tar.xz | |
Diffstat (limited to 'tests/functional/80_int_float_mul.sy')
| -rw-r--r-- | tests/functional/80_int_float_mul.sy | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/functional/80_int_float_mul.sy b/tests/functional/80_int_float_mul.sy new file mode 100644 index 0000000..f1cc530 --- /dev/null +++ b/tests/functional/80_int_float_mul.sy @@ -0,0 +1,18 @@ +// 回归用例: IRGen 二元运算类型提升必须识别浮点 RCon (c->flt=1) +// 触发 (修前): `i * 1.0` 产 Kw mul -> isel fix_tmp_arg 断言炸 +float a; +int main() { + int i; + i = 0; + while (i < 4) { + a = i * 1.0; + i = i + 1; + } + if (a > 2) { + putint(1); + } else { + putint(0); + } + putch(10); + return 0; +} |
