Mercurial > projects > ldc
view tests/mini/atomic1.d @ 721:51797efb6975
Make extern(System) configure the calling convention on LDC runtime, not when building LDC.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Thu, 23 Oct 2008 19:38:01 +0200 |
parents | cecfee2d01a8 |
children |
line wrap: on
line source
module mini.atomic1; pragma(intrinsic, "llvm.atomic.swap.i#.p0i#") T atomic_swap(T)(T* ptr, T val); void main() { int i = 42; int j = atomic_swap(&i, 43); assert(j == 42); assert(i == 43); }