summary refs log tree commit diff stats
path: root/tests/trmacros/tnoalias2.nim
blob: 5a816acb9ed41f235c2636195a79ef3b1f1cefad (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
discard """
  output: '''0'''
"""

# bug #206
template optimizeOut{testFunc(a, b)}(a: int, b: int{alias}) : expr = 0

proc testFunc(a, b: int): int = result = a + b
var testVar = 1
echo testFunc(testVar, testVar)


template ex{a = b + c}(a : int{noalias}, b, c : int) =
  a = b
  inc a, b
  echo "came here"

var x = 5
x = x + x