History log of /bionic/tests/stdatomic_test.cpp
Revision Date Author Comments
9ac60bf82b1f0e316666b862e9924f90caa60342 29-Aug-2014 Hans Boehm <hboehm@google.com> Make stdatomic.h work with gcc4.6 host compiler

This is needed to make L work correctly, and bionic tests pass
again, after applying the equivalent of
commit 00aaea364501b3b0abe58dae461136159df1e356 there.

It makes the preexisting code that uses __sync implementations
much more useful, although we should no longer be exercising that
code in AOSP.

Specifically fixes:

We were invoking __has_extension and __has_builtin for GCC compilations.
They're clang specific. Restructured the tests.

The __sync implementation was not defining the LOCK_FREE macros.

ATOMIC_VAR_INIT was using named field initializations. These are a
C, not C++, feature, that is not supported by g++ 4.6.

The stdatomic bionic test still failed with 4.6 and glibc with our
questionable LOCK_FREE macro implementation. Don't run that piece
with 4.6.

In L, this is a prerequisite for fixing:

Bug:16880454
Bug:16513433

Change-Id: I9b61e42307f96a114dce7552b6ead4ad1c544eab
(cherry picked from commit 32429606bf696d3b2ca555f132a0d60c566d0bd0)
c8cf3513ecb265ba3aadc846aa2113290a504c44 20-Aug-2014 Hans Boehm <hboehm@google.com> Fix, generalize stdatomic.h; improve test.

We seem to use this stdatomic.h sometimes, and slightly different prebuilts
at other times, making them all difficult to test, and making it unclear
which one we're testing. This generalizes the bionic header so that it
can be used directly as the prebuilt header as well. So long as they
don't diverge again, that should somewhat improve test coverage.

Use the correct builtin for atomic_is_lock_free.

Fix atomic_flag_init.

Turn on atomic tests even with __GLIBC__, since they now appear to pass.

Include uchar.h in stdatomic.h where needed.

Add a basic memory ordering test.

Fix bit-rotted comments in bionic tests makefile.

Prerequisite for fixing b/16880454 and

Bug:16513433

Change-Id: If6a14c1075b379395ba5d93357d56025c0ffab68
(cherry picked from commit 00aaea364501b3b0abe58dae461136159df1e356)
34b258dd692951ab2236e134e5520367cda60125 25-Jul-2014 Raghu Gandham <raghu.gandham@imgtec.com> [MIPS] Fix atomic_is_lock_free test for mips32.
On 32-bit MIPS, 64-bit atomic ops are achieved through locks.
So allow the test to fail for atomic_intmax_t on 32-bit MIPS.

(cherry picked from commit f1837377d215a6eda294b6ac7552b226deee91ce)

Change-Id: I973d999c31c9ab89b5a7b709beff6486b93408f2
6b3beb23d666b722deeb81672166766ad28e7340 29-May-2014 Dan Albert <danalbert@google.com> Fixes stdatomic.h test to match C11 spec

C11 defines the expected value to atomic_compare_exchange_* as being non-atomic
types. Using an atomic type is a syntax error in clang.

http://en.cppreference.com/w/c/atomic/atomic_compare_exchange

Change-Id: I74de1061fa1fc50d835451792d902000f368200e
e6c57fcb05b0dcbfa8129bb6f7d99093f4819370 24-May-2014 Elliott Hughes <enh@google.com> Add C11 <stdatomic.h>.

Bug: 14903517
Change-Id: I631dbfdaa698cf7fea8e3b5e18a32586383e62a5