Mercurial > hg > CbC > CbC_llvm
comparison libcxxabi/test/test_aux_runtime_op_array_new.pass.cpp @ 207:2e18cbf3894f
LLVM12
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Jun 2021 06:07:14 +0900 |
parents | 0572611fdcc8 |
children | 5f17cb93ff66 |
comparison
equal
deleted
inserted
replaced
173:0572611fdcc8 | 207:2e18cbf3894f |
---|---|
6 // | 6 // |
7 //===----------------------------------------------------------------------===// | 7 //===----------------------------------------------------------------------===// |
8 | 8 |
9 // UNSUPPORTED: no-exceptions | 9 // UNSUPPORTED: no-exceptions |
10 | 10 |
11 #include <iostream> | 11 // ___cxa_throw_bad_array_new_length is re-exported from libc++ only starting |
12 // in macosx 10.15 | |
13 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.14 | |
14 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.13 | |
15 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.12 | |
16 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.11 | |
17 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.10 | |
18 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.9 | |
19 | |
12 #include <cxxabi.h> | 20 #include <cxxabi.h> |
21 #include <new> | |
13 | 22 |
14 // If the expression passed to operator new[] would result in an overflow, the | 23 // If the expression passed to operator new[] would result in an overflow, the |
15 // allocation function is not called, and a std::bad_array_new_length exception | 24 // allocation function is not called, and a std::bad_array_new_length exception |
16 // is thrown instead (5.3.4p7). | 25 // is thrown instead (5.3.4p7). |
17 bool bad_array_new_length_test() { | 26 bool bad_array_new_length_test() { |
25 return true; | 34 return true; |
26 } | 35 } |
27 return false; | 36 return false; |
28 } | 37 } |
29 | 38 |
30 int main() { | 39 int main(int, char**) { |
31 int ret_val = 0; | 40 int ret_val = 0; |
32 | 41 |
33 if ( !bad_array_new_length_test ()) { | 42 if ( !bad_array_new_length_test ()) { |
34 std::cerr << "Bad array new length test failed!" << std::endl; | |
35 ret_val = 1; | 43 ret_val = 1; |
36 } | 44 } |
37 | 45 |
38 return ret_val; | 46 return ret_val; |
39 } | 47 } |