aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/80_int_float_mul.sy
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.001@gmail.com>2026-09-15 08:16:43 +0800
committerRichard Qin <richard.qin.001@gmail.com>2026-09-15 08:16:43 +0800
commit4022e5c95210631e4aceb08eaf9d9071aa5aefc4 (patch)
treea5922559836e45fb3459a3d070367912e1035b1a /tests/functional/80_int_float_mul.sy
downloadrcc-master.tar.gz
rcc-master.tar.xz
Set up a git repoHEADmaster
Diffstat (limited to 'tests/functional/80_int_float_mul.sy')
-rw-r--r--tests/functional/80_int_float_mul.sy18
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;
+}