<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libatomic_ops.git/tests/test_atomic_include.template, branch draft-coveralls-linux</title>
<subtitle>github.com: ivmai/libatomic_ops.git
</subtitle>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/'/>
<entry>
<title>Fix test_atomic failure caused unaligned AO_double_t access on x86</title>
<updated>2017-01-24T19:51:19+00:00</updated>
<author>
<name>Ivan Maidanski</name>
<email>ivmai@mail.ru</email>
</author>
<published>2017-01-24T19:46:57+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/commit/?id=d1ad2daa7e195c82e3e5423e31af90fb01f7307d'/>
<id>d1ad2daa7e195c82e3e5423e31af90fb01f7307d</id>
<content type='text'>
The failure is caused by violation of an assertion that checks
AO_double_t variable is 8-byte aligned on x86.

* doc/README.txt (AO_double_t): Add note about required alignment.
* src/atomic_ops/sysdeps/standard_ao_double_t.h (AO_double_t): Add
comment about alignment.
* src/atomic_ops_stack.h (AO_stack_t): Likewise.
* tests/test_atomic_include.template (test_atomicXX): Define old_w, w
local variables as static (as otherwise, e.g., they could have 4-byte
alignment on x86); add comment.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The failure is caused by violation of an assertion that checks
AO_double_t variable is 8-byte aligned on x86.

* doc/README.txt (AO_double_t): Add note about required alignment.
* src/atomic_ops/sysdeps/standard_ao_double_t.h (AO_double_t): Add
comment about alignment.
* src/atomic_ops_stack.h (AO_stack_t): Likewise.
* tests/test_atomic_include.template (test_atomicXX): Define old_w, w
local variables as static (as otherwise, e.g., they could have 4-byte
alignment on x86); add comment.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Fix test_atomic fail caused unaligned AO_double_t access (VC/x86)"</title>
<updated>2017-01-24T19:50:46+00:00</updated>
<author>
<name>Ivan Maidanski</name>
<email>ivmai@mail.ru</email>
</author>
<published>2017-01-24T14:49:58+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/commit/?id=4949e9b8cb409288fcaa0553ead9704ca6219a23'/>
<id>4949e9b8cb409288fcaa0553ead9704ca6219a23</id>
<content type='text'>
This reverts commit 69c4010c1b3d43e2e179421e27379aaa5aeeb6d8.

The failure is actually caused by the fact that default alignment of
stack on x86 is 4 bytes.
So, another solution should be proposed to fix the issue for other
compilers (and, potentially, other targets).  E.g. do not place
AO_double_t volatile variables on stack.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 69c4010c1b3d43e2e179421e27379aaa5aeeb6d8.

The failure is actually caused by the fact that default alignment of
stack on x86 is 4 bytes.
So, another solution should be proposed to fix the issue for other
compilers (and, potentially, other targets).  E.g. do not place
AO_double_t volatile variables on stack.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix test_atomic failure caused unaligned AO_double_t access on x86 (VC++)</title>
<updated>2017-01-20T08:58:13+00:00</updated>
<author>
<name>Ivan Maidanski</name>
<email>ivmai@mail.ru</email>
</author>
<published>2017-01-20T08:58:13+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/commit/?id=69c4010c1b3d43e2e179421e27379aaa5aeeb6d8'/>
<id>69c4010c1b3d43e2e179421e27379aaa5aeeb6d8</id>
<content type='text'>
Passing an unaligned AO_double_t pointer to AO double-wide primitives
results in an undefined behavior of the latter when running on x86 (or
violation of the corresponding assertion on the alignment).
MS VC++/x86 aligns AO_double_t values on a 4-byte boundary by default.
For the proper alignment, __declspec(align(8)) should be applied to
variables defined in the client code (which uses double-wide AO
primitives).  Unfortunately, the attribute cannot be added to
AO_double_t definition itself because the compiler does not allow the
attribute for function arguments.

This patch introduces AO_DOUBLE_ALIGN attribute for use by clients of
the double-wide AO primitives (and, thus, AO_stack clients).
Matters only Visual Studio compiler for X86.
The inner clients (atomic_ops_malloc, test_atomic, test_stack) are
updated to use this attribute.

