preparations for 0.8.12

This commit is contained in:
Araq
2011-07-10 15:48:13 +02:00
parent 2565ff8dde
commit 5b96eaa953
81 changed files with 2355 additions and 826 deletions

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

View File

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

3
tests/accept/run/ttables.nim Normal file → Executable file
View File

@@ -80,5 +80,8 @@ block countTableTest1:
else: break
inc i
block SyntaxTest:
var x = toTable[int, string]({:})
echo "true"

0
tests/reject/tconstraints.nim Normal file → Executable file
View File

0
tests/reject/temptycaseobj.nim Normal file → Executable file
View File

0
tests/reject/tno_int_in_bool_context.nim Normal file → Executable file
View File

0
tests/reject/tprocvar.nim Normal file → Executable file
View File

44
tests/threads/threadex.nim Executable file
View File

@@ -0,0 +1,44 @@
type
TMsgKind = enum
mLine, mEof
TMsg = object {.pure, final.}
case k: TMsgKind
of mEof: backTo: TThreadId[int]
of mLine: data: string
var
consumer: TThread[TMsg]
producer: TThread[int]
printedLines = 0
proc consume() {.thread.} =
while true:
var x = recv[TMsg]()
if x.k == mEof:
x.backTo.send(printedLines)
break
echo x.data
discard atomicInc(printedLines)
proc produce() {.thread.} =
var m: TMsg
var input = open("readme.txt")
while not endOfFile(input):
if consumer.ready:
m.data = input.readLine()
consumer.send(m)
close(input)
m.k = mEof
m.backTo = myThreadId[int]()
consumer.send(m)
var result = recv[int]()
echo result
createThread(consumer, consume)
createThread(producer, produce)
joinThread(consumer)
joinThread(producer)
echo printedLines

View File

@@ -37,7 +37,7 @@ proc echoLeTree(n: PNode) =
echo it.data
it = it.le
proc threadFunc(interval: tuple[a, b: int]) {.procvar.} =
proc threadFunc(interval: tuple[a, b: int]) {.thread.} =
doNothing()
for i in interval.a..interval.b:
var r = buildTree(i)

View File

@@ -1,7 +1,7 @@
discard """
file: "tthreadanalysis2.nim"
line: 45
errormsg: "possible inconsistency of thread local heaps"
errormsg: "write to foreign heap"
cmd: "nimrod cc --hints:on --threads:on $# $#"
"""
@@ -37,7 +37,7 @@ proc echoLeTree(n: PNode) =
echo it.data
it = it.le
proc threadFunc(interval: tuple[a, b: int]) {.procvar.} =
proc threadFunc(interval: tuple[a, b: int]) {.thread.} =
doNothing()
for i in interval.a..interval.b:
var r = buildTree(i)

View File

@@ -0,0 +1,14 @@
var
global: string = "test string"
t: TThread[string]
proc horrible() {.thread.} =
global = "string in thread local heap!"
var x = global
var mydata = (x, "my string too")
echo global
createThread(t, horrible)
joinThread(t)