blob: 3c938012bdf53bc6e6df6e97ea148d54cb078dcb [file] [log] [blame]
Howard Hinnant3e519522010-05-11 19:42:16 +00001//===----------------------------------------------------------------------===//
2//
Chandler Carruth57b08b02019-01-19 10:56:40 +00003// 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
Howard Hinnant3e519522010-05-11 19:42:16 +00006//
7//===----------------------------------------------------------------------===//
8
9// test <setjmp.h>
10
11#include <setjmp.h>
12#include <type_traits>
13
Marshall Clow7fc6a552019-05-31 18:35:30 +000014#include "test_macros.h"
15
Richard Smith38a2a282015-10-08 20:41:26 +000016#ifndef setjmp
17#error setjmp not defined
18#endif
19
JF Bastien2df59c52019-02-04 20:31:13 +000020int main(int, char**)
Howard Hinnant3e519522010-05-11 19:42:16 +000021{
22 jmp_buf jb;
Eric Fiselierfb42f4c2016-05-02 19:15:48 +000023 ((void)jb); // Prevent unused warning
Marshall Clow79e23cb2014-10-21 15:07:09 +000024 static_assert((std::is_same<decltype(longjmp(jb, 0)), void>::value),
25 "std::is_same<decltype(longjmp(jb, 0)), void>::value");
JF Bastien2df59c52019-02-04 20:31:13 +000026
27 return 0;
Howard Hinnant3e519522010-05-11 19:42:16 +000028}