annotate libcxxabi/test/catch_in_noexcept.pass.cpp @ 192:d7606dcf6fce

Added tag llvm10 for changeset 0572611fdcc8
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 14 Dec 2020 18:01:34 +0900
parents 0572611fdcc8
children 2e18cbf3894f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 //===---------------------- catch_in_noexcept.cpp--------------------------===//
anatofuz
parents:
diff changeset
2 //
anatofuz
parents:
diff changeset
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
anatofuz
parents:
diff changeset
4 // See https://llvm.org/LICENSE.txt for license information.
anatofuz
parents:
diff changeset
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
anatofuz
parents:
diff changeset
6 //
anatofuz
parents:
diff changeset
7 //===----------------------------------------------------------------------===//
anatofuz
parents:
diff changeset
8
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
9 // UNSUPPORTED: c++98, c++03
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
10 // UNSUPPORTED: no-exceptions
150
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 #include <exception>
anatofuz
parents:
diff changeset
13 #include <stdlib.h>
anatofuz
parents:
diff changeset
14 #include <assert.h>
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 struct A {};
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 // Despite being marked as noexcept, this function must have an EHT entry that
anatofuz
parents:
diff changeset
19 // is not 'cantunwind', so that the unwinder can correctly deal with the throw.
anatofuz
parents:
diff changeset
20 void f1() noexcept
anatofuz
parents:
diff changeset
21 {
anatofuz
parents:
diff changeset
22 try {
anatofuz
parents:
diff changeset
23 A a;
anatofuz
parents:
diff changeset
24 throw a;
anatofuz
parents:
diff changeset
25 assert(false);
anatofuz
parents:
diff changeset
26 } catch (...) {
anatofuz
parents:
diff changeset
27 assert(true);
anatofuz
parents:
diff changeset
28 return;
anatofuz
parents:
diff changeset
29 }
anatofuz
parents:
diff changeset
30 assert(false);
anatofuz
parents:
diff changeset
31 }
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33 int main()
anatofuz
parents:
diff changeset
34 {
anatofuz
parents:
diff changeset
35 f1();
anatofuz
parents:
diff changeset
36 }