| 1 | /* |
| 2 | * Copyright (C) 2024 Kienan Stewart <kstewart@efficios.com> |
| 3 | * |
| 4 | * SPDX-License-Identifier: LPGL-2.1-only |
| 5 | */ |
| 6 | |
| 7 | #include "obj-a.h" |
| 8 | #include "tp-a.h" |
| 9 | extern "C" { |
| 10 | #include "tp-a_c.h" |
| 11 | } |
| 12 | #include "tp.h" |
| 13 | |
| 14 | /* Use tracepoints defined and provided by static archive. */ |
| 15 | void test_constructor_a() __attribute__((constructor)); |
| 16 | void test_constructor_a() |
| 17 | { |
| 18 | tracepoint(tp_a_c, constructor_c_provider_static_archive); |
| 19 | } |
| 20 | |
| 21 | void test_destructor_a() __attribute__((destructor)); |
| 22 | void test_destructor_a() |
| 23 | { |
| 24 | tracepoint(tp_a_c, destructor_c_provider_static_archive); |
| 25 | } |
| 26 | |
| 27 | Obja g_obja_static_archive("global - static archive define and provider"); |
| 28 | |
| 29 | int main() |
| 30 | { |
| 31 | const Obj l_obj("main() local"); |
| 32 | const Obja l_obja("main() local - static archive define and provider"); |
| 33 | |
| 34 | tracepoint(tp, main); |
| 35 | return 0; |
| 36 | } |