Files
llgo/_cmptest/issue961
xgopilot 8a451eef09 test: Add issue #961 examples to _cmptest for Go vs LLGo comparison
Created _cmptest/issue961/typeconv.go with 15 test cases covering:
- Integer overflow wrapping (int8, int16)
- Signed/unsigned conversions
- Float-to-int conversions
- Sign extension and zero extension
- Type truncation
- Edge cases (negation overflow, division by -1)

Test reveals 9 differences between Go and LLGo output, confirming
the bugs reported in issue #961:
1. int8(127) + 1: LLGo outputs 128 instead of -128
2. int8(100) + int8(50): LLGo outputs 150 instead of -106
3. int8(64) * 2: LLGo outputs 128 instead of -128
4. Float conversion: LLGo outputs 0 instead of -2147483648
5. uint32->int32: LLGo outputs 4294967295 instead of -1
6. Sign extension: LLGo outputs 4294967295 instead of -1
7. Negation overflow: LLGo outputs 128 instead of -128
8. Division edge: LLGo outputs 0 instead of -128
9. int16 overflow: LLGo outputs 32768 instead of -32768

Note: CI integration for `llgo cmptest` needs to be added manually
to .github/workflows/llgo.yml (cannot modify workflow files via bot).

Related to #961

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: cpunion <cpunion@users.noreply.github.com>
2025-10-22 05:49:18 +00:00
..