bugfixes; field discriminant checks; linearScanEnd, unroll, shallow pragmas

This commit is contained in:
Araq
2011-03-23 01:09:52 +01:00
parent 8d734244b1
commit 5b789f2da8
45 changed files with 2342 additions and 243 deletions

0
tests/accept/compile/tfib.nim Normal file → Executable file
View File

View 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
View File

0
tests/accept/compile/tsortdev.nim Normal file → Executable file
View File

View 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
View File

0
tests/accept/run/tmacro3.nim Normal file → Executable file
View File

0
tests/accept/run/tmacros1.nim Normal file → Executable file
View 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
View File

0
tests/accept/run/ttoseq.nim Normal file → Executable file
View File

5
tests/gc/gcleak.nim Normal file → Executable file
View 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
View 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
View File