view tests/mini/atomic1.d @ 863:6c850977a941

modified gen/linker.cpp to only append .exe suffix on windows if not already present
author elrood
date Thu, 18 Dec 2008 19:24:33 +0100
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);
}