assign.pass.cpp 739 B

1234567891011121314151617181920212223242526272829303132
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // UNSUPPORTED: libcpp-has-no-threads
  10. // <thread>
  11. // class thread::id
  12. // id& operator=(const id&) = default;
  13. #include <thread>
  14. #include <cassert>
  15. #include "test_macros.h"
  16. int main(int, char**)
  17. {
  18. std::thread::id id0;
  19. std::thread::id id1;
  20. id1 = id0;
  21. assert(id1 == id0);
  22. id1 = std::this_thread::get_id();
  23. assert(id1 != id0);
  24. return 0;
  25. }