Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Paste
P228
atomic_* test, builds and links fine on i386
Active
Public
Actions
Authored by
mmokhi
on Oct 14 2018, 2:03 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F3872844: atomic_* test, builds and links fine on i386
Oct 14 2018, 2:03 PM
2018-10-14 14:03:09 (UTC+0)
Subscribers
mmokhi
theraven
#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
2018-10-14 14:03:09 (UTC+0)
mmokhi
created this object in space
S1 Global
.
Log In to Comment