[X86] avx512-pmovxrm.ll - replace X32 checks with X86. NFC.
[llvm-project.git] / libcxxabi / test / cxa_thread_atexit_test.pass.cpp
blobd641591697b3c785c2af9163be972ec0d3e5e1c2
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 // UNSUPPORTED: no-threads
10 // REQUIRES: linux
12 #include <assert.h>
13 #include <cxxabi.h>
15 static bool AtexitImplCalled = false;
17 extern "C" int __cxa_thread_atexit_impl(void (*dtor)(void *), void *obj,
18 void *dso_symbol) {
19 assert(dtor == reinterpret_cast<void (*)(void *)>(1));
20 assert(obj == reinterpret_cast<void *>(2));
21 assert(dso_symbol == reinterpret_cast<void *>(3));
22 AtexitImplCalled = true;
23 return 4;
26 int main(int, char**) {
27 int RV = __cxxabiv1::__cxa_thread_atexit(
28 reinterpret_cast<void (*)(void *)>(1), reinterpret_cast<void *>(2),
29 reinterpret_cast<void *>(3));
30 assert(RV == 4);
31 assert(AtexitImplCalled);
32 return 0;