Commit afd88205 by Benjamin Kosnik Committed by Benjamin Kosnik

atomic: Update to N3000.

2009-12-20  Benjamin Kosnik  <bkoz@redhat.com>

	* include/std/atomic: Update to N3000.
	* include/bits/atomic_0.h: Same.
	* include/bits/atomic_2.h: Same.
	* include/c_global/cstdatomic: Move...
	* include/bits/atomic_base.h: ...here.
	* include/c_compatibility/stdatomic.h: Just include atomic_base.h.
	* include/precompiled/stdc++.h: Adjust includes.
	* include/Makefile.am: Adjust files.
	* include/Makefile.in: Regenerate.
	* include/std/future: Adjust.
	* src/atomic.cc: Adjust, adjust exports for compatibility.
	* src/compatibility.cc: Move C++0x stuff...
	* src/compatibility-c++0x.cc: ...here.

	* doc/xml/manual/using.xml: Update.
	* doc/xml/manual/status_cxx200x.xml: Update.
	* doc/doxygen/user.cfg.in: Update.

	* testsuite/29_atomics/atomic_address/cons/assign_neg.cc: Same.
	* testsuite/29_atomics/atomic_address/cons/single_value.cc: Same.
	* testsuite/29_atomics/atomic_address/cons/copy_neg.cc: Same.
	* testsuite/29_atomics/atomic_address/cons/default.cc: Same.
	* testsuite/29_atomics/atomic_address/cons/aggregate.cc: Same.
	* testsuite/29_atomics/atomic_address/requirements/
	standard_layout.cc: Same.
	* testsuite/29_atomics/atomic_address/requirements/trivial.cc: Same.
	* testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same.
	* testsuite/29_atomics/atomic_integral/cons/single_value.cc: Same.
	* testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same.
	* testsuite/29_atomics/atomic_integral/cons/default.cc: Same.
	* testsuite/29_atomics/atomic_integral/cons/copy_list.cc: Same.
	* testsuite/29_atomics/atomic_integral/cons/direct_list.cc: Same.
	* testsuite/29_atomics/atomic_integral/requirements/
	standard_layout.cc: Same.
	* testsuite/29_atomics/atomic_integral/requirements/trivial.cc: Same.
	* testsuite/29_atomics/atomic_integral/operators/increment_neg.cc: Same.
	* testsuite/29_atomics/atomic_integral/operators/
	integral_assignment.cc: Same.
	* testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same.
	* testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc: Same.
	* testsuite/29_atomics/atomic_integral/operators/increment.cc: Same.
	* testsuite/29_atomics/atomic_integral/operators/bitwise.cc: Same.
	* testsuite/29_atomics/atomic_integral/operators/decrement.cc: Same.
	* testsuite/29_atomics/atomic_integral/operators/
	integral_conversion.cc: Same.
	* testsuite/29_atomics/atomic_flag/cons/assign_neg.cc: Same.
	* testsuite/29_atomics/atomic_flag/cons/copy_neg.cc: Same.
	* testsuite/29_atomics/atomic_flag/cons/default.cc: Same.
	* testsuite/29_atomics/atomic_flag/cons/aggregate.cc: Same.
	* testsuite/29_atomics/atomic_flag/requirements/
	standard_layout.cc: Same.
	* testsuite/29_atomics/atomic_flag/requirements/trivial.cc: Same.
	* testsuite/29_atomics/atomic_flag/clear/1.cc: Same.
	* testsuite/29_atomics/atomic_flag/test_and_set/explicit.c
	* testsuite/29_atomics/atomic_flag/test_and_set/explicit.cc: Same.
	* testsuite/29_atomics/atomic_flag/test_and_set/implicit.c
	* testsuite/29_atomics/atomic_flag/test_and_set/implicit.cc: Same.
	* testsuite/29_atomics/headers/stdatomic.h/functions.c
	* testsuite/29_atomics/atomic/cons/assign_neg.cc: Same.
	* testsuite/29_atomics/atomic/cons/single_value.cc: Same.
	* testsuite/29_atomics/atomic/cons/copy_neg.cc: Same.
	* testsuite/29_atomics/atomic/cons/default.cc: Same.
	* testsuite/29_atomics/atomic/cons/copy_list.cc: Same.
	* testsuite/29_atomics/atomic/cons/direct_list.cc: Same.
	* testsuite/29_atomics/atomic/requirements/explicit_instantiation/
	1.cc: Same.
	* testsuite/29_atomics/atomic/requirements/base_classes.cc: Same.
	* testsuite/29_atomics/atomic/operators/integral_assignment.cc: Same.
	* testsuite/29_atomics/atomic/operators/integral_conversion.cc: Same.
	* testsuite/util/testsuite_common_types.h: Adjust.

	* testsuite/29_atomics/headers/cstdatomic: Move and adjust...
	* testsuite/29_atomics/headers/atomic: ...here.
	* testsuite/29_atomics/headers/atomic/types_std_c++0x.cc: Same.
	* testsuite/29_atomics/headers/atomic/functions_std_c++0x.cc: Same.
	* testsuite/29_atomics/headers/atomic/std_c++0x_neg.cc: Same.
	* testsuite/29_atomics/headers/atomic/macros.cc: Same.

	* testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc: Add.
	* testsuite/29_atomics/atomic/cons/user_pod.cc: Add.

