[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / language.support / support.runtime / csetjmp.pass.cpp
blob5e23a4a21eb791d6a560ac29f34299ae6db889a3
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 //===----------------------------------------------------------------------===//
9 // MSVC warning C4611: interaction between '_setjmp' and C++ object destruction is non-portable
10 // ADDITIONAL_COMPILE_FLAGS(cl-style-warnings): /wd4611
12 // test <csetjmp>
14 #include <csetjmp>
15 #include <cassert>
16 #include <type_traits>
18 int main(int, char**) {
19 std::jmp_buf jb;
21 switch (setjmp(jb)) {
22 // First time we set the buffer, the function should return 0
23 case 0:
24 break;
26 // If it returned 42, then we're coming from the std::longjmp call below
27 case 42:
28 return 0;
30 // Otherwise, something is wrong
31 default:
32 return 1;
35 std::longjmp(jb, 42);
36 static_assert(std::is_same<decltype(std::longjmp(jb, 0)), void>::value, "");
38 return 1;