csetjmp.pass.cpp 703 B

12345678910111213141516171819202122232425
  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. // test <csetjmp>
  10. #include <csetjmp>
  11. #include <type_traits>
  12. #ifndef setjmp
  13. #error setjmp not defined
  14. #endif
  15. int main()
  16. {
  17. std::jmp_buf jb;
  18. ((void)jb); // Prevent unused warning
  19. static_assert((std::is_same<decltype(std::longjmp(jb, 0)), void>::value),
  20. "std::is_same<decltype(std::longjmp(jb, 0)), void>::value");
  21. }