atomic.version.pass.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is dual licensed under the MIT and the University of Illinois Open
  6. // Source Licenses. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //
  10. // <atomic> feature macros
  11. /* Constant Value
  12. __cpp_lib_atomic_is_always_lock_free 201603L
  13. __cpp_lib_atomic_ref 201806L
  14. */
  15. #include <atomic>
  16. #include "test_macros.h"
  17. int main()
  18. {
  19. // ensure that the macros that are supposed to be defined in <atomic> are defined.
  20. #if _TEST_STD_VER > 14
  21. # if !defined(__cpp_lib_atomic_is_always_lock_free)
  22. # error "__cpp_lib_atomic_is_always_lock_free is not defined"
  23. # elif __cpp_lib_atomic_is_always_lock_free < 201603L
  24. # error "__cpp_lib_atomic_is_always_lock_free has an invalid value"
  25. # endif
  26. #endif
  27. /*
  28. #if !defined(__cpp_lib_fooby)
  29. # error "__cpp_lib_fooby is not defined"
  30. #elif __cpp_lib_fooby < 201606L
  31. # error "__cpp_lib_fooby has an invalid value"
  32. #endif
  33. */
  34. }