test: 添加整数溢出测试用例

This commit is contained in:
Luke 2025-07-30 11:54:34 +08:00
parent 30fa84604b
commit 3dfc8b63c8
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,19 @@
module: Main
import: os
function: main
return_type: void
body:
// 合法
declare b1: byte = 127b
declare s1: short = 32767s
declare i1: int = 2147483647
declare l1: long = 9223372036854775807L
// 溢出(都应该收集到错误)
declare b2: byte = 128b
declare s2: short = 40000s
declare i2: int = 3000000000
declare l2: long = 9223372036854775808L
end body
end function
end module

View File

@ -0,0 +1,11 @@
module: os
import: os
function: print
parameter:
declare i1: int
return_type: void
body:
syscall("PRINT",i1)
end body
end function
end module