From 3dfc8b63c8f4c75f03f025606698a0a4e066c29c Mon Sep 17 00:00:00 2001 From: Luke Date: Wed, 30 Jul 2025 11:54:34 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=B7=BB=E5=8A=A0=E6=95=B4=E6=95=B0?= =?UTF-8?q?=E6=BA=A2=E5=87=BA=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- playground/BugFarm/Bug3/Main.snow | 19 +++++++++++++++++++ playground/BugFarm/Bug3/OS.snow | 11 +++++++++++ 2 files changed, 30 insertions(+) create mode 100644 playground/BugFarm/Bug3/Main.snow create mode 100644 playground/BugFarm/Bug3/OS.snow diff --git a/playground/BugFarm/Bug3/Main.snow b/playground/BugFarm/Bug3/Main.snow new file mode 100644 index 0000000..1e467bd --- /dev/null +++ b/playground/BugFarm/Bug3/Main.snow @@ -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 diff --git a/playground/BugFarm/Bug3/OS.snow b/playground/BugFarm/Bug3/OS.snow new file mode 100644 index 0000000..6026d43 --- /dev/null +++ b/playground/BugFarm/Bug3/OS.snow @@ -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 \ No newline at end of file