annotate libcxxabi/test/cxa_thread_atexit_test.pass.cpp @ 181:df311c476dd5

CreateIdentifierInfo in ParseCbC (not yet worked)
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 31 May 2020 12:30:11 +0900
parents 1d019706d866
children 2e18cbf3894f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 //===--------------------- cxa_thread_atexit_test.cpp ---------------------===//
anatofuz
parents:
diff changeset
2 //
anatofuz
parents:
diff changeset
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
anatofuz
parents:
diff changeset
4 // See https://llvm.org/LICENSE.txt for license information.
anatofuz
parents:
diff changeset
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
anatofuz
parents:
diff changeset
6 //
anatofuz
parents:
diff changeset
7 //===----------------------------------------------------------------------===//
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 // UNSUPPORTED: libcxxabi-no-threads
anatofuz
parents:
diff changeset
10 // REQUIRES: linux
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 #include <assert.h>
anatofuz
parents:
diff changeset
13 #include <cxxabi.h>
anatofuz
parents:
diff changeset
14
anatofuz
parents:
diff changeset
15 static bool AtexitImplCalled = false;
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 extern "C" int __cxa_thread_atexit_impl(void (*dtor)(void *), void *obj,
anatofuz
parents:
diff changeset
18 void *dso_symbol) {
anatofuz
parents:
diff changeset
19 assert(dtor == reinterpret_cast<void (*)(void *)>(1));
anatofuz
parents:
diff changeset
20 assert(obj == reinterpret_cast<void *>(2));
anatofuz
parents:
diff changeset
21 assert(dso_symbol == reinterpret_cast<void *>(3));
anatofuz
parents:
diff changeset
22 AtexitImplCalled = true;
anatofuz
parents:
diff changeset
23 return 4;
anatofuz
parents:
diff changeset
24 }
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 int main() {
anatofuz
parents:
diff changeset
27 int RV = __cxxabiv1::__cxa_thread_atexit(
anatofuz
parents:
diff changeset
28 reinterpret_cast<void (*)(void *)>(1), reinterpret_cast<void *>(2),
anatofuz
parents:
diff changeset
29 reinterpret_cast<void *>(3));
anatofuz
parents:
diff changeset
30 assert(RV == 4);
anatofuz
parents:
diff changeset
31 assert(AtexitImplCalled);
anatofuz
parents:
diff changeset
32 return 0;
anatofuz
parents:
diff changeset
33 }