tests: test_ust_constructor: Split test_ust_constructor binary
[lttng-tools.git] / tests / utils / testapp / gen-ust-events-constructor / main-a.cpp
diff --git a/tests/utils/testapp/gen-ust-events-constructor/main-a.cpp b/tests/utils/testapp/gen-ust-events-constructor/main-a.cpp
new file mode 100644 (file)
index 0000000..118ce66
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2024 Kienan Stewart <kstewart@efficios.com>
+ *
+ * SPDX-License-Identifier: LPGL-2.1-only
+ */
+
+#include "obj-a.h"
+#include "tp-a.h"
+extern "C" {
+#include "tp-a_c.h"
+}
+#include "tp.h"
+
+/* Use tracepoints defined and provided by static archive. */
+void test_constructor_a(void) __attribute__((constructor));
+void test_constructor_a(void)
+{
+       tracepoint(tp_a_c, constructor_c_provider_static_archive);
+}
+
+void test_destructor_a(void) __attribute__((destructor));
+void test_destructor_a(void)
+{
+       tracepoint(tp_a_c, destructor_c_provider_static_archive);
+}
+
+Obja g_obja_static_archive("global - static archive define and provider");
+
+int main(void)
+{
+       Obj l_obj("main() local");
+       Obja l_obja("main() local - static archive define and provider");
+
+       tracepoint(tp, main);
+       return 0;
+}
This page took 0.023795 seconds and 4 git commands to generate.