]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/29_atomics/atomic_flag/clear/1.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 29_atomics / atomic_flag / clear / 1.cc
index 36dc5fcf4b6f6c2710008f8e6b5044b2812acc8b..c22910dd06d42834711d278f27a37eccf38978ce 100644 (file)
@@ -1,6 +1,7 @@
-// { dg-options "-std=gnu++0x" }
+// { dg-do run { target c++11 } }
+// { dg-require-atomic-cmpxchg-word "" }
 
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009-2024 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
 
 int main()
 {
-  bool test __attribute__((unused)) = true;
   std::atomic_flag f = ATOMIC_FLAG_INIT;
 
-  f.clear(); // set to false
+  f.clear();                           // set to false
+  VERIFY( false == f.test_and_set() ); // return true
+  VERIFY( true == f.test_and_set() );  // return true
+  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;
 }