[PATCH] D123220: [clang] Verify internal entity module mangling

Nathan Sidwell via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 7 05:41:14 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG9eda5fc0c6ea: [clang] Verify internal entity module mangling (authored by urnathan).
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Changed prior to commit:
  https://reviews.llvm.org/D123220?vs=420841&id=421170#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123220/new/

https://reviews.llvm.org/D123220

Files:
  clang/test/CodeGenCXX/cxx20-module-internal.cppm


Index: clang/test/CodeGenCXX/cxx20-module-internal.cppm
===================================================================
--- /dev/null
+++ clang/test/CodeGenCXX/cxx20-module-internal.cppm
@@ -0,0 +1,46 @@
+// RUN: %clang_cc1 -std=c++20 %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
+
+// internal-linkage symbol mangling is implementation defined.  Let's
+// not mangle in the module attachment -- that unnecessarily bloats
+// the symbols.
+
+export module A;
+
+// CHECK-DAG: void @_ZL6addonev(
+static void addone() {}
+// CHECK-DAG: @_ZL1x =
+static int x = 5;
+
+namespace {
+// CHECK-DAG: void @_ZN12_GLOBAL__N_14frobEv(
+void frob() {}
+// CHECK-DAG: @_ZN12_GLOBAL__N_11yE =
+int y = 2;
+struct Bill {
+  void F();
+};
+// CHECK-DAG: void @_ZN12_GLOBAL__N_14Bill1FEv(
+void Bill::F() {}
+} // namespace
+
+// CHECK-DAG: void @_ZL4FrobPN12_GLOBAL__N_14BillE(
+static void Frob(Bill *b) {
+  if (b)
+    b->F();
+}
+
+namespace N {
+// CHECK-DAG: void @_ZN1NL5innerEv(
+static void inner() {}
+// CHECK-DAG: @_ZN1NL1zE
+static int z = 3;
+} // namespace N
+
+// CHECK-DAG: void @_ZW1A6addsixv(
+void addsix() {
+  Frob(nullptr);
+  frob();
+  addone();
+  void(x + y + N::z);
+  N::inner();
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123220.421170.patch
Type: text/x-patch
Size: 1218 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220407/39684775/attachment.bin>


More information about the cfe-commits mailing list