[clang] [KeyInstr][Clang] Copy ctor/assignment operator source atoms (PR #144346)

Jeremy Morse via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 26 02:49:01 PDT 2025


================
@@ -0,0 +1,59 @@
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions %s -gno-column-info -debug-info-kind=line-tables-only -emit-llvm -o - \
+// RUN: | FileCheck %s
+
+// g::h and i can be memcpy'd, check the assignment gets Key Instructions metadata.
+
+struct e {
+  e(e &);
+  e& operator=(const e&);
+};
+
+struct g {
+  e f;
+  int h;
+  int i;
+};
+
+// Copy assignment operator.
+// CHECK: define{{.*}}ptr @_ZN1gaSERKS_
----------------
jmorse wrote:

This'll trip on Windows machines IMO, there's a `%clang_cc1` macro that ensures you're targetting an Itanium ABI I think?

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


More information about the cfe-commits mailing list