summary refs log tree commit diff stats
path: root/tests/compiler/tasm.nim
blob: 9f60231e0bc035abbdb02a527331545b78025a4f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
proc testAsm() =
  let src = 41
  var dst = 0

  asm """
    mov %1, %0\n\t
    add $1, %0
    : "=r" (`dst`)
    : "r" (`src`)"""

  doAssert dst == 42

when defined(gcc) or defined(clang) and not defined(cpp):
  {.passc: "-std=c99".}
  testAsm()