Page MenuHomeFreeBSD
Paste P228

atomic_* test, builds and links fine on i386
ActivePublic

Authored by mmokhi on Oct 14 2018, 2:03 PM.
#include <stdint.h>
#include <stdatomic.h>
int main (int argc, char **argv)
{
uint64_t ull1 = 1, ull2 = 0, ull3 = 2;
__atomic_load_n(&ull1, __ATOMIC_SEQ_CST);
__atomic_compare_exchange(&ull1, &ull2, &ull3, 1, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
__atomic_fetch_add(&ull1, 1, __ATOMIC_SEQ_CST);
__atomic_fetch_sub(&ull1, 1, __ATOMIC_SEQ_CST);
__atomic_or_fetch(&ull1, ull2, __ATOMIC_SEQ_CST);
__atomic_and_fetch(&ull1, ull2, __ATOMIC_SEQ_CST);
return 0;
}

Event Timeline

mmokhi created this paste.Oct 14 2018, 2:03 PM
mmokhi created this object in space S1 Global.