[clang] [clang-repl] Test explicit emission of dtors in runtime interface builder (NFC) (PR #89734)

Vassil Vassilev via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 23 04:33:19 PDT 2024


================
@@ -0,0 +1,13 @@
+// UNSUPPORTED: system-aix
+
+// RUN: cat %s | clang-repl | FileCheck %s
+int *x = new int();
+template <class T> struct GuardX { T *&x; GuardX(T *&x) : x(x) {}; ~GuardX(); };
+template <class T> GuardX<T>::~GuardX() { delete x; x = nullptr; }
+
+// clang would normally defer codegen for ~GuardX()
+// Make sure that RuntimeInterfaceBuilder requests it explicitly
+(GuardX(x))
+
+// CHECK-NOT: Symbols not found
+// CHECK-NOT: _ZN6GuardXIiED2Ev
----------------
vgvassilev wrote:

How about a printf in the dtor?

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


More information about the cfe-commits mailing list