2021-11-17 16:25:01 -05:00
|
|
|
//===----------------------------------------------------------------------===//
|
2011-12-06 18:01:47 +00:00
|
|
|
//
|
2019-01-19 10:56:40 +00:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2011-12-06 18:01:47 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2023-09-08 09:51:03 -04:00
|
|
|
// UNSUPPORTED: c++03
|
2011-07-20 14:53:53 +00:00
|
|
|
|
2023-09-08 09:51:03 -04:00
|
|
|
#include "assert_macros.h"
|
|
|
|
#include "concat_macros.h"
|
2019-08-12 19:11:23 +00:00
|
|
|
#include "../src/cxa_exception.h"
|
2011-07-20 14:53:53 +00:00
|
|
|
|
2023-09-08 09:51:03 -04:00
|
|
|
int main(int, char**) {
|
|
|
|
void* globals = __cxxabiv1::__cxa_get_globals();
|
|
|
|
TEST_REQUIRE(globals != nullptr, TEST_WRITE_CONCATENATED("Got null result from __cxa_get_globals"));
|
2022-05-09 11:54:10 -04:00
|
|
|
|
2023-09-08 09:51:03 -04:00
|
|
|
void* fast_globals = __cxxabiv1::__cxa_get_globals_fast();
|
|
|
|
TEST_REQUIRE(globals == fast_globals, TEST_WRITE_CONCATENATED("__cxa_get_globals returned ", globals,
|
|
|
|
" but __cxa_get_globals_fast returned ", fast_globals));
|
2011-07-20 14:53:53 +00:00
|
|
|
|
2023-09-08 09:51:03 -04:00
|
|
|
return 0;
|
2016-09-21 09:09:32 +00:00
|
|
|
}
|