1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // MSVC warning C4611: interaction between '_setjmp' and C++ object destruction is non-portable
10 // ADDITIONAL_COMPILE_FLAGS(cl-style-warnings): /wd4611
16 #include <type_traits>
18 int main(int, char**) {
22 // First time we set the buffer, the function should return 0
26 // If it returned 42, then we're coming from the std::longjmp call below
30 // Otherwise, something is wrong
36 static_assert(std::is_same
<decltype(std::longjmp(jb
, 0)), void>::value
, "");