csetjmp.pass.cpp 766 B

12345678910111213141516171819202122232425262728
  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. // test <csetjmp>
  9. #include <csetjmp>
  10. #include <type_traits>
  11. #include "test_macros.h"
  12. #ifndef setjmp
  13. #error setjmp not defined
  14. #endif
  15. int main(int, char**)
  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. return 0;
  22. }