[X86] avx512-pmovxrm.ll - replace X32 checks with X86. NFC.
[llvm-project.git] / libcxxabi / test / catch_member_pointer_nullptr.pass.cpp
blob70d3afc7c75e76837f98267312661fe3ff35acda
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 // Catching an exception thrown as nullptr was not properly handled before
10 // 2f984cab4fa7, which landed in macOS 10.13
11 // XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12}}
13 // UNSUPPORTED: no-exceptions
15 #include <cassert>
17 #if __has_feature(cxx_nullptr)
19 struct A
21 const int i;
22 int j;
25 typedef const int A::*md1;
26 typedef int A::*md2;
28 void test1()
30 try
32 throw nullptr;
33 assert(false);
35 catch (md2 p)
37 assert(!p);
39 catch (md1)
41 assert(false);
45 void test2()
47 try
49 throw nullptr;
50 assert(false);
52 catch (md1 p)
54 assert(!p);
56 catch (md2)
58 assert(false);
62 #else
64 void test1()
68 void test2()
72 #endif
74 int main(int, char**)
76 test1();
77 test2();
79 return 0;