mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-21 23:05:27 +00:00
bugfixes; field discriminant checks; linearScanEnd, unroll, shallow pragmas
This commit is contained in:
0
tests/accept/compile/tfib.nim
Normal file → Executable file
0
tests/accept/compile/tfib.nim
Normal file → Executable file
24
tests/accept/compile/tlinearscanend.nim
Executable file
24
tests/accept/compile/tlinearscanend.nim
Executable file
@@ -0,0 +1,24 @@
|
||||
|
||||
import strutils
|
||||
|
||||
var x = 343
|
||||
|
||||
case stdin.readline.parseInt
|
||||
of 0:
|
||||
echo "most common case"
|
||||
of 1:
|
||||
{.linearScanEnd.}
|
||||
echo "second most common case"
|
||||
of 2: echo "unlikely: use branch table"
|
||||
else:
|
||||
echo "unlikely too: use branch table"
|
||||
|
||||
|
||||
case x
|
||||
of 23: echo "23"
|
||||
of 343: echo "343"
|
||||
of 21: echo "21"
|
||||
else:
|
||||
{.linearScanEnd.}
|
||||
echo "default"
|
||||
|
||||
0
tests/accept/compile/tmacro1.nim
Normal file → Executable file
0
tests/accept/compile/tmacro1.nim
Normal file → Executable file
0
tests/accept/compile/tsortdev.nim
Normal file → Executable file
0
tests/accept/compile/tsortdev.nim
Normal file → Executable file
6
tests/accept/compile/ttypeconverter1.nim
Normal file
6
tests/accept/compile/ttypeconverter1.nim
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
converter p(i: int): bool = return i != 0
|
||||
|
||||
if 0:
|
||||
echo "foo"
|
||||
|
||||
0
tests/accept/run/tmacro2.nim
Normal file → Executable file
0
tests/accept/run/tmacro2.nim
Normal file → Executable file
0
tests/accept/run/tmacro3.nim
Normal file → Executable file
0
tests/accept/run/tmacro3.nim
Normal file → Executable file
0
tests/accept/run/tmacros1.nim
Normal file → Executable file
0
tests/accept/run/tmacros1.nim
Normal file → Executable file
1769
tests/accept/run/tpegs.nim
Executable file
1769
tests/accept/run/tpegs.nim
Executable file
File diff suppressed because it is too large
Load Diff
0
tests/accept/run/tsort.nim
Normal file → Executable file
0
tests/accept/run/tsort.nim
Normal file → Executable file
0
tests/accept/run/ttoseq.nim
Normal file → Executable file
0
tests/accept/run/ttoseq.nim
Normal file → Executable file
5
tests/gc/gcleak.nim
Normal file → Executable file
5
tests/gc/gcleak.nim
Normal file → Executable file
@@ -5,7 +5,10 @@ type
|
||||
proc MakeObj(): TTestObj =
|
||||
result.x = "Hello"
|
||||
|
||||
while true:
|
||||
for i in 1 .. 100_000_000:
|
||||
var obj = MakeObj()
|
||||
if getOccupiedMem() > 300_000: quit("still a leak!")
|
||||
# echo GC_getstatistics()
|
||||
|
||||
echo "no leak: ", getOccupiedMem()
|
||||
|
||||
|
||||
9
tests/gc/gcleak2.nim
Normal file → Executable file
9
tests/gc/gcleak2.nim
Normal file → Executable file
@@ -7,14 +7,13 @@ proc MakeObj(): TTestObj =
|
||||
result.x = "Hello"
|
||||
result.s = @[1,2,3]
|
||||
|
||||
#while true:
|
||||
# var obj = MakeObj()
|
||||
# echo GC_getstatistics()
|
||||
|
||||
proc inProc() =
|
||||
while true:
|
||||
for i in 1 .. 100_000_000:
|
||||
var obj: TTestObj
|
||||
obj = MakeObj()
|
||||
if getOccupiedMem() > 300_000: quit("still a leak!")
|
||||
|
||||
inProc()
|
||||
echo "no leak: ", getOccupiedMem()
|
||||
|
||||
|
||||
|
||||
0
tests/reject/ttypenoval.nim
Normal file → Executable file
0
tests/reject/ttypenoval.nim
Normal file → Executable file
Reference in New Issue
Block a user