Function report |
Source Code:lib\atomic64_test.c |
Create Date:2022-07-28 07:17:42 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:test_atomic64
Proto:static __init void test_atomic64(void)
Type:void
Parameter:Nothing
149 | v0 = 0xaaa31337c001d00dLL |
150 | v1 = 0xdeadbeefdeafcafeLL |
151 | v2 = 0xfaceabadf00df001LL |
152 | v3 = 0x8000000000000000LL |
153 | onestwos = 0x1111111122222222LL |
154 | one = 1LL |
157 | v = ATOMIC64_INIT(v0) |
161 | atomic64_set( & v, v1) |
164 | BUG_ON(atomic64_read( & v) != r) |
175 | RETURN_FAMILY_TEST(64, add_return, += , onestwos) |
176 | RETURN_FAMILY_TEST(64, add_return, += , - one) |
177 | RETURN_FAMILY_TEST(64, sub_return, -= , onestwos) |
178 | RETURN_FAMILY_TEST(64, sub_return, -= , - one) |
180 | FETCH_FAMILY_TEST(64, fetch_add, += , onestwos) |
181 | FETCH_FAMILY_TEST(64, fetch_add, += , - one) |
182 | FETCH_FAMILY_TEST(64, fetch_sub, -= , onestwos) |
183 | FETCH_FAMILY_TEST(64, fetch_sub, -= , - one) |
185 | FETCH_FAMILY_TEST(64, fetch_or, |= , v1) |
186 | FETCH_FAMILY_TEST(64, fetch_and, &= , v1) |
187 | FETCH_FAMILY_TEST(64, fetch_andnot, &= ~, v1) |
188 | FETCH_FAMILY_TEST(64, fetch_xor, ^= , v1) |
191 | atomic64_inc( & v) |
196 | atomic64_dec( & v) |
200 | INC_RETURN_FAMILY_TEST(64, v0) |
201 | DEC_RETURN_FAMILY_TEST(64, v0) |
203 | XCHG_FAMILY_TEST(64, v0, v1) |
204 | CMPXCHG_FAMILY_TEST(64, v0, v1, v2) |
216 | BUG_ON(atomic64_dec_if_positive( & v) != (onestwos - 1)) |
220 | INIT(0) |
221 | BUG_ON(atomic64_dec_if_positive( & v) != - one) |
225 | BUG_ON(atomic64_dec_if_positive( & v) != ( - one - one)) |
229 | BUG_ON(!atomic64_inc_not_zero( & v)) |
233 | INIT(0) |
234 | BUG_ON(atomic64_inc_not_zero( & v)) |
238 | BUG_ON(!atomic64_inc_not_zero( & v)) |
244 | r_int = atomic64_inc_not_zero( & v) |
Name | Describe |
---|---|
test_atomics_init |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |