summary refs log tree commit diff stats
path: root/tests/compile
diff options
context:
space:
mode:
Diffstat (limited to 'tests/compile')
-rw-r--r--tests/compile/tgeneric3.nim4
-rw-r--r--tests/compile/tgenerictmpl.nim6
-rw-r--r--tests/compile/tgensym.nim12
3 files changed, 7 insertions, 15 deletions
diff --git a/tests/compile/tgeneric3.nim b/tests/compile/tgeneric3.nim
index f4ec59ced..3c543ecfa 100644
--- a/tests/compile/tgeneric3.nim
+++ b/tests/compile/tgeneric3.nim
@@ -66,12 +66,12 @@ proc setItem[T,D] (AKey: T, AValue: D, ANode: PNode[T,D]): ref TItem[T,D] {.inli
 proc cmp[T:Int8|Int16|Int32|Int64|Int] (a,b: T): T {.inline.} =
   return a-b
 
-template binSearchImpl *(docmp: expr) =
+template binSearchImpl *(docmp: expr) {.immediate.} =
   var bFound = false
   result = 0
   var H = haystack.len -1
   while result <= H :
-    var I = (result + H) shr 1
+    var I {.inject.} = (result + H) shr 1
     var SW = docmp 
     if SW < 0: result = I + 1 
     else:
diff --git a/tests/compile/tgenerictmpl.nim b/tests/compile/tgenerictmpl.nim
index f3bb4b6ee..a749e6570 100644
--- a/tests/compile/tgenerictmpl.nim
+++ b/tests/compile/tgenerictmpl.nim
@@ -1,8 +1,12 @@
 
 template tmp[T](x: var seq[T]) =
-  var yz: T
+  #var yz: T  # XXX doesn't work yet
   x = @[1, 2, 3]
 
+macro tmp2[T](x: var seq[T]): stmt =
+  nil
+
 var y: seq[int]
 tmp(y)
+tmp(y)
 echo y.repr
diff --git a/tests/compile/tgensym.nim b/tests/compile/tgensym.nim
deleted file mode 100644
index 3c0405136..000000000
--- a/tests/compile/tgensym.nim
+++ /dev/null
@@ -1,12 +0,0 @@
-template hygienic(val: expr) =
-  var `*x` = val
-  stdout.write `*x`
-
-var x = 100
-
-hygienic 1
-hygienic 2
-hygienic 3
-
-echo x
-