[Openmp-commits] [openmp] [llvm] [clang] [OpenMP] Rework handling of global ctor/dtors in OpenMP (PR #71739)

Johannes Doerfert via Openmp-commits openmp-commits at lists.llvm.org
Fri Nov 10 10:27:41 PST 2023


================
@@ -0,0 +1,37 @@
+// RUN: %libomptarget-compilexx-run-and-check-generic
+
+// REQUIRES: libc
+
+#include <stdio.h>
+
+#pragma omp begin declare target device_type(nohost)
+
+// CHECK: void ctor1()
+// CHECK: void ctor2()
+// CHECK: void ctor3()
+[[gnu::constructor(101)]] void ctor1() { puts(__PRETTY_FUNCTION__); }
+[[gnu::constructor(102)]] void ctor2() { puts(__PRETTY_FUNCTION__); }
+[[gnu::constructor(103)]] void ctor3() { puts(__PRETTY_FUNCTION__); }
----------------
jdoerfert wrote:

put the 103 priority between 101 and 102 to actually test sorting.

https://github.com/llvm/llvm-project/pull/71739


More information about the Openmp-commits mailing list