if (Subtarget->isTargetELF())
O << "\t.type " << name << ",%object\n";
- if (C->isNullValue() && !GVar->hasSection() && !GVar->isThreadLocal()) {
+ if (C->isNullValue() && !GVar->hasSection() && !GVar->isThreadLocal() &&
+ !(isDarwin &&
+ TAI->SectionKindForGlobal(GVar) == SectionKind::RODataMergeStr)) {
// FIXME: This seems to be pretty darwin-specific
if (GVar->hasExternalLinkage()) {
if (C->isNullValue() && /* FIXME: Verify correct */
!GVar->hasSection() &&
(GVar->hasLocalLinkage() || GVar->hasExternalLinkage() ||
- GVar->mayBeOverridden())) {
+ GVar->mayBeOverridden()) &&
+ TAI->SectionKindForGlobal(GVar) != SectionKind::RODataMergeStr) {
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
if (GVar->hasExternalLinkage()) {
SwitchToSection(TAI->SectionForGlobal(GVar));
- if (C->isNullValue() && !GVar->hasSection()) {
+ if (C->isNullValue() && !GVar->hasSection() &&
+ !(Subtarget->isTargetDarwin() &&
+ TAI->SectionKindForGlobal(GVar) == SectionKind::RODataMergeStr)) {
// FIXME: This seems to be pretty darwin-specific
if (GVar->hasExternalLinkage()) {
if (const char *Directive = TAI->getZeroFillDirective()) {
--- /dev/null
+; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin | not grep comm
+; rdar://6479858
+
+@str1 = internal constant [1 x i8] zeroinitializer