[PATCH] D158538: [MS-ABI] Remove comdat attribute for inheriting ctor.
Reid Kleckner via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 28 13:10:58 PDT 2023
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.
lgtm with some tweaks to the test.
================
Comment at: clang/test/CodeGenCXX/ms-inheriting-ctor.cpp:41
+
+// CHECK-LABEL: define internal noundef ptr @"??0?$B at _N@@QEAA at AEBVF@@AEBUA@@@Z"(ptr noundef nonnull returned align 1 dereferenceable(1) %this, ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 1 dereferenceable(1) %1) unnamed_addr #2 align 2
+// CHECK-LABEL: define linkonce_odr dso_local noundef ptr @"??0?$c at _NUb@@@@QEAA at AEBVF@@AEBUA@@@Z"(ptr noundef nonnull returned align 1 dereferenceable(1) %this, ptr noundef nonnull align 1 dereferenceable(1) %p1, ptr noundef nonnull align 1 dereferenceable(1) %d) unnamed_addr #2 comdat align 2
----------------
jyu2 wrote:
> rnk wrote:
> > To make this less fragile, can you come up with a way to use `CHECK-NOT: comdat` since that's the key thing we're testing for here? You will need some subsequent anchor like `entry:` or something else.
> Thanks. I changed.
This isn't quite what I was trying to suggest, I was thinking something more like:
```
// CHECK-LABEL: define internal noundef ptr @"??0?$B at _N@@QEAA at AEBVF@@AEBUA@@@Z"
// CHECK-NOT: comdat
// CHECK-SAME: {{\{$}}
```
So, it finds the class with the inheriting constructor, and then checks that the word "comdat" does not appear anywhere on that line. I haven't tested the CHECK-SAME pattern, it may need some adjustment.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D158538/new/
https://reviews.llvm.org/D158538
More information about the cfe-commits
mailing list