From-SVN: r155377
parent dcc1e1fa
2009-12-20 Benjamin Kosnik <bkoz@redhat.com>
* include/std/atomic: Update to N3000.
* include/bits/atomic_0.h: Same.
* include/bits/atomic_2.h: Same.
* include/c_global/cstdatomic: Move...
* include/bits/atomic_base.h: ...here.
* include/c_compatibility/stdatomic.h: Just include atomic_base.h.
* include/precompiled/stdc++.h: Adjust includes.
* include/Makefile.am: Adjust files.
* include/Makefile.in: Regenerate.
* include/std/future: Adjust.
* src/atomic.cc: Adjust, adjust exports for compatibility.
* src/compatibility.cc: Move C++0x stuff...
* src/compatibility-c++0x.cc: ...here.
* doc/xml/manual/using.xml: Update.
* doc/xml/manual/status_cxx200x.xml: Update.
* doc/doxygen/user.cfg.in: Update.
* testsuite/29_atomics/atomic_address/cons/assign_neg.cc: Same.
* testsuite/29_atomics/atomic_address/cons/single_value.cc: Same.
* testsuite/29_atomics/atomic_address/cons/copy_neg.cc: Same.
* testsuite/29_atomics/atomic_address/cons/default.cc: Same.
* testsuite/29_atomics/atomic_address/cons/aggregate.cc: Same.
* testsuite/29_atomics/atomic_address/requirements/
standard_layout.cc: Same.
* testsuite/29_atomics/atomic_address/requirements/trivial.cc: Same.
* testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same.
* testsuite/29_atomics/atomic_integral/cons/single_value.cc: Same.
* testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same.
* testsuite/29_atomics/atomic_integral/cons/default.cc: Same.
* testsuite/29_atomics/atomic_integral/cons/copy_list.cc: Same.
* testsuite/29_atomics/atomic_integral/cons/direct_list.cc: Same.
* testsuite/29_atomics/atomic_integral/requirements/
standard_layout.cc: Same.
* testsuite/29_atomics/atomic_integral/requirements/trivial.cc: Same.
* testsuite/29_atomics/atomic_integral/operators/increment_neg.cc: Same.
* testsuite/29_atomics/atomic_integral/operators/
integral_assignment.cc: Same.
* testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same.
* testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc: Same.
* testsuite/29_atomics/atomic_integral/operators/increment.cc: Same.
* testsuite/29_atomics/atomic_integral/operators/bitwise.cc: Same.
* testsuite/29_atomics/atomic_integral/operators/decrement.cc: Same.
* testsuite/29_atomics/atomic_integral/operators/
integral_conversion.cc: Same.
* testsuite/29_atomics/atomic_flag/cons/assign_neg.cc: Same.
* testsuite/29_atomics/atomic_flag/cons/copy_neg.cc: Same.
* testsuite/29_atomics/atomic_flag/cons/default.cc: Same.
* testsuite/29_atomics/atomic_flag/cons/aggregate.cc: Same.
* testsuite/29_atomics/atomic_flag/requirements/
standard_layout.cc: Same.
* testsuite/29_atomics/atomic_flag/requirements/trivial.cc: Same.
* testsuite/29_atomics/atomic_flag/clear/1.cc: Same.
* testsuite/29_atomics/atomic_flag/test_and_set/explicit.c
* testsuite/29_atomics/atomic_flag/test_and_set/explicit.cc: Same.
* testsuite/29_atomics/atomic_flag/test_and_set/implicit.c
* testsuite/29_atomics/atomic_flag/test_and_set/implicit.cc: Same.
* testsuite/29_atomics/headers/stdatomic.h/functions.c
* testsuite/29_atomics/atomic/cons/assign_neg.cc: Same.
* testsuite/29_atomics/atomic/cons/single_value.cc: Same.
* testsuite/29_atomics/atomic/cons/copy_neg.cc: Same.
* testsuite/29_atomics/atomic/cons/default.cc: Same.
* testsuite/29_atomics/atomic/cons/copy_list.cc: Same.
* testsuite/29_atomics/atomic/cons/direct_list.cc: Same.
* testsuite/29_atomics/atomic/requirements/explicit_instantiation/
1.cc: Same.
* testsuite/29_atomics/atomic/requirements/base_classes.cc: Same.
* testsuite/29_atomics/atomic/operators/integral_assignment.cc: Same.
* testsuite/29_atomics/atomic/operators/integral_conversion.cc: Same.
* testsuite/util/testsuite_common_types.h: Adjust.
* testsuite/29_atomics/headers/cstdatomic: Move and adjust...
* testsuite/29_atomics/headers/atomic: ...here.
* testsuite/29_atomics/headers/atomic/types_std_c++0x.cc: Same.
* testsuite/29_atomics/headers/atomic/functions_std_c++0x.cc: Same.
* testsuite/29_atomics/headers/atomic/std_c++0x_neg.cc: Same.
* testsuite/29_atomics/headers/atomic/macros.cc: Same.
* testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc: Add.
* testsuite/29_atomics/atomic/cons/user_pod.cc: Add.
2009-12-18 Jimmy Guo <jguo@yahoo-inc.com>
PR libstdc++/40088
......
......@@ -580,6 +580,7 @@ INPUT = @srcdir@/doc/doxygen/doxygroups.cc \
@srcdir@/libsupc++/typeinfo \
include/algorithm \
include/array \
include/atomic \
include/bitset \
include/chrono \
include/complex \
......@@ -635,7 +636,6 @@ INPUT = @srcdir@/doc/doxygen/doxygroups.cc \
include/csetjmp \
include/csignal \
include/cstdarg \
include/cstdatomic \
include/cstdbool \
include/cstddef \
include/cstdint \
......
......@@ -2200,7 +2200,7 @@ particular release.
</row>
<row>
<entry>29.2</entry>
<entry>Header <code>&lt;cstdatomic&gt;</code> synopsis</entry>
<entry>Header <code>&lt;atomic&gt;</code> synopsis</entry>
<entry>Y</entry>
<entry></entry>
</row>
......
......@@ -329,24 +329,23 @@ mode, i.e. <literal>-std=c++0x</literal> or <literal>-std=gnu++0x</literal>.
<entry><filename class="headerfile">csetjmp</filename></entry>
<entry><filename class="headerfile">csignal</filename></entry>
<entry><filename class="headerfile">cstdarg</filename></entry>
<entry><filename class="headerfile">cstdatomic</filename></entry>
<entry><filename class="headerfile">cstdbool</filename></entry>
</row>
<row>
<entry><filename class="headerfile">cstdbool</filename></entry>
<entry><filename class="headerfile">cstddef</filename></entry>
<entry><filename class="headerfile">cstdint</filename></entry>
<entry><filename class="headerfile">cstdlib</filename></entry>
<entry><filename class="headerfile">cstdio</filename></entry>
<entry><filename class="headerfile">cstring</filename></entry>
</row>
<row>
<entry><filename class="headerfile">cstring</filename></entry>
<entry><filename class="headerfile">ctgmath</filename></entry>
<entry><filename class="headerfile">ctime</filename></entry>
<entry><filename class="headerfile">cuchar</filename></entry>
<entry><filename class="headerfile">cwchar</filename></entry>
<entry><filename class="headerfile">cwctype</filename></entry>
</row>
<row>
<entry><filename class="headerfile">cwctype</filename></entry>
<entry><filename class="headerfile">stdatomic.h</filename></entry>
</row>
......
......@@ -29,6 +29,7 @@ std_builddir = .
std_headers = \
${std_srcdir}/algorithm \
${std_srcdir}/array \
${std_srcdir}/atomic \
${std_srcdir}/bitset \
${std_srcdir}/c++0x_warning.h \
${std_srcdir}/chrono \
......@@ -78,6 +79,7 @@ bits_builddir = ./bits
bits_headers = \
${bits_srcdir}/algorithmfwd.h \
${bits_srcdir}/allocator.h \
${bits_srcdir}/atomic_base.h \
${bits_srcdir}/atomicfwd_c.h \
${bits_srcdir}/atomicfwd_cxx.h \
${bits_srcdir}/atomic_0.h \
......@@ -641,7 +643,6 @@ c_base_headers = \
${c_base_srcdir}/csetjmp \
${c_base_srcdir}/csignal \
${c_base_srcdir}/cstdarg \
${c_base_srcdir}/cstdatomic \
${c_base_srcdir}/cstdbool \
${c_base_srcdir}/cstddef \
${c_base_srcdir}/cstdint \
......
......@@ -271,6 +271,7 @@ std_builddir = .
std_headers = \
${std_srcdir}/algorithm \
${std_srcdir}/array \
${std_srcdir}/atomic \
${std_srcdir}/bitset \
${std_srcdir}/c++0x_warning.h \
${std_srcdir}/chrono \
......@@ -320,6 +321,7 @@ bits_builddir = ./bits
bits_headers = \
${bits_srcdir}/algorithmfwd.h \
${bits_srcdir}/allocator.h \
${bits_srcdir}/atomic_base.h \
${bits_srcdir}/atomicfwd_c.h \
${bits_srcdir}/atomicfwd_cxx.h \
${bits_srcdir}/atomic_0.h \
......@@ -881,7 +883,6 @@ c_base_headers = \
${c_base_srcdir}/csetjmp \
${c_base_srcdir}/csignal \
${c_base_srcdir}/cstdarg \
${c_base_srcdir}/cstdatomic \
${c_base_srcdir}/cstdbool \
${c_base_srcdir}/cstddef \
${c_base_srcdir}/cstdint \
......
// -*- C++ -*- compatibility header.
// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/** @file bits/atomic_base.h
* This is a Standard C++ Library header.
*/
#include <bits/c++config.h>
#include <stddef.h>
#include <stdbool.h> // XXX need to define bool w/o stdbool.h in tr1/cstdbool
#ifndef _GLIBCXX_ATOMIC_BASE_H
#define _GLIBCXX_ATOMIC_BASE_H 1
_GLIBCXX_BEGIN_NAMESPACE(std)
_GLIBCXX_BEGIN_EXTERN_C
/**
* @defgroup atomics Atomics
*
* Components for performing atomic operations.
* @{
*/
/// Enumeration for memory_order
typedef enum memory_order
{
memory_order_relaxed,
memory_order_consume,
memory_order_acquire,
memory_order_release,
memory_order_acq_rel,
memory_order_seq_cst
} memory_order;
// Base for atomic_flag.
typedef struct __atomic_flag_base
{
bool _M_i;
} __atomic_flag_base;
#define ATOMIC_FLAG_INIT { false }
/// 29.2 Lock-free Property
#if defined(_GLIBCXX_ATOMIC_BUILTINS_1) && defined(_GLIBCXX_ATOMIC_BUILTINS_2) \
&& defined(_GLIBCXX_ATOMIC_BUILTINS_4) && defined(_GLIBCXX_ATOMIC_BUILTINS_8)
# define _GLIBCXX_ATOMIC_PROPERTY 2
# define _GLIBCXX_ATOMIC_NAMESPACE __atomic2
#elif defined(_GLIBCXX_ATOMIC_BUILTINS_1)
# define _GLIBCXX_ATOMIC_PROPERTY 1
# define _GLIBCXX_ATOMIC_NAMESPACE __atomic1
#else
# define _GLIBCXX_ATOMIC_PROPERTY 0
# define _GLIBCXX_ATOMIC_NAMESPACE __atomic0
#endif
#define ATOMIC_INTEGRAL_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
#define ATOMIC_ADDRESS_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
// Switch atomic integral base types based on C or C++. In
// addition, for "C" only provide type-generic macros for atomic
// operations. (As C++ accomplishes the same thing with sets of
// overloaded functions.
#ifdef __cplusplus
inline namespace _GLIBCXX_ATOMIC_NAMESPACE { }
# include <bits/atomicfwd_cxx.h>
#else
# include <bits/atomicfwd_c.h>
#endif
// Typedefs for other atomic integral types.
typedef atomic_schar atomic_int_least8_t;
typedef atomic_uchar atomic_uint_least8_t;
typedef atomic_short atomic_int_least16_t;
typedef atomic_ushort atomic_uint_least16_t;
typedef atomic_int atomic_int_least32_t;
typedef atomic_uint atomic_uint_least32_t;
typedef atomic_llong atomic_int_least64_t;
typedef atomic_ullong atomic_uint_least64_t;
typedef atomic_schar atomic_int_fast8_t;
typedef atomic_uchar atomic_uint_fast8_t;
typedef atomic_short atomic_int_fast16_t;
typedef atomic_ushort atomic_uint_fast16_t;
typedef atomic_int atomic_int_fast32_t;
typedef atomic_uint atomic_uint_fast32_t;
typedef atomic_llong atomic_int_fast64_t;
typedef atomic_ullong atomic_uint_fast64_t;
typedef atomic_long atomic_intptr_t;
typedef atomic_ulong atomic_uintptr_t;
typedef atomic_long atomic_ssize_t;
typedef atomic_ulong atomic_size_t;
typedef atomic_llong atomic_intmax_t;
typedef atomic_ullong atomic_uintmax_t;
typedef atomic_long atomic_ptrdiff_t;
// Accessor functions for base atomic_flag type.
bool
atomic_flag_test_and_set_explicit(__atomic_flag_base*, memory_order)
_GLIBCXX_NOTHROW;
inline bool
atomic_flag_test_and_set(__atomic_flag_base* __a)
{ return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); }
void
atomic_flag_clear_explicit(__atomic_flag_base*, memory_order)
_GLIBCXX_NOTHROW;
inline void
atomic_flag_clear(__atomic_flag_base* __a)
{ atomic_flag_clear_explicit(__a, memory_order_seq_cst); }
void
__atomic_flag_wait_explicit(__atomic_flag_base*, memory_order)
_GLIBCXX_NOTHROW;
_GLIBCXX_CONST __atomic_flag_base*
__atomic_flag_for_address(const void* __z) _GLIBCXX_NOTHROW;
// Implementation specific defines.
#define _ATOMIC_LOAD_(__a, __x) \
({__typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
atomic_flag* __g = __atomic_flag_for_address(__p); \
__atomic_flag_wait_explicit(__g, __x); \
__typeof__ _ATOMIC_MEMBER_ __r = *__p; \
atomic_flag_clear_explicit(__g, __x); \
__r; })
#define _ATOMIC_STORE_(__a, __m, __x) \
({__typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
__typeof__(__m) __v = (__m); \
atomic_flag* __g = __atomic_flag_for_address(__p); \
__atomic_flag_wait_explicit(__g, __x); \
*__p = __v; \
atomic_flag_clear_explicit(__g, __x); \
__v; })
#define _ATOMIC_MODIFY_(__a, __o, __m, __x) \
({__typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
__typeof__(__m) __v = (__m); \
atomic_flag* __g = __atomic_flag_for_address(__p); \
__atomic_flag_wait_explicit(__g, __x); \
__typeof__ _ATOMIC_MEMBER_ __r = *__p; \
*__p __o __v; \
atomic_flag_clear_explicit(__g, __x); \
__r; })
#define _ATOMIC_CMPEXCHNG_(__a, __e, __m, __x) \
({__typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
__typeof__(__e) __q = (__e); \
__typeof__(__m) __v = (__m); \
bool __r; \
atomic_flag* __g = __atomic_flag_for_address(__p); \
__atomic_flag_wait_explicit(__g, __x); \
__typeof__ _ATOMIC_MEMBER_ __t__ = *__p; \
if (__t__ == *__q) { *__p = __v; __r = true; } \
else { *__q = __t__; __r = false; } \
atomic_flag_clear_explicit(__g, __x); \
__r; })
// @} group atomics
_GLIBCXX_END_EXTERN_C
_GLIBCXX_END_NAMESPACE
// Inject into global namespace.
#ifdef __cplusplus
#include <atomic>
using std::memory_order;
using std::memory_order_relaxed;
using std::memory_order_consume;
using std::memory_order_acquire;
using std::memory_order_release;
using std::memory_order_acq_rel;
using std::memory_order_seq_cst;
using std::atomic_flag;
using std::atomic_bool;
using std::atomic_char;
using std::atomic_schar;
using std::atomic_uchar;
using std::atomic_short;
using std::atomic_ushort;
using std::atomic_int;
using std::atomic_uint;
using std::atomic_long;
using std::atomic_ulong;
using std::atomic_llong;
using std::atomic_ullong;
using std::atomic_wchar_t;
using std::atomic_char16_t;
using std::atomic_char32_t;
using std::atomic_address;
using std::atomic;
#endif
#endif
......@@ -26,196 +26,12 @@
* This is a Standard C++ Library header.
*/
#include <bits/c++config.h>
#include <stddef.h>
#include <stdbool.h> // XXX need to define bool w/o stdbool.h in tr1/cstdbool
#include <bits/atomic_base.h>
#ifndef _GLIBCXX_STDATOMIC_H
#define _GLIBCXX_STDATOMIC_H 1
_GLIBCXX_BEGIN_NAMESPACE(std)
_GLIBCXX_BEGIN_EXTERN_C
/**
* @defgroup atomics Atomics
*
* Components for performing atomic operations.
* @{
*/
/// Enumeration for memory_order
typedef enum memory_order
{
memory_order_relaxed,
memory_order_consume,
memory_order_acquire,
memory_order_release,
memory_order_acq_rel,
memory_order_seq_cst
} memory_order;
// Base for atomic_flag.
typedef struct __atomic_flag_base
{
bool _M_i;
} __atomic_flag_base;
#define ATOMIC_FLAG_INIT { false }
/// 29.2 Lock-free Property
#if defined(_GLIBCXX_ATOMIC_BUILTINS_1) && defined(_GLIBCXX_ATOMIC_BUILTINS_2) \
&& defined(_GLIBCXX_ATOMIC_BUILTINS_4) && defined(_GLIBCXX_ATOMIC_BUILTINS_8)
# define _GLIBCXX_ATOMIC_PROPERTY 2
# define _GLIBCXX_ATOMIC_NAMESPACE __atomic2
#elif defined(_GLIBCXX_ATOMIC_BUILTINS_1)
# define _GLIBCXX_ATOMIC_PROPERTY 1
# define _GLIBCXX_ATOMIC_NAMESPACE __atomic1
#else
# define _GLIBCXX_ATOMIC_PROPERTY 0
# define _GLIBCXX_ATOMIC_NAMESPACE __atomic0
#endif
#define ATOMIC_INTEGRAL_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
#define ATOMIC_ADDRESS_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
// Switch atomic integral base types based on C or C++. In
// addition, for "C" only provide type-generic macros for atomic
// operations. (As C++ accomplishes the same thing with sets of
// overloaded functions.
#ifdef __cplusplus
inline namespace _GLIBCXX_ATOMIC_NAMESPACE { }
# include <bits/atomicfwd_cxx.h>
#else
# include <bits/atomicfwd_c.h>
#endif
// Typedefs for other atomic integral types.
typedef atomic_schar atomic_int_least8_t;
typedef atomic_uchar atomic_uint_least8_t;
typedef atomic_short atomic_int_least16_t;
typedef atomic_ushort atomic_uint_least16_t;
typedef atomic_int atomic_int_least32_t;
typedef atomic_uint atomic_uint_least32_t;
typedef atomic_llong atomic_int_least64_t;
typedef atomic_ullong atomic_uint_least64_t;
typedef atomic_schar atomic_int_fast8_t;
typedef atomic_uchar atomic_uint_fast8_t;
typedef atomic_short atomic_int_fast16_t;
typedef atomic_ushort atomic_uint_fast16_t;
typedef atomic_int atomic_int_fast32_t;
typedef atomic_uint atomic_uint_fast32_t;
typedef atomic_llong atomic_int_fast64_t;
typedef atomic_ullong atomic_uint_fast64_t;
typedef atomic_long atomic_intptr_t;
typedef atomic_ulong atomic_uintptr_t;
typedef atomic_long atomic_ssize_t;
typedef atomic_ulong atomic_size_t;
typedef atomic_llong atomic_intmax_t;
typedef atomic_ullong atomic_uintmax_t;
typedef atomic_long atomic_ptrdiff_t;
// Accessor functions for base atomic_flag type.
bool
atomic_flag_test_and_set_explicit(volatile __atomic_flag_base*, memory_order) _GLIBCXX_NOTHROW;
inline bool
atomic_flag_test_and_set(volatile __atomic_flag_base* __a)
{ return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); }
void
atomic_flag_clear_explicit(volatile __atomic_flag_base*, memory_order) _GLIBCXX_NOTHROW;
inline void
atomic_flag_clear(volatile __atomic_flag_base* __a)
{ atomic_flag_clear_explicit(__a, memory_order_seq_cst); }
void
__atomic_flag_wait_explicit(volatile __atomic_flag_base*, memory_order) _GLIBCXX_NOTHROW;
_GLIBCXX_CONST volatile __atomic_flag_base*
__atomic_flag_for_address(const volatile void* __z) _GLIBCXX_NOTHROW;
// Implementation specific defines.
#define _ATOMIC_LOAD_(__a, __x) \
({ volatile __typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
volatile atomic_flag* __g = __atomic_flag_for_address(__p); \
__atomic_flag_wait_explicit(__g, __x); \
__typeof__ _ATOMIC_MEMBER_ __r = *__p; \
atomic_flag_clear_explicit(__g, __x); \
__r; })
#define _ATOMIC_STORE_(__a, __m, __x) \
({ volatile __typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
__typeof__(__m) __v = (__m); \
volatile atomic_flag* __g = __atomic_flag_for_address(__p); \
__atomic_flag_wait_explicit(__g, __x); \
*__p = __v; \
atomic_flag_clear_explicit(__g, __x); \
__v; })
#define _ATOMIC_MODIFY_(__a, __o, __m, __x) \
({ volatile __typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
__typeof__(__m) __v = (__m); \
volatile atomic_flag* __g = __atomic_flag_for_address(__p); \
__atomic_flag_wait_explicit(__g, __x); \
__typeof__ _ATOMIC_MEMBER_ __r = *__p; \
*__p __o __v; \
atomic_flag_clear_explicit(__g, __x); \
__r; })
#define _ATOMIC_CMPEXCHNG_(__a, __e, __m, __x) \
({ volatile __typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
__typeof__(__e) __q = (__e); \
__typeof__(__m) __v = (__m); \
bool __r; \
volatile atomic_flag* __g = __atomic_flag_for_address(__p); \
__atomic_flag_wait_explicit(__g, __x); \
__typeof__ _ATOMIC_MEMBER_ __t__ = *__p; \
if (__t__ == *__q) { *__p = __v; __r = true; } \
else { *__q = __t__; __r = false; } \
atomic_flag_clear_explicit(__g, __x); \
__r; })
// @} group atomics
_GLIBCXX_END_EXTERN_C
_GLIBCXX_END_NAMESPACE
// Inject into global namespace.
#ifdef __cplusplus
#include <cstdatomic>
using std::memory_order;
using std::memory_order_relaxed;
using std::memory_order_consume;
using std::memory_order_acquire;
using std::memory_order_release;
using std::memory_order_acq_rel;
using std::memory_order_seq_cst;
using std::atomic_flag;
using std::atomic_bool;
using std::atomic_char;
using std::atomic_schar;
using std::atomic_uchar;
using std::atomic_short;
using std::atomic_ushort;
using std::atomic_int;
using std::atomic_uint;
using std::atomic_long;
using std::atomic_ulong;
using std::atomic_llong;
using std::atomic_ullong;
using std::atomic_wchar_t;
using std::atomic_char16_t;
using std::atomic_char32_t;
using std::atomic_address;
using std::atomic;
#ifdef _GLIBCXX_NAMESPACE_C
#endif
#endif
......@@ -53,7 +53,6 @@
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdatomic>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
......@@ -97,6 +96,7 @@
#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
......
......@@ -41,7 +41,7 @@
#include <condition_variable>
#include <system_error>
#include <exception>
#include <cstdatomic>
#include <atomic>
#include <bits/functexcept.h>
namespace std
......
......@@ -24,7 +24,7 @@
// <http://www.gnu.org/licenses/>.
#include "gstdint.h"
#include <cstdatomic>
#include <atomic>
#include <mutex>
#define LOGSIZE 4
......@@ -40,7 +40,7 @@ namespace
}
#endif
std::__atomic_flag_base volatile flag_table[ 1 << LOGSIZE ] =
std::__atomic_flag_base flag_table[ 1 << LOGSIZE ] =
{
ATOMIC_FLAG_INIT, ATOMIC_FLAG_INIT, ATOMIC_FLAG_INIT, ATOMIC_FLAG_INIT,
ATOMIC_FLAG_INIT, ATOMIC_FLAG_INIT, ATOMIC_FLAG_INIT, ATOMIC_FLAG_INIT,
......@@ -54,7 +54,7 @@ namespace std
namespace __atomic0
{
bool
atomic_flag::test_and_set(memory_order) volatile
atomic_flag::test_and_set(memory_order)
{
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
lock_guard<mutex> __lock(get_atomic_mutex());
......@@ -65,7 +65,7 @@ namespace std
}
void
atomic_flag::clear(memory_order) volatile
atomic_flag::clear(memory_order)
{
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
lock_guard<mutex> __lock(get_atomic_mutex());
......@@ -77,31 +77,31 @@ namespace std
extern "C"
{
bool
atomic_flag_test_and_set_explicit(volatile __atomic_flag_base* __a,
atomic_flag_test_and_set_explicit(__atomic_flag_base* __a,
memory_order __m) throw ()
{
volatile atomic_flag* d = static_cast<volatile atomic_flag*>(__a);
atomic_flag* d = static_cast<volatile atomic_flag*>(__a);
return d->test_and_set(__m);
}
void
atomic_flag_clear_explicit(volatile __atomic_flag_base* __a,
atomic_flag_clear_explicit(__atomic_flag_base* __a,
memory_order __m) throw ()
{
volatile atomic_flag* d = static_cast<volatile atomic_flag*>(__a);
atomic_flag* d = static_cast<volatile atomic_flag*>(__a);
return d->clear(__m);
}
void
__atomic_flag_wait_explicit(volatile __atomic_flag_base* __a,
__atomic_flag_wait_explicit(__atomic_flag_base* __a,
memory_order __x) throw ()
{
while (atomic_flag_test_and_set_explicit(__a, __x))
{ };
}
volatile __atomic_flag_base*
__atomic_flag_for_address(const volatile void* __z) throw ()
__atomic_flag_base*
__atomic_flag_for_address(const void* __z) throw ()
{
uintptr_t __u = reinterpret_cast<uintptr_t>(__z);
__u += (__u >> 2) + (__u << 4);
......@@ -114,3 +114,24 @@ namespace std
}
} // extern "C"
} // namespace std
// XXX GLIBCXX_ABI Deprecated
// gcc-4.5.0
// <atomic> signature changes
// The rename syntax for default exported names is
// asm (".symver name1,exportedname@GLIBCXX_3.4")
// asm (".symver name2,exportedname@@GLIBCXX_3.4.5")
// In the future, GLIBCXX_ABI > 6 should remove all uses of
// _GLIBCXX_*_SYMVER macros in this file.
#define _GLIBCXX_ASM_SYMVER(cur, old, version) \
asm (".symver " #cur "," #old "@@" #version);
#if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \
&& defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE)
_GLIBCXX_ASM_SYMVER(_ZNSt9__atomic011atomic_flag5clearESt12memory_order, _ZNVSt9__atomic011atomic_flag5clearESt12memory_order, GLIBCXX_3.4.11)
_GLIBCXX_ASM_SYMVER(_ZNSt9__atomic011atomic_flag12test_and_setESt12memory_order, _ZNVSt9__atomic011atomic_flag12test_and_setESt12memory_order, GLIBCXX_3.4.11)
#endif
......@@ -33,9 +33,23 @@
namespace std
{
// gcc-4.4.0
// <mutex> exported std::lock_error
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
class lock_error : public exception
{
public:
virtual const char*
_GLIBCXX_CONST what() const throw();
};
const char*
lock_error::what() const throw()
{ return "std::lock_error"; }
#endif
// We need these due to the symbols exported since GLIBCXX_3.4.10.
// See libstdc++/41662 for details.
template<typename _Tp>
struct hash : public std::unary_function<_Tp, size_t>
{
......
......@@ -513,25 +513,6 @@ extern __attribute__((used, weak)) const void * const _ZTIPKe[4]
(void *) _ZTSPKe, (void *) 1L, (void *) _ZTIe };
#endif // _GLIBCXX_LONG_DOUBLE_COMPAT
// gcc-4.4.0
// <mutex> exported std::lock_error
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
namespace std
{
class lock_error : public exception
{
public:
virtual const char*
_GLIBCXX_CONST what() const throw();
};
const char*
lock_error::what() const throw()
{ return "std::lock_error"; }
}
#endif
#ifdef _GLIBCXX_SYMVER_DARWIN
#if (defined(__ppc__) || defined(__ppc64__)) && defined(PIC)
/* __eprintf shouldn't have been made visible from libstdc++, or
......
......@@ -18,8 +18,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
int main()
......@@ -30,19 +29,19 @@ int main()
}
// { dg-error "used here" "" { target *-*-* } 521 }
// { dg-error "deleted function" "" { target *-*-* } 239 }
// { dg-error "deleted function" "" { target *-*-* } 257 }
// { dg-error "deleted function" "" { target *-*-* } 275 }
// { dg-error "deleted function" "" { target *-*-* } 293 }
// { dg-error "deleted function" "" { target *-*-* } 311 }
// { dg-error "deleted function" "" { target *-*-* } 329 }
// { dg-error "deleted function" "" { target *-*-* } 347 }
// { dg-error "deleted function" "" { target *-*-* } 365 }
// { dg-error "deleted function" "" { target *-*-* } 383 }
// { dg-error "deleted function" "" { target *-*-* } 401 }
// { dg-error "deleted function" "" { target *-*-* } 419 }
// { dg-error "deleted function" "" { target *-*-* } 437 }
// { dg-error "deleted function" "" { target *-*-* } 455 }
// { dg-error "deleted function" "" { target *-*-* } 473 }
// { dg-error "deleted function" "" { target *-*-* } 491 }
// { dg-error "deleted function" "" { target *-*-* } 231 }
// { dg-error "deleted function" "" { target *-*-* } 249 }
// { dg-error "deleted function" "" { target *-*-* } 267 }
// { dg-error "deleted function" "" { target *-*-* } 285 }
// { dg-error "deleted function" "" { target *-*-* } 303 }
// { dg-error "deleted function" "" { target *-*-* } 321 }
// { dg-error "deleted function" "" { target *-*-* } 339 }
// { dg-error "deleted function" "" { target *-*-* } 357 }
// { dg-error "deleted function" "" { target *-*-* } 375 }
// { dg-error "deleted function" "" { target *-*-* } 393 }
// { dg-error "deleted function" "" { target *-*-* } 411 }
// { dg-error "deleted function" "" { target *-*-* } 429 }
// { dg-error "deleted function" "" { target *-*-* } 447 }
// { dg-error "deleted function" "" { target *-*-* } 465 }
// { dg-error "deleted function" "" { target *-*-* } 483 }
// { dg-excess-errors "In member function" }
......@@ -17,14 +17,13 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
int main()
{
__gnu_test::copy_list_initializable test;
__gnu_cxx::typelist::apply_generator(test, __gnu_test::atomics_tl(),
__gnu_cxx::typelist::apply_generator(test, __gnu_test::atomics_tl(),
__gnu_test::integral_types::type());
return 0;
}
......@@ -18,8 +18,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
int main()
......@@ -29,20 +28,20 @@ int main()
return 0;
}
// { dg-error "used here" "" { target *-*-* } 560 }
// { dg-error "deleted function" "" { target *-*-* } 238 }
// { dg-error "deleted function" "" { target *-*-* } 256 }
// { dg-error "deleted function" "" { target *-*-* } 274 }
// { dg-error "deleted function" "" { target *-*-* } 292 }
// { dg-error "deleted function" "" { target *-*-* } 310 }
// { dg-error "deleted function" "" { target *-*-* } 328 }
// { dg-error "deleted function" "" { target *-*-* } 346 }
// { dg-error "deleted function" "" { target *-*-* } 364 }
// { dg-error "deleted function" "" { target *-*-* } 382 }
// { dg-error "deleted function" "" { target *-*-* } 400 }
// { dg-error "deleted function" "" { target *-*-* } 418 }
// { dg-error "deleted function" "" { target *-*-* } 436 }
// { dg-error "deleted function" "" { target *-*-* } 454 }
// { dg-error "deleted function" "" { target *-*-* } 472 }
// { dg-error "deleted function" "" { target *-*-* } 490 }
// { dg-error "used here" "" { target *-*-* } 560 }
// { dg-error "deleted function" "" { target *-*-* } 248 }
// { dg-error "deleted function" "" { target *-*-* } 266 }
// { dg-error "deleted function" "" { target *-*-* } 284 }
// { dg-error "deleted function" "" { target *-*-* } 302 }
// { dg-error "deleted function" "" { target *-*-* } 320 }
// { dg-error "deleted function" "" { target *-*-* } 338 }
// { dg-error "deleted function" "" { target *-*-* } 356 }
// { dg-error "deleted function" "" { target *-*-* } 374 }
// { dg-error "deleted function" "" { target *-*-* } 230 }
// { dg-error "deleted function" "" { target *-*-* } 410 }
// { dg-error "deleted function" "" { target *-*-* } 428 }
// { dg-error "deleted function" "" { target *-*-* } 446 }
// { dg-error "deleted function" "" { target *-*-* } 464 }
// { dg-error "deleted function" "" { target *-*-* } 482 }
// { dg-error "deleted function" "" { target *-*-* } 392 }
// { dg-excess-errors "In member function" }
......@@ -17,8 +17,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
int main()
......
......@@ -17,14 +17,13 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
int main()
{
__gnu_test::direct_list_initializable test;
__gnu_cxx::typelist::apply_generator(test, __gnu_test::atomics_tl(),
__gnu_cxx::typelist::apply_generator(test, __gnu_test::atomics_tl(),
__gnu_test::integral_types::type());
return 0;
}
......@@ -17,14 +17,13 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
int main()
{
__gnu_test::single_value_constructible test;
__gnu_cxx::typelist::apply_generator(test, __gnu_test::atomics_tl(),
__gnu_cxx::typelist::apply_generator(test, __gnu_test::atomics_tl(),
__gnu_test::integral_types::type());
return 0;
}
// { dg-options "-std=gnu++0x" }
// { dg-do link { xfail *-*-* } }
// Copyright (C) 2009 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <atomic>
struct dwordp
{
int* p1;
int* p2;
};
void atomics()
{
std::atomic<dwordp> a;
bool b = a.is_lock_free(); // { dg-excess-errors "undefined reference to" }
}
int main()
{
atomics();
return 0;
}
......@@ -17,15 +17,14 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_hooks.h>
#include <testsuite_common_types.h>
int main()
{
__gnu_test::integral_assignable test;
__gnu_cxx::typelist::apply_generator(test, __gnu_test::atomics_tl(),
__gnu_cxx::typelist::apply_generator(test, __gnu_test::atomics_tl(),
__gnu_test::integral_types::type());
return 0;
}
......@@ -17,15 +17,14 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_hooks.h>
#include <testsuite_common_types.h>
int main()
{
__gnu_test::integral_convertable test;
__gnu_cxx::typelist::apply_generator(test, __gnu_test::atomics_tl(),
__gnu_cxx::typelist::apply_generator(test, __gnu_test::atomics_tl(),
__gnu_test::integral_types::type());
return 0;
}
......@@ -18,14 +18,14 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
void test01()
{
// Check for required base class.
__gnu_test::has_required_base_class test;
__gnu_cxx::typelist::apply_generator(test,
__gnu_test::atomic_integrals::type(),
__gnu_test::atomics_tl());
__gnu_cxx::typelist::apply_generator(test,
__gnu_test::atomic_integrals::type(),
__gnu_test::atomics_tl());
}
......@@ -18,10 +18,9 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// This file tests explicit instantiation of basic_string
#include <cstdatomic>
#include <atomic>
#include <testsuite_character.h>
template class std::atomic<__gnu_test::pod_char>;
......
......@@ -18,8 +18,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
int main()
{
......
......@@ -18,8 +18,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
void test01()
{
......@@ -29,5 +28,5 @@ void test01()
test_type t2;
t1 = t2;
}
// { dg-error "used here" "" { target *-*-* } 30 }
// { dg-excess-errors "deleted function" }
// { dg-error "used here" "" { target *-*-* } 29 }
// { dg-excess-errors "deleted function" }
......@@ -18,8 +18,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
void test01()
{
......@@ -28,5 +27,5 @@ void test01()
test_type t1;
test_type t2(t1);
}
// { dg-error "used here" "" { target *-*-* } 29 }
// { dg-excess-errors "deleted function" }
// { dg-error "used here" "" { target *-*-* } 28 }
// { dg-excess-errors "deleted function" }
......@@ -17,8 +17,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
int main()
{
......
......@@ -17,8 +17,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
int main()
{
......
......@@ -18,8 +18,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
void test01()
......
......@@ -18,8 +18,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
void test01()
......
......@@ -17,7 +17,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_hooks.h>
int main()
......
// { dg-options "-std=gnu++0x" }
// { dg-do compile }
// { dg-do compile }
// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
//
......@@ -18,8 +18,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
int main()
{
......
......@@ -18,8 +18,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
void test01()
{
......@@ -29,5 +28,5 @@ void test01()
test_type t2;
t1 = t2;
}
// { dg-error "used here" "" { target *-*-* } 30 }
// { dg-excess-errors "deleted function" }
// { dg-error "used here" "" { target *-*-* } 29 }
// { dg-excess-errors "deleted function" }
......@@ -18,8 +18,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
void test01()
{
......@@ -28,5 +27,5 @@ void test01()
test_type t1;
test_type t2(t1);
}
// { dg-error "used here" "" { target *-*-* } 29 }
// { dg-excess-errors "deleted function" }
// { dg-error "used here" "" { target *-*-* } 28 }
// { dg-excess-errors "deleted function" }
......@@ -17,8 +17,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
int main()
{
......
......@@ -18,8 +18,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
void test01()
......
......@@ -18,8 +18,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
void test01()
......
......@@ -17,7 +17,6 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <stdatomic.h>
int main()
......
......@@ -17,8 +17,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
int main()
{
......
......@@ -17,7 +17,6 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <stdatomic.h>
int main()
......
......@@ -17,8 +17,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
int main()
{
......
......@@ -18,24 +18,23 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
int main()
{
__gnu_test::assignable test;
__gnu_cxx::typelist::apply_generator(test,
__gnu_cxx::typelist::apply_generator(test,
__gnu_test::atomic_integrals::type());
return 0;
}
// { dg-error "used here" "" { target *-*-* } 521 }
// { dg-excess-errors "deleted function" }
// { dg-excess-errors "deleted function" }
// { dg-error "instantiated from" "" { target *-*-* } 29 }
// { dg-error "instantiated from" "" { target *-*-* } 528 }
// { dg-error "instantiated from" "" { target *-*-* } 170 }
// { dg-excess-errors "deleted function" }
// { dg-excess-errors "deleted function" }
// { dg-error "instantiated from" "" { target *-*-* } 28 }
// { dg-error "instantiated from" "" { target *-*-* } 528 }
// { dg-error "instantiated from" "" { target *-*-* } 170 }
// { dg-error "instantiated from" "" { target *-*-* } 399 }
// { dg-error "instantiated from" "" { target *-*-* } 168 }
// { dg-error "instantiated from" "" { target *-*-* } 168 }
// { dg-excess-errors "In member function" }
......@@ -17,8 +17,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
int main()
......
......@@ -18,24 +18,23 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
int main()
{
__gnu_test::copy_constructible test;
__gnu_cxx::typelist::apply_generator(test,
__gnu_cxx::typelist::apply_generator(test,
__gnu_test::atomic_integrals::type());
return 0;
}
// { dg-error "used here" "" { target *-*-* } 560 }
// { dg-excess-errors "deleted function" }
// { dg-excess-errors "deleted function" }
// { dg-error "instantiated from" "" { target *-*-* } 29 }
// { dg-error "instantiated from" "" { target *-*-* } 566 }
// { dg-error "instantiated from" "" { target *-*-* } 170 }
// { dg-excess-errors "deleted function" }
// { dg-excess-errors "deleted function" }
// { dg-error "instantiated from" "" { target *-*-* } 28 }
// { dg-error "instantiated from" "" { target *-*-* } 566 }
// { dg-error "instantiated from" "" { target *-*-* } 170 }
// { dg-error "instantiated from" "" { target *-*-* } 399 }
// { dg-error "instantiated from" "" { target *-*-* } 168 }
// { dg-error "instantiated from" "" { target *-*-* } 168 }
// { dg-excess-errors "In member function" }
......@@ -17,8 +17,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
int main()
......
......@@ -17,15 +17,14 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
int main()
{
__gnu_test::direct_list_initializable test;
__gnu_cxx::typelist::apply_generator(test,
__gnu_test::atomic_integrals::type(),
__gnu_cxx::typelist::apply_generator(test,
__gnu_test::atomic_integrals::type(),
__gnu_test::integral_types::type());
return 0;
}
......@@ -17,15 +17,14 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
int main()
{
__gnu_test::single_value_constructible test;
__gnu_cxx::typelist::apply_generator(test,
__gnu_test::atomic_integrals::type(),
__gnu_cxx::typelist::apply_generator(test,
__gnu_test::atomic_integrals::type(),
__gnu_test::integral_types::type());
return 0;
}
// { dg-options "-std=gnu++0x" }
// { dg-do compile }
// -*- C++ -*-
// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3, or (at
// your option) any later version.
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
int main()
......
// { dg-options "-std=gnu++0x" }
// { dg-do compile }
// -*- C++ -*-
// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3, or (at
// your option) any later version.
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
int main()
......
// { dg-options "-std=gnu++0x" }
// { dg-do compile }
// -*- C++ -*-
// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3, or (at
// your option) any later version.
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
int main()
......
// { dg-options "-std=gnu++0x" }
// { dg-do compile }
// -*- C++ -*-
// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3, or (at
// your option) any later version.
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
int main()
......
// { dg-options "-std=gnu++0x" }
// { dg-do compile }
// -*- C++ -*-
// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3, or (at
// your option) any later version.
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
int main()
......
// { dg-options "-std=gnu++0x" }
// { dg-do compile }
// -*- C++ -*-
// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3, or (at
// your option) any later version.
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
int main()
......
......@@ -17,8 +17,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_hooks.h>
#include <testsuite_common_types.h>
......@@ -26,7 +25,7 @@ int main()
{
__gnu_test::integral_assignable test;
__gnu_cxx::typelist::apply_generator(test,
__gnu_test::atomic_integrals::type(),
__gnu_test::atomic_integrals::type(),
__gnu_test::integral_types::type());
return 0;
}
......@@ -17,8 +17,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_hooks.h>
#include <testsuite_common_types.h>
......@@ -26,7 +25,7 @@ int main()
{
__gnu_test::integral_convertable test;
__gnu_cxx::typelist::apply_generator(test,
__gnu_test::atomic_integrals::type(),
__gnu_test::atomic_integrals::type(),
__gnu_test::integral_types::type());
return 0;
}
......@@ -19,13 +19,13 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
void test01()
{
// Check for standard layout requirements
__gnu_test::standard_layout test;
__gnu_cxx::typelist::apply_generator(test,
__gnu_cxx::typelist::apply_generator(test,
__gnu_test::atomic_integrals::type());
}
......@@ -18,13 +18,12 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
#include <testsuite_common_types.h>
void test01()
{
__gnu_test::has_trivial_cons_dtor test;
__gnu_cxx::typelist::apply_generator(test,
__gnu_cxx::typelist::apply_generator(test,
__gnu_test::atomic_integrals::type());
}
......@@ -18,7 +18,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
namespace gnu
{
......
......@@ -18,7 +18,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
namespace gnu
{
......
......@@ -18,7 +18,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic> // { dg-excess-errors "In file included from" }
#include <atomic> // { dg-excess-errors "In file included from" }
// { dg-error "upcoming ISO" "" { target *-*-* } 31 }
......
......@@ -18,7 +18,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <cstdatomic>
#include <atomic>
void test01()
{
......
// { dg-options "-std=gnu++0x" }
// { dg-do compile }
// Copyright (C) 2009 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <atomic>
void test01()
{
// Not global scoped, only namespace std.
using memory_order;
using memory_order_relaxed;
using memory_order_consume;
using memory_order_acquire;
using memory_order_release;
using memory_order_acq_rel;
using memory_order_seq_cst;
using atomic_flag;
using atomic_bool;
using atomic_char;
using atomic_schar;
using atomic_uchar;
using atomic_short;
using atomic_ushort;
using atomic_int;
using atomic_uint;
using atomic_long;
using atomic_ulong;
using atomic_llong;
using atomic_ullong;
using atomic_wchar_t;
using atomic_char16_t;
using atomic_char32_t;
using atomic_address;
}
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 26 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 27 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 28 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 29 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 30 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 31 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 32 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 34 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 36 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 37 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 38 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 39 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 40 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 41 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 42 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 43 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 44 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 45 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 46 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 47 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 48 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 49 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 50 }
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 52 }
......@@ -22,8 +22,8 @@
int main()
{
volatile atomic_flag f;
volatile atomic_flag* p = &f;
atomic_flag f;
atomic_flag* p = &f;
memory_order m = memory_order_relaxed;
// For position only.
......
......@@ -44,7 +44,7 @@
#include <tr1/unordered_set>
#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <cstdatomic>
#include <atomic>
#include <type_traits>
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment