[clang] [Clang](NFC) Add coverage for VTable debug info (PR #151818)

Jeremy Morse via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 28 10:16:06 PDT 2025


================
@@ -0,0 +1,87 @@
+// For CTemplate we check in case of:
+// - Implicitly instantiate whole class by up-casting:
+//   * The vtable is generated with comdat
+//   * Its '_vtable$' is generated
+// - Implicitly instantiate member function only:
+//   * The vtable is NOT generated
+//   * Its '_vtable$' is generated
+// - Define explicitly instantiation:
+//   * The vtable is generated with comdat
+//   * Its '_vtable$' is generated
+// - Declare explicitly instantiation as extern:
+//  # for COFF targets:
+//   * The vtable is declared but NOT associated with '_vtable$'
+//  # for non-COFF targets:
+//   * The vtable is declared
+//   * Its '_vtable$' is generated
----------------
jmorse wrote:

To confirm my understanding -- what's interesting here is that the _vtable$ variable is generated in various scenarios where the vtable itself isn't generated -- thus the test is checking that _vtable$ references are generated for an external symbol?

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


More information about the cfe-commits mailing list