aboutsummaryrefslogtreecommitdiff
path: root/rcc-legacy/tests/functional/80_int_float_mul.sy
blob: f1cc53047d18ad43aa5849e99c41891d2a4e1edf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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;
}