URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/tags/gnu-dev/fsf-gcc-snapshot-1-mar-12/or1k-gcc/libstdc++-v3/testsuite/29_atomics
- from Rev 742 to Rev 783
- ↔ Reverse comparison
Rev 742 → Rev 783
/atomic_integral/cons/assign_neg.cc
0,0 → 1,33
// { dg-options "-std=gnu++0x" } |
// { dg-do compile } |
|
// Copyright (C) 2008, 2009, 2010, 2011 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> |
#include <testsuite_common_types.h> |
|
int main() |
{ |
__gnu_test::assignable test; |
__gnu_cxx::typelist::apply_generator(test, |
__gnu_test::atomic_integrals::type()); |
return 0; |
} |
|
// { dg-error "deleted" "" { target *-*-* } 616 } |
// { dg-prune-output "include" } |
/atomic_integral/cons/single_value.cc
0,0 → 1,30
// { dg-options "-std=gnu++0x" } |
|
// 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. |
|
// 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> |
#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_test::integral_types::type()); |
return 0; |
} |
/atomic_integral/cons/copy_neg.cc
0,0 → 1,33
// { dg-options "-std=gnu++0x" } |
// { dg-do compile } |
|
// Copyright (C) 2008, 2009, 2010, 2011 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> |
#include <testsuite_common_types.h> |
|
int main() |
{ |
__gnu_test::copy_constructible test; |
__gnu_cxx::typelist::apply_generator(test, |
__gnu_test::atomic_integrals::type()); |
return 0; |
} |
|
// { dg-error "deleted" "" { target *-*-* } 655 } |
// { dg-prune-output "include" } |
/atomic_integral/cons/default.cc
0,0 → 1,29
// { dg-options "-std=gnu++0x" } |
|
// 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. |
|
// 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> |
#include <testsuite_common_types.h> |
|
int main() |
{ |
__gnu_test::default_constructible test; |
__gnu_cxx::typelist::apply_generator(test, |
__gnu_test::atomic_integrals::type()); |
return 0; |
} |
/atomic_integral/cons/copy_list.cc
0,0 → 1,30
// { dg-options "-std=gnu++0x" } |
|
// 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. |
|
// 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> |
#include <testsuite_common_types.h> |
|
int main() |
{ |
__gnu_test::copy_list_initializable test; |
__gnu_cxx::typelist::apply_generator(test, |
__gnu_test::atomic_integrals::type(), |
__gnu_test::integral_types::type()); |
return 0; |
} |
/atomic_integral/cons/constexpr.cc
0,0 → 1,31
// { dg-do compile } |
// { dg-options "-std=gnu++0x" } |
|
// Copyright (C) 2010 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> |
#include <testsuite_common_types.h> |
|
int main() |
{ |
__gnu_test::constexpr_single_value_constructible test; |
__gnu_cxx::typelist::apply_generator(test, |
__gnu_test::atomic_integrals::type(), |
__gnu_test::integral_types::type()); |
return 0; |
} |
/atomic_integral/cons/direct_list.cc
0,0 → 1,30
// { dg-options "-std=gnu++0x" } |
|
// 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. |
|
// 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> |
#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_test::integral_types::type()); |
return 0; |
} |
/atomic_integral/requirements/standard_layout.cc
0,0 → 1,31
// { dg-options "-std=gnu++0x" } |
// { dg-do compile } |
// 2008-10-22 Benjamin Kosnik <bkoz@redhat.com> |
|
// 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. |
|
// 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> |
#include <testsuite_common_types.h> |
|
void test01() |
{ |
// Check for standard layout requirements |
__gnu_test::standard_layout test; |
__gnu_cxx::typelist::apply_generator(test, |
__gnu_test::atomic_integrals::type()); |
} |
/atomic_integral/requirements/trivial.cc
0,0 → 1,29
// { 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> |
#include <testsuite_common_types.h> |
|
void test01() |
{ |
__gnu_test::has_trivial_cons_dtor test; |
__gnu_cxx::typelist::apply_generator(test, |
__gnu_test::atomic_integrals::type()); |
} |
/atomic_integral/operators/increment_neg.cc
0,0 → 1,33
// { dg-options "-std=gnu++0x" } |
// { dg-do compile } |
// -*- C++ -*- |
|
// Copyright (C) 2008, 2009, 2010, 2011 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 <atomic> |
#include <testsuite_common_types.h> |
|
int main() |
{ |
__gnu_test::has_increment_operators test; |
test.operator()<std::atomic_bool>(); |
return 0; |
} |
|
// { dg-error "operator" "" { target *-*-* } 407 } |
// { dg-error "operator" "" { target *-*-* } 408 } |
// { dg-error "operator" "" { target *-*-* } 409 } |
/atomic_integral/operators/integral_assignment.cc
0,0 → 1,31
// { dg-options "-std=gnu++0x" } |
|
// 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. |
|
// 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> |
#include <testsuite_hooks.h> |
#include <testsuite_common_types.h> |
|
int main() |
{ |
__gnu_test::integral_assignable test; |
__gnu_cxx::typelist::apply_generator(test, |
__gnu_test::atomic_integrals::type(), |
__gnu_test::integral_types::type()); |
return 0; |
} |
/atomic_integral/operators/bitwise_neg.cc
0,0 → 1,36
// { dg-options "-std=gnu++0x" } |
// { dg-do compile } |
// -*- C++ -*- |
|
// Copyright (C) 2008, 2009, 2010, 2011 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 <atomic> |
#include <testsuite_common_types.h> |
|
int main() |
{ |
__gnu_test::bitwise_assignment_operators<std::atomic_bool>(); |
return 0; |
} |
|
// { dg-error "deleted" "" { target *-*-* } 470 } |
// { dg-error "deleted" "" { target *-*-* } 471 } |
// { dg-error "operator" "" { target *-*-* } 472 } |
// { dg-error "operator" "" { target *-*-* } 473 } |
// { dg-error "operator" "" { target *-*-* } 474 } |
|
// { dg-prune-output "declared here" } |
/atomic_integral/operators/decrement_neg.cc
0,0 → 1,33
// { dg-options "-std=gnu++0x" } |
// { dg-do compile } |
// -*- C++ -*- |
|
// Copyright (C) 2008, 2009, 2010, 2011 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 <atomic> |
#include <testsuite_common_types.h> |
|
int main() |
{ |
__gnu_test::has_decrement_operators test; |
test.operator()<std::atomic_bool>(); |
return 0; |
} |
|
// { dg-error "operator" "" { target *-*-* } 429 } |
// { dg-error "operator" "" { target *-*-* } 430 } |
// { dg-error "operator" "" { target *-*-* } 431 } |
/atomic_integral/operators/increment.cc
0,0 → 1,29
// { 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 <atomic> |
#include <testsuite_common_types.h> |
|
int main() |
{ |
__gnu_test::has_increment_operators test; |
using __gnu_test::atomic_integrals_no_bool; |
__gnu_cxx::typelist::apply_generator(test, atomic_integrals_no_bool::type()); |
}; |
/atomic_integral/operators/decrement.cc
0,0 → 1,29
// { 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 <atomic> |
#include <testsuite_common_types.h> |
|
int main() |
{ |
__gnu_test::has_decrement_operators test; |
using __gnu_test::atomic_integrals_no_bool; |
__gnu_cxx::typelist::apply_generator(test, atomic_integrals_no_bool::type()); |
}; |
/atomic_integral/operators/bitwise.cc
0,0 → 1,29
// { 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 <atomic> |
#include <testsuite_common_types.h> |
|
int main() |
{ |
__gnu_test::has_bitwise_operators test; |
using __gnu_test::atomic_integrals_no_bool; |
__gnu_cxx::typelist::apply_generator(test, atomic_integrals_no_bool::type()); |
}; |
/atomic_integral/operators/integral_conversion.cc
0,0 → 1,31
// { dg-options "-std=gnu++0x" } |
|
// 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. |
|
// 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> |
#include <testsuite_hooks.h> |
#include <testsuite_common_types.h> |
|
int main() |
{ |
__gnu_test::integral_convertable test; |
__gnu_cxx::typelist::apply_generator(test, |
__gnu_test::atomic_integrals::type(), |
__gnu_test::integral_types::type()); |
return 0; |
} |
/atomic_flag/cons/assign_neg.cc
0,0 → 1,32
// { dg-options "-std=gnu++0x" } |
// { dg-do compile } |
|
// 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. |
|
// 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() |
{ |
// Assign. |
typedef std::atomic_flag test_type; |
test_type t1; |
test_type t2; |
t1 = t2; // { dg-error "deleted" } |
} |
|
// { dg-prune-output "include" } |
/atomic_flag/cons/1.cc
0,0 → 1,27
// { dg-options "-std=gnu++0x" } |
// { dg-do compile } |
|
// Copyright (C) 2008, 2009, 2010 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() |
{ |
using namespace std; |
atomic_flag af __attribute__((unused)) = ATOMIC_FLAG_INIT; |
} |
/atomic_flag/cons/copy_neg.cc
0,0 → 1,31
// { dg-options "-std=gnu++0x" } |
// { dg-do compile } |
|
// 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. |
|
// 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() |
{ |
// Copy. |
typedef std::atomic_flag test_type; |
test_type t1; |
test_type t2(t1); // { dg-error "deleted" } |
} |
|
// { dg-prune-output "include" } |
/atomic_flag/cons/default.cc
0,0 → 1,27
// { dg-options "-std=gnu++0x" } |
|
// 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. |
|
// 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> |
|
int main() |
{ |
// Default constructor. |
std::atomic_flag a __attribute__((unused)); |
return 0; |
} |
/atomic_flag/cons/aggregate.cc
0,0 → 1,28
// { dg-options "-std=gnu++0x" } |
// { dg-do compile } |
|
// 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. |
|
// 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> |
|
int main() |
{ |
// Only safe usage. |
std::atomic_flag guard __attribute__((unused)) = ATOMIC_FLAG_INIT; |
return 0; |
} |
/atomic_flag/requirements/standard_layout.cc
0,0 → 1,28
// { dg-options "-std=gnu++0x" } |
// { dg-do compile } |
|
// 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. |
|
// 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> |
#include <testsuite_common_types.h> |
|
void test01() |
{ |
__gnu_test::standard_layout test; |
test.operator()<std::atomic_flag>(); |
} |
/atomic_flag/requirements/trivial.cc
0,0 → 1,28
// { 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> |
#include <testsuite_common_types.h> |
|
void test01() |
{ |
__gnu_test::has_trivial_cons_dtor test; |
test.operator()<std::atomic_flag>(); |
} |
/atomic_flag/clear/1.cc
0,0 → 1,33
// { dg-options "-std=gnu++0x" } |
|
// 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> |
#include <testsuite_hooks.h> |
|
int main() |
{ |
bool test __attribute__((unused)) = true; |
std::atomic_flag f = ATOMIC_FLAG_INIT; |
|
f.clear(); // set to false |
VERIFY( false == f.test_and_set() ); // return previous false, set to true |
VERIFY( true == f.test_and_set() ); // return true |
|
return 0; |
} |
/atomic_flag/test_and_set/explicit.cc
0,0 → 1,31
// { dg-options "-std=gnu++0x" } |
|
// 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. |
|
// 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> |
|
int main() |
{ |
using namespace std; |
atomic_flag af = ATOMIC_FLAG_INIT; |
|
if (!af.test_and_set(memory_order_acquire)) |
af.clear(memory_order_release); |
|
return 0; |
} |
/atomic_flag/test_and_set/implicit.cc
0,0 → 1,31
// { dg-options "-std=gnu++0x" } |
|
// 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. |
|
// 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> |
|
int main() |
{ |
using namespace std; |
atomic_flag af = ATOMIC_FLAG_INIT; |
|
if (!af.test_and_set()) |
af.clear(); |
|
return 0; |
} |
/headers/atomic/types_std_c++0x.cc
0,0 → 1,75
// { dg-options "-std=gnu++0x" } |
// { dg-do compile } |
|
// Copyright (C) 2008, 2009, 2010, 2011 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() |
{ |
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; |
|
// atomics for builtins types |
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; |
|
// atomics for standard typedefs |
using std::atomic_int_least8_t; |
using std::atomic_uint_least8_t; |
using std::atomic_int_least16_t; |
using std::atomic_uint_least16_t; |
using std::atomic_int_least32_t; |
using std::atomic_uint_least32_t; |
using std::atomic_int_least64_t; |
using std::atomic_uint_least64_t; |
using std::atomic_int_fast8_t; |
using std::atomic_uint_fast8_t; |
using std::atomic_int_fast16_t; |
using std::atomic_uint_fast16_t; |
using std::atomic_int_fast32_t; |
using std::atomic_uint_fast32_t; |
using std::atomic_int_fast64_t; |
using std::atomic_uint_fast64_t; |
using std::atomic_intptr_t; |
using std::atomic_uintptr_t; |
using std::atomic_size_t; |
using std::atomic_ptrdiff_t; |
using std::atomic_intmax_t; |
using std::atomic_uintmax_t; |
} |
/headers/atomic/functions_std_c++0x.cc
0,0 → 1,49
// { dg-options "-std=gnu++0x" } |
// { dg-do compile } |
|
// 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. |
|
// 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> |
|
namespace gnu |
{ |
using std::atomic_flag_test_and_set; |
using std::atomic_flag_test_and_set_explicit; |
using std::atomic_flag_clear; |
using std::atomic_flag_clear_explicit; |
|
using std::kill_dependency; |
|
// Sloppy testing for integral types (en masse). |
using std::atomic_is_lock_free; |
using std::atomic_store; |
using std::atomic_store_explicit; |
using std::atomic_load; |
using std::atomic_load_explicit; |
using std::atomic_exchange; |
using std::atomic_exchange_explicit; |
using std::atomic_compare_exchange_weak; |
using std::atomic_compare_exchange_strong; |
using std::atomic_compare_exchange_weak_explicit; |
using std::atomic_compare_exchange_strong_explicit; |
|
using std::atomic_fetch_add; |
using std::atomic_fetch_add_explicit; |
using std::atomic_fetch_sub; |
using std::atomic_fetch_sub_explicit; |
} |
/headers/atomic/std_c++0x_neg.cc
0,0 → 1,26
// { dg-do compile } |
// { dg-options "-std=gnu++98" } |
|
// 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. |
|
// 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> // { dg-excess-errors "In file included from" } |
|
// { dg-error "ISO C.. 2011" "" { target *-*-* } 32 } |
|
|
|
/headers/atomic/macros.cc
0,0 → 1,115
// { dg-options "-std=gnu++0x" } |
// { dg-do compile } |
|
// Copyright (C) 2008, 2009, 2010 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> |
|
#ifndef ATOMIC_BOOL_LOCK_FREE |
# error "ATOMIC_BOOL_LOCK_FREE must be a macro" |
#endif |
|
#ifndef ATOMIC_CHAR_LOCK_FREE |
# error "ATOMIC_CHAR_LOCK_FREE must be a macro" |
#endif |
|
#ifndef ATOMIC_CHAR16_T_LOCK_FREE |
# error "ATOMIC_CHAR16_T_LOCK_FREE must be a macro" |
#endif |
|
#ifndef ATOMIC_CHAR32_T_LOCK_FREE |
# error "ATOMIC_CHAR32_T_LOCK_FREE must be a macro" |
#endif |
|
#ifndef ATOMIC_WCHAR_T_LOCK_FREE |
# error "ATOMIC_WCHAR_T_LOCK_FREE must be a macro" |
#endif |
|
#ifndef ATOMIC_SHORT_LOCK_FREE |
# error "ATOMIC_SHORT_LOCK_FREE must be a macro" |
#endif |
|
#ifndef ATOMIC_INT_LOCK_FREE |
# error "ATOMIC_INT_LOCK_FREE must be a macro" |
#endif |
|
#ifndef ATOMIC_LONG_LOCK_FREE |
# error "ATOMIC_LONG_LOCK_FREE must be a macro" |
#endif |
|
#ifndef ATOMIC_LLONG_LOCK_FREE |
# error "ATOMIC_LLONG_LOCK_FREE must be a macro" |
#endif |
|
#ifndef ATOMIC_POINTER_LOCK_FREE |
# error "ATOMIC_POINTER_LOCK_FREE must be a macro" |
#endif |
|
#ifndef ATOMIC_FLAG_INIT |
#error "ATOMIC_FLAG_INIT_must_be_a_macro" |
#endif |
|
#ifndef ATOMIC_VAR_INIT |
#error "ATOMIC_VAR_INIT_must_be_a_macro" |
#endif |
|
|
extern void abort(void); |
|
int main () |
{ |
#if (ATOMIC_BOOL_LOCK_FREE != 1 && ATOMIC_BOOL_LOCK_FREE != 2) |
abort (); |
#endif |
|
#if (ATOMIC_CHAR_LOCK_FREE != 1 && ATOMIC_CHAR_LOCK_FREE != 2) |
abort (); |
#endif |
|
#if (ATOMIC_CHAR16_T_LOCK_FREE != 1 && ATOMIC_CHAR16_T_LOCK_FREE != 2) |
abort (); |
#endif |
|
#if (ATOMIC_CHAR32_T_LOCK_FREE != 1 && ATOMIC_CHAR32_T_LOCK_FREE != 2) |
abort (); |
#endif |
|
#if (ATOMIC_WCHAR_T_LOCK_FREE != 1 && ATOMIC_WCHAR_T_LOCK_FREE != 2) |
abort (); |
#endif |
|
#if (ATOMIC_SHORT_LOCK_FREE != 1 && ATOMIC_SHORT_LOCK_FREE != 2) |
abort (); |
#endif |
|
#if (ATOMIC_INT_LOCK_FREE != 1 && ATOMIC_INT_LOCK_FREE != 2) |
abort (); |
#endif |
|
#if (ATOMIC_LONG_LOCK_FREE != 1 && ATOMIC_LONG_LOCK_FREE != 2) |
abort (); |
#endif |
|
#if (ATOMIC_LLONG_LOCK_FREE != 1 && ATOMIC_LLONG_LOCK_FREE != 2) |
abort (); |
#endif |
|
#if (ATOMIC_POINTER_LOCK_FREE != 1 && ATOMIC_POINTER_LOCK_FREE != 2) |
abort (); |
#endif |
} |
/headers/atomic/types_std_c++0x_neg.cc
0,0 → 1,170
// { dg-options "-std=gnu++0x" } |
// { dg-do compile } |
|
// Copyright (C) 2009, 2010 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_int_least8_t; |
using atomic_uint_least8_t; |
using atomic_int_least16_t; |
using atomic_uint_least16_t; |
using atomic_int_least32_t; |
using atomic_uint_least32_t; |
using atomic_int_least64_t; |
using atomic_uint_least64_t; |
using atomic_int_fast8_t; |
using atomic_uint_fast8_t; |
using atomic_int_fast16_t; |
using atomic_uint_fast16_t; |
using atomic_int_fast32_t; |
using atomic_uint_fast32_t; |
using atomic_int_fast64_t; |
using atomic_uint_fast64_t; |
using atomic_intptr_t; |
using atomic_uintptr_t; |
using atomic_size_t; |
using atomic_ptrdiff_t; |
using atomic_intmax_t; |
using atomic_uintmax_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 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 53 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 54 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 55 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 56 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 57 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 58 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 59 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 60 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 61 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 62 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 63 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 64 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 65 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 66 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 67 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 68 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 69 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 70 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 71 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 72 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 73 } |
// { dg-error "expected nested-name-specifier" "" { target *-*-* } 75 } |
|
// { dg-error "declared" "" { target *-*-* } 26 } |
// { dg-error "declared" "" { target *-*-* } 27 } |
// { dg-error "declared" "" { target *-*-* } 28 } |
// { dg-error "declared" "" { target *-*-* } 29 } |
// { dg-error "declared" "" { target *-*-* } 30 } |
// { dg-error "declared" "" { target *-*-* } 31 } |
// { dg-error "declared" "" { target *-*-* } 32 } |
// { dg-error "declared" "" { target *-*-* } 34 } |
// { dg-error "declared" "" { target *-*-* } 36 } |
// { dg-error "declared" "" { target *-*-* } 37 } |
// { dg-error "declared" "" { target *-*-* } 38 } |
// { dg-error "declared" "" { target *-*-* } 39 } |
// { dg-error "declared" "" { target *-*-* } 40 } |
// { dg-error "declared" "" { target *-*-* } 41 } |
// { dg-error "declared" "" { target *-*-* } 42 } |
// { dg-error "declared" "" { target *-*-* } 43 } |
// { dg-error "declared" "" { target *-*-* } 44 } |
// { dg-error "declared" "" { target *-*-* } 45 } |
// { dg-error "declared" "" { target *-*-* } 46 } |
// { dg-error "declared" "" { target *-*-* } 47 } |
// { dg-error "declared" "" { target *-*-* } 48 } |
// { dg-error "declared" "" { target *-*-* } 49 } |
// { dg-error "declared" "" { target *-*-* } 50 } |
// { dg-error "declared" "" { target *-*-* } 52 } |
// { dg-error "declared" "" { target *-*-* } 53 } |
// { dg-error "declared" "" { target *-*-* } 54 } |
// { dg-error "declared" "" { target *-*-* } 55 } |
// { dg-error "declared" "" { target *-*-* } 56 } |
// { dg-error "declared" "" { target *-*-* } 57 } |
// { dg-error "declared" "" { target *-*-* } 58 } |
// { dg-error "declared" "" { target *-*-* } 59 } |
// { dg-error "declared" "" { target *-*-* } 60 } |
// { dg-error "declared" "" { target *-*-* } 61 } |
// { dg-error "declared" "" { target *-*-* } 62 } |
// { dg-error "declared" "" { target *-*-* } 63 } |
// { dg-error "declared" "" { target *-*-* } 64 } |
// { dg-error "declared" "" { target *-*-* } 65 } |
// { dg-error "declared" "" { target *-*-* } 66 } |
// { dg-error "declared" "" { target *-*-* } 67 } |
// { dg-error "declared" "" { target *-*-* } 68 } |
// { dg-error "declared" "" { target *-*-* } 69 } |
// { dg-error "declared" "" { target *-*-* } 70 } |
// { dg-error "declared" "" { target *-*-* } 71 } |
// { dg-error "declared" "" { target *-*-* } 72 } |
// { dg-error "declared" "" { target *-*-* } 73 } |
// { dg-error "declared" "" { target *-*-* } 75 } |
/atomic/cons/single_value.cc
0,0 → 1,29
// { dg-options "-std=gnu++0x" } |
|
// 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. |
|
// 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> |
#include <testsuite_common_types.h> |
|
int main() |
{ |
__gnu_test::single_value_constructible test; |
__gnu_cxx::typelist::apply_generator(test, __gnu_test::atomics_tl(), |
__gnu_test::integral_types::type()); |
return 0; |
} |
/atomic/cons/assign_neg.cc
0,0 → 1,32
// { dg-options "-std=gnu++0x" } |
// { dg-do compile } |
|
// Copyright (C) 2008, 2009, 2010, 2011 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> |
#include <testsuite_common_types.h> |
|
int main() |
{ |
__gnu_test::assignable test; |
__gnu_cxx::typelist::apply_generator(test, __gnu_test::atomics_tl()); |
return 0; |
} |
|
// { dg-error "deleted" "" { target *-*-* } 616 } |
// { dg-prune-output "include" } |
/atomic/cons/user_pod.cc
0,0 → 1,39
// { dg-options "-std=gnu++0x" } |
// { dg-do link } |
|
// Copyright (C) 2009, 2011 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 __attribute__((unused)) = a.is_lock_free(); |
} |
|
int main() |
{ |
atomics(); |
return 0; |
} |
/atomic/cons/copy_neg.cc
0,0 → 1,32
// { dg-options "-std=gnu++0x" } |
// { dg-do compile } |
|
// Copyright (C) 2008, 2009, 2010, 2011 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> |
#include <testsuite_common_types.h> |
|
int main() |
{ |
__gnu_test::copy_constructible test; |
__gnu_cxx::typelist::apply_generator(test, __gnu_test::atomics_tl()); |
return 0; |
} |
|
// { dg-error "deleted" "" { target *-*-* } 655 } |
// { dg-prune-output "include" } |
/atomic/cons/default.cc
0,0 → 1,28
// { dg-options "-std=gnu++0x" } |
|
// 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. |
|
// 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> |
#include <testsuite_common_types.h> |
|
int main() |
{ |
__gnu_test::default_constructible test; |
__gnu_cxx::typelist::apply_generator(test, __gnu_test::atomics_tl()); |
return 0; |
} |
/atomic/cons/direct_list.cc
0,0 → 1,29
// { dg-options "-std=gnu++0x" } |
|
// 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. |
|
// 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> |
#include <testsuite_common_types.h> |
|
int main() |
{ |
__gnu_test::direct_list_initializable test; |
__gnu_cxx::typelist::apply_generator(test, __gnu_test::atomics_tl(), |
__gnu_test::integral_types::type()); |
return 0; |
} |
/atomic/cons/copy_list.cc
0,0 → 1,29
// { dg-options "-std=gnu++0x" } |
|
// 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. |
|
// 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> |
#include <testsuite_common_types.h> |
|
int main() |
{ |
__gnu_test::copy_list_initializable test; |
__gnu_cxx::typelist::apply_generator(test, __gnu_test::atomics_tl(), |
__gnu_test::integral_types::type()); |
return 0; |
} |
/atomic/cons/constexpr.cc
0,0 → 1,32
// { dg-do compile } |
// { dg-options "-std=gnu++0x" } |
|
// Copyright (C) 2010 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> |
#include <testsuite_common_types.h> |
|
int main() |
{ |
__gnu_test::constexpr_single_value_constructible test; |
|
// test.operator()<std::atomic<int>, int>(); |
__gnu_cxx::typelist::apply_generator(test, __gnu_test::atomics_tl(), |
__gnu_test::integral_types::type()); |
return 0; |
} |
/atomic/cons/49445.cc
0,0 → 1,42
// { dg-options "-std=gnu++0x" } |
|
// Copyright (C) 2012 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> |
|
enum class tacos : int |
{ |
cancun = 4, |
el_loco = 5, |
sabor = 6, |
papalote = 9, |
licious = 44, |
jarritos = 55 |
}; |
|
// should minimally compile and link |
int main() |
{ |
std::atomic<float> af(0.0f); |
float non_af = af; |
|
std::atomic<tacos> ae(tacos::sabor); |
tacos non_ae = ae; |
|
return 0; |
} |
/atomic/requirements/explicit_instantiation/1.cc
0,0 → 1,27
// { dg-options "-std=gnu++0x" } |
// { dg-do compile } |
|
// 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. |
|
// 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/>. |
|
// This file tests explicit instantiation of basic_string |
|
#include <atomic> |
#include <testsuite_character.h> |
|
template class std::atomic<__gnu_test::pod_state>; |
template class std::atomic<__gnu_test::pod_char*>; |
/atomic/requirements/base_classes.cc
0,0 → 1,31
// { dg-options "-std=gnu++0x" } |
// { dg-do compile } |
|
// Copyright (C) 2008, 2009 Free Software Foundation |
// |
// 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> |
#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()); |
} |
/atomic/operators/integral_assignment.cc
0,0 → 1,30
// { dg-options "-std=gnu++0x" } |
|
// 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. |
|
// 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> |
#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_test::integral_types::type()); |
return 0; |
} |
/atomic/operators/pointer_partial_void.cc
0,0 → 1,71
// { dg-require-atomic-builtins "" } |
// { dg-options "-std=gnu++0x" } |
|
// Copyright (C) 2012 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> |
#include <cstdlib> //std::abs |
#include <testsuite_hooks.h> |
|
// pointer arithimetic vs. atomic<void*>. |
// atomic<void*> vs. explicitly specialized w/o operators, like atomic_bool? |
int main(void) |
{ |
// bool test __attribute__((unused)) = true; |
|
using namespace std; |
|
typedef int value_type; |
const size_t n = 2; |
value_type value = 42; |
value_type* p = &value; |
void* vp = p; |
ptrdiff_t dist(0); |
|
atomic<void*> a(vp); |
|
// operator++ |
void* vp2(a); |
a++; |
void* vp3(a); |
dist = reinterpret_cast<char*>(vp2) - reinterpret_cast<char*>(vp3); |
// VERIFY ( std::abs(dist) == sizeof(void*)); |
|
// operator-- |
void* vp4(a); |
a--; |
void* vp5(a); |
dist = reinterpret_cast<char*>(vp4) - reinterpret_cast<char*>(vp5); |
// VERIFY ( std::abs(dist) == sizeof(void*)); |
|
// operator+= |
void* vp6(a); |
a+=n; |
void* vp7(a); |
dist = reinterpret_cast<char*>(vp6) - reinterpret_cast<char*>(vp7); |
// VERIFY ( std::abs(dist) == sizeof(void*) * n); |
|
// operator-= |
void* vp8(a); |
a-=n; |
void* vp9(a); |
dist = reinterpret_cast<char*>(vp8) - reinterpret_cast<char*>(vp9); |
//VERIFY ( std::abs(dist) == sizeof(void*) * n); |
|
return 0; |
} |
/atomic/operators/51811.cc
0,0 → 1,91
// { dg-require-atomic-builtins "" } |
// { dg-options "-std=gnu++0x" } |
|
// Copyright (C) 2012 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> |
#include <cstdlib> //std::abs |
#include <testsuite_hooks.h> |
|
// libstdc++/51811 |
// pointer arithimetic vs. atomic<_Tp*> specialization |
int main(void) |
{ |
bool test __attribute__((unused)) = true; |
|
using namespace std; |
|
typedef int value_type; |
const size_t n = 2; |
value_type value = 42; |
atomic<value_type*> p, p2, p3; |
|
// operator++ |
{ |
p = &value; |
p2 = p++; |
VERIFY (p != p2); |
|
value_type* vp(p); |
value_type* vp2(p2); |
ptrdiff_t dist = reinterpret_cast<char*>(vp) - reinterpret_cast<char*>(vp2); |
VERIFY ( std::abs(dist) == sizeof(value_type)); |
|
p = &value; |
p3 = ++p; |
VERIFY (p == p3); |
} |
|
// operator-- |
{ |
p = &value; |
p2 = p--; |
VERIFY (p != p2); |
|
value_type* vp(p); |
value_type* vp2(p2); |
ptrdiff_t dist = reinterpret_cast<char*>(vp) - reinterpret_cast<char*>(vp2); |
VERIFY ( std::abs(dist) == sizeof(value_type)); |
|
p = &value; |
p3 = --p; |
VERIFY (p == p3); |
} |
|
// operator+= |
{ |
p = &value; |
value_type* vp(p); |
p+=n; |
value_type* vp2(p); |
ptrdiff_t dist = reinterpret_cast<char*>(vp) - reinterpret_cast<char*>(vp2); |
VERIFY ( std::abs(dist) == sizeof(value_type) * n); |
} |
|
// operator-= |
{ |
p = &value; |
value_type* vp(p); |
p-=n; |
value_type* vp2(p); |
ptrdiff_t dist = reinterpret_cast<char*>(vp) - reinterpret_cast<char*>(vp2); |
VERIFY ( std::abs(dist) == sizeof(value_type) * n); |
} |
|
return 0; |
} |
/atomic/operators/integral_conversion.cc
0,0 → 1,30
// { dg-options "-std=gnu++0x" } |
|
// 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. |
|
// 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> |
#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_test::integral_types::type()); |
return 0; |
} |