| 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 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | // UNSUPPORTED: c++03 |
| 10 | |
| 11 | #include "assert_macros.h" |
| 12 | #include "concat_macros.h" |
| 13 | #include "../src/cxa_exception.h" |
| 14 | |
| 15 | int main(int, char**) { |
| 16 | void* globals = __cxxabiv1::__cxa_get_globals(); |
| 17 | TEST_REQUIRE(globals != nullptr, TEST_WRITE_CONCATENATED("Got null result from __cxa_get_globals" )); |
| 18 | |
| 19 | void* fast_globals = __cxxabiv1::__cxa_get_globals_fast(); |
| 20 | TEST_REQUIRE(globals == fast_globals, TEST_WRITE_CONCATENATED("__cxa_get_globals returned " , globals, |
| 21 | " but __cxa_get_globals_fast returned " , fast_globals)); |
| 22 | |
| 23 | return 0; |
| 24 | } |
| 25 | |