tests: Add C versions of gen-ust-events-constructor
[lttng-tools.git] / tests / utils / testapp / gen-ust-events-constructor / main_c-so.c
diff --git a/tests/utils/testapp/gen-ust-events-constructor/main_c-so.c b/tests/utils/testapp/gen-ust-events-constructor/main_c-so.c
new file mode 100644 (file)
index 0000000..70ee49b
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2024 Kienan Stewart <kstewart@efficios.com>
+ *
+ * SPDX-LIcense-Identifier: LGPL-2.1-only
+ */
+
+#include "tp-so_c.h"
+#include "tp.h"
+
+/* Use tracepoints defined and provided by shared libraries. */
+void test_constructor_so(void) __attribute__((constructor));
+void test_constructor_so(void)
+{
+       tracepoint(tp_so_c, constructor_c_provider_shared_library);
+}
+
+void test_destructor_so(void) __attribute__((destructor));
+void test_destructor_so(void)
+{
+       tracepoint(tp_so_c, destructor_c_provider_shared_library);
+}
+
+int main(void)
+{
+       tracepoint(tp, main);
+       return 0;
+}
This page took 0.023465 seconds and 4 git commands to generate.