activated tests for tr macros

This commit is contained in:
Araq 2012-09-06 00:23:55 +02:00
commit 355ae07b8f
7 changed files with 62 additions and 24 deletions

13
tests/patterns/tcse.nim Normal file
View file

@ -0,0 +1,13 @@
discard """
output: "4"
"""
template cse{f(a, a, x)}(a: expr{(nkDotExpr|call|nkBracketExpr)&noSideEffect},
f: expr, x: varargs[expr]): expr =
let aa = a
f(aa, aa, x)+4
var
a: array[0..10, int]
i = 3
echo a[i] + a[i]

View file

@ -0,0 +1,16 @@
discard """
output: "23"
"""
template optslice{a = b + c}(a: expr{noalias}, b, c: expr): stmt =
a = b
inc a, c
var
x = 12
y = 10
z = 13
x = y+z
echo x

View file

@ -1,6 +1,7 @@
discard """
output: '''0
|12|34
|12|
34
'''
"""

View file

@ -124,7 +124,6 @@ proc runGcTests(r: var TResults, options: string) =
test "gcleak"
test "gcleak2"
test "gctest"
# disabled for now as it somehow runs very slowly ('delete' bug?) but works:
test "gcleak3"
test "weakrefs"
@ -188,6 +187,9 @@ proc runSpecialTests(r: var TResults, options: string) =
runThreadTests(r, options & " --threads:on")
runIOTests(r, options)
for t in os.walkFiles("tests/patterns/t*.nim"):
runSingleTest(r, t, options)
proc rejectSpecialTests(r: var TResults, options: string) =
rejectThreadTests(r, options)