blob: 02fecda495de38b757265ff751644d89b5a7c193 [file] [log] [blame]
Jonathan Roelofs20f6f452014-05-31 00:25:59 +00001//===---------------------- catch_in_noexcept.cpp--------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include <exception>
11#include <stdlib.h>
12#include <assert.h>
13
14struct A {};
15
16// Despite being marked as noexcept, this function must have an EHT entry that
17// is not 'cantunwind', so that the unwinder can correctly deal with the throw.
18void f1() noexcept
19{
20 try {
21 A a;
22 throw a;
23 assert(false);
24 } catch (...) {
25 assert(true);
26 return;
27 }
28 assert(false);
29}
30
31int main()
32{
33 f1();
34}