[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / libcxxabi / test / catch_array_02.pass.cpp
blobf92749adba18bad8c16718852afaf402579b00a6
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 // Can you have a catch clause of array type that catches anything?
10 // UNSUPPORTED: no-exceptions
12 #include <cassert>
14 int main(int, char**)
16 typedef char Array[4];
17 Array a = {'H', 'i', '!', 0};
18 try
20 throw a; // converts to char*
21 assert(false);
23 catch (Array b) // equivalent to char*
26 catch (...)
28 assert(false);
31 return 0;