* 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>
This commit is contained in:
Daniel Clarke 2022-07-13 22:55:33 +10:00 • committed by GitHub
commit 489f6ddfef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

15
tests/compiler/tasm.nim Normal file
View file

@ -0,0 +1,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()