Files
Nim/tests/compiler/tasm.nim
Daniel Clarke 489f6ddfef fix #20012 (#20013)
* replace gcc asm with __asm__ and add a test

* update test case to specify gcc or clang and not cpp

Co-authored-by: daniel <danielclarke@wearepopgun.com>
2022-07-13 20:55:33 +08:00

15 lines
247 B
Nim

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()