* doc/README_win32.txt [x86] (AO_DOUBLE_ALIGN): Document.
* src/atomic_ops/sysdeps/generic_pthread.h (AO_DOUBLE_ALIGN): Define
(as empty).
* src/atomic_ops/sysdeps/standard_ao_double_t.h [!_WIN64 &amp;&amp; _WIN32
&amp;&amp; !__GNUC__ &amp;&amp; _MSC_VER] (AO_DOUBLE_ALIGN): Define as declspec
align(8); document it.
* src/atomic_ops/sysdeps/standard_ao_double_t.h [!AO_DOUBLE_ALIGN]
(AO_DOUBLE_ALIGN): Define as empty (otherwise).
* src/atomic_ops_stack.h [AO_USE_ALMOST_LOCK_FREE &amp;&amp; !AO_DOUBLE_ALIGN]
(AO_DOUBLE_ALIGN): Likewise.
* src/atomic_ops_malloc.c (AO_free_list): Use AO_DOUBLE_ALIGN attribute.
* tests/test_stack.c (the_list): Likewise.
* src/atomic_ops_stack.h [!AO_USE_ALMOST_LOCK_FREE] (AO_stack_t):
Document AO_DOUBLE_ALIGN usage (by clients).
* tests/test_atomic_include.template (test_atomicXX): Use
AO_DOUBLE_ALIGN attribute for old_w and w double-wide local variables
(to avoid alignment assertion violation or AO primitives undefined
behavior on x86 if the test code is compiled by VC++).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Passing an unaligned AO_double_t pointer to AO double-wide primitives
results in an undefined behavior of the latter when running on x86 (or
violation of the corresponding assertion on the alignment).
MS VC++/x86 aligns AO_double_t values on a 4-byte boundary by default.
For the proper alignment, __declspec(align(8)) should be applied to
variables defined in the client code (which uses double-wide AO
primitives).  Unfortunately, the attribute cannot be added to
AO_double_t definition itself because the compiler does not allow the
attribute for function arguments.

This patch introduces AO_DOUBLE_ALIGN attribute for use by clients of
the double-wide AO primitives (and, thus, AO_stack clients).
Matters only Visual Studio compiler for X86.
The inner clients (atomic_ops_malloc, test_atomic, test_stack) are
updated to use this attribute.

* doc/README_win32.txt [x86] (AO_DOUBLE_ALIGN): Document.
* src/atomic_ops/sysdeps/generic_pthread.h (AO_DOUBLE_ALIGN): Define
(as empty).
* src/atomic_ops/sysdeps/standard_ao_double_t.h [!_WIN64 &amp;&amp; _WIN32
&amp;&amp; !__GNUC__ &amp;&amp; _MSC_VER] (AO_DOUBLE_ALIGN): Define as declspec
align(8); document it.
* src/atomic_ops/sysdeps/standard_ao_double_t.h [!AO_DOUBLE_ALIGN]
(AO_DOUBLE_ALIGN): Define as empty (otherwise).
* src/atomic_ops_stack.h [AO_USE_ALMOST_LOCK_FREE &amp;&amp; !AO_DOUBLE_ALIGN]
(AO_DOUBLE_ALIGN): Likewise.
* src/atomic_ops_malloc.c (AO_free_list): Use AO_DOUBLE_ALIGN attribute.
* tests/test_stack.c (the_list): Likewise.
* src/atomic_ops_stack.h [!AO_USE_ALMOST_LOCK_FREE] (AO_stack_t):
Document AO_DOUBLE_ALIGN usage (by clients).
* tests/test_atomic_include.template (test_atomicXX): Use
AO_DOUBLE_ALIGN attribute for old_w and w double-wide local variables
(to avoid alignment assertion violation or AO primitives undefined
behavior on x86 if the test code is compiled by VC++).
</pre>
</div>
</content>
</entry>
<entry>
<title>Workaround 'uninitialized memory use' MemorySanitizer warning (test_atomic)</title>
<updated>2016-12-05T17:26:16+00:00</updated>
<author>
<name>Ivan Maidanski</name>
<email>ivmai@mail.ru</email>
</author>
<published>2016-12-05T17:26:16+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/commit/?id=8fc1a2ffc4bb47bf11e61864768810a9561c770b'/>
<id>8fc1a2ffc4bb47bf11e61864768810a9561c770b</id>
<content type='text'>
* tests/test_atomic_include.template (test_atomicXX): Ensure old_w is
always initialized before AO_double_storeXX; add comment about MSan
false warning.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* tests/test_atomic_include.template (test_atomicXX): Ensure old_w is
always initialized before AO_double_storeXX; add comment about MSan
false warning.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add *_and/or/xor* and *_[fetch_]compare_and_swap* tests to test_atomic</title>
<updated>2016-11-01T09:18:33+00:00</updated>
<author>
<name>Ivan Maidanski</name>
<email>ivmai@mail.ru</email>
</author>
<published>2016-11-01T09:18:33+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/commit/?id=020bdf20b8f972a32e93064b2d836aab1ed23d83'/>
<id>020bdf20b8f972a32e93064b2d836aab1ed23d83</id>
<content type='text'>
Previously, only AO_and/or/xor and AO_[fetch]_CAS tests (for AO_t)
existed in test_atomic.

* tests/test_atomic_include.template (test_atomicXX): Add minimal
testing of AO_short_compare_and_swapXX, AO_short_orXX, AO_short_xorXX,
AO_short_andXX, AO_short_fetch_compare_and_swapXX,
AO_char_compare_and_swapXX, AO_char_orXX, AO_char_xorXX, AO_char_andXX,
AO_char_fetch_compare_and_swapXX, AO_int_compare_and_swapXX,
AO_int_orXX, AO_int_xorXX, AO_int_andXX,
AO_int_fetch_compare_and_swapXX.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, only AO_and/or/xor and AO_[fetch]_CAS tests (for AO_t)
existed in test_atomic.

* tests/test_atomic_include.template (test_atomicXX): Add minimal
testing of AO_short_compare_and_swapXX, AO_short_orXX, AO_short_xorXX,
AO_short_andXX, AO_short_fetch_compare_and_swapXX,
AO_char_compare_and_swapXX, AO_char_orXX, AO_char_xorXX, AO_char_andXX,
AO_char_fetch_compare_and_swapXX, AO_int_compare_and_swapXX,
AO_int_orXX, AO_int_xorXX, AO_int_andXX,
AO_int_fetch_compare_and_swapXX.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix reporting about missing and/or/xor_dd_acquire_read (test_atomic)</title>
<updated>2016-11-01T08:25:39+00:00</updated>
<author>
<name>Ivan Maidanski</name>
<email>ivmai@mail.ru</email>
</author>
<published>2016-11-01T08:25:39+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/commit/?id=9b5c548da220b8ffb07661c5c8fe0bbbee894725'/>
<id>9b5c548da220b8ffb07661c5c8fe0bbbee894725</id>
<content type='text'>
AO_XSIZE_and/or/xor_dd_acquire_read are meaningless and not implemented,
thus their absence is not reported in the tests.

* tests/test_atomic_include.template [!AO_HAVE_orXX] (test_atomicXX):
Do not call MISSING(AO_or) if all AO_HAVE_or* excluding
AO_HAVE_or_dd_acquire_read are not defined.
* tests/test_atomic_include.template [!AO_HAVE_xorXX] (test_atomicXX):
Do not call MISSING(AO_xor) if all AO_HAVE_xor* excluding
AO_HAVE_xor_dd_acquire_read are not defined.
* tests/test_atomic_include.template [!AO_HAVE_andXX] (test_atomicXX):
Do not call MISSING(AO_and) if all AO_HAVE_and* excluding
AO_HAVE_and_dd_acquire_read are not defined.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
AO_XSIZE_and/or/xor_dd_acquire_read are meaningless and not implemented,
thus their absence is not reported in the tests.

