// Phase 191: Body-local variable integration test
// Tests: local digit = i + 1 (body-local) in number accumulation pattern
//
// This test verifies that LoopBodyLocalInitLowerer correctly lowers
// body-local variable initialization expressions to JoinIR, and that
// UpdateEnv resolves them during carrier update emission.
//
// Expected calculation:
//   i=0: digit = 0+1 = 1, result = 0*10 + 1 = 1
//   i=1: digit = 1+1 = 2, result = 1*10 + 2 = 12
//   i=2: digit = 2+1 = 3, result = 12*10 + 3 = 123
//   i=3: break (condition i >= 3)
// Expected result: 123

static box Main {
    main() {
        local result
        result = 0
        local i
        i = 0
        loop(i < 10) {
            if i >= 3 {
                break
            }
            // Phase 191: Body-local variable with initialization expression
            local digit = i + 1
            result = result * 10 + digit
            i = i + 1
        }
        print(result)
        return 0
    }
}