* tests/test_atomic_include.template [!AO_HAVE_orXX] (test_atomicXX):
Do not call MISSING(AO_or) if all AO_HAVE_or* excluding
AO_HAVE_or_dd_acquire_read are not defined.
* tests/test_atomic_include.template [!AO_HAVE_xorXX] (test_atomicXX):
Do not call MISSING(AO_xor) if all AO_HAVE_xor* excluding
AO_HAVE_xor_dd_acquire_read are not defined.
* tests/test_atomic_include.template [!AO_HAVE_andXX] (test_atomicXX):
Do not call MISSING(AO_and) if all AO_HAVE_and* excluding
AO_HAVE_and_dd_acquire_read are not defined.
</pre>
</div>
</content>
</entry>
<entry>
<title>Workaround 'function is never used' cppcheck style warnings</title>
<updated>2016-10-25T07:14:05+00:00</updated>
<author>
<name>Ivan Maidanski</name>
<email>ivmai@mail.ru</email>
</author>
<published>2016-10-25T07:13:35+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/commit/?id=30596717d2c3580e826b4660efdf1b1926fa1073'/>
<id>30596717d2c3580e826b4660efdf1b1926fa1073</id>
<content type='text'>
* src/atomic_ops.h [AO_CAN_EMUL_CAS]: Include emul_cas.h also if
CPPCHECK (to define AO_store_full as AO_store_full_emulation).
* tests/test_atomic_include.template [CPPCHECK] (list_atomicXX,
char_list_atomicXX, short_list_atomicXX, int_list_atomicXX,
double_list_atomicXX): Declare function.
* tests/test_atomic_include.template test_atomicXX (test_atomicXX):
Call list_atomicXX, char_list_atomicXX, short_list_atomicXX,
int_list_atomicXX and double_list_atomicXX if CPPCHECK.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/atomic_ops.h [AO_CAN_EMUL_CAS]: Include emul_cas.h also if
CPPCHECK (to define AO_store_full as AO_store_full_emulation).
* tests/test_atomic_include.template [CPPCHECK] (list_atomicXX,
char_list_atomicXX, short_list_atomicXX, int_list_atomicXX,
double_list_atomicXX): Declare function.
* tests/test_atomic_include.template test_atomicXX (test_atomicXX):
Call list_atomicXX, char_list_atomicXX, short_list_atomicXX,
int_list_atomicXX and double_list_atomicXX if CPPCHECK.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix 'variable new value is never used' cppcheck style warning</title>
<updated>2016-10-17T05:22:53+00:00</updated>
<author>
<name>Ivan Maidanski</name>
<email>ivmai@mail.ru</email>
</author>
<published>2016-10-17T05:22:53+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/commit/?id=2798b417e18449b65d0c57122410b62bccbc66b4'/>
<id>2798b417e18449b65d0c57122410b62bccbc66b4</id>
<content type='text'>
Assertion for v value after fetch_and_sub1(&amp;v) is added.

* tests/test_atomic_include.template (test_atomicXX): Call TA_assert
for s, b, zz values after they are decremented (use volatile pointer to
avoid "condition is always true" compiler warning).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Assertion for v value after fetch_and_sub1(&amp;v) is added.

* tests/test_atomic_include.template (test_atomicXX): Call TA_assert
for s, b, zz values after they are decremented (use volatile pointer to
avoid "condition is always true" compiler warning).
</pre>
</div>
</content>
</entry>
<entry>
<title>Workaround 'condition always true', 'unused stored value' cppcheck warnings</title>
<updated>2016-08-24T08:22:56+00:00</updated>
<author>
<name>Ivan Maidanski</name>
<email>ivmai@mail.ru</email>
</author>
<published>2016-08-24T08:22:56+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/commit/?id=457bc16e5514b7cdde175106807b3b4c04256209'/>
<id>457bc16e5514b7cdde175106807b3b4c04256209</id>
<content type='text'>
* tests/test_atomic_include.template (test_atomicXX): Treat "x"
variable as volatile one to suppress cppcheck warning that x==13 is
always true.
* tests/test_atomic_include.template (test_atomicXX): Make
TA_assert(x==117) unconditional to suppress cppcheck warning that the
value assigned by x=117 is never used.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* tests/test_atomic_include.template (test_atomicXX): Treat "x"
variable as volatile one to suppress cppcheck warning that x==13 is
always true.
* tests/test_atomic_include.template (test_atomicXX): Make
TA_assert(x==117) unconditional to suppress cppcheck warning that the
value assigned by x=117 is never used.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix assertions style in test_atomic_include</title>
<updated>2016-08-24T08:07:38+00:00</updated>
<author>
<name>Ivan Maidanski</name>
<email>ivmai@mail.ru</email>
</author>
<published>2016-08-24T08:07:38+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/commit/?id=f1c482eaf49ac1d122759a437c60d07282aa126e'/>
<id>f1c482eaf49ac1d122759a437c60d07282aa126e</id>
<content type='text'>
Use TA_assert consistently (not assert).

* tests/test_atomic_include.template (test_atomicXX): Replace assert()
calls with TA_assert().
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use TA_assert consistently (not assert).

* tests/test_atomic_include.template (test_atomicXX): Replace assert()
calls with TA_assert().
</pre>
</div>
</content>
</entry>
</feed>
