/// should be placed in.
const MCSection *TargetLoweringObjectFileELF::
getSectionForConstant(SectionKind Kind) const {
- if (Kind.isMergeableConst4())
+ if (Kind.isMergeableConst4() && MergeableConst4Section)
return MergeableConst4Section;
- if (Kind.isMergeableConst8())
+ if (Kind.isMergeableConst8() && MergeableConst8Section)
return MergeableConst8Section;
- if (Kind.isMergeableConst16())
+ if (Kind.isMergeableConst16() && MergeableConst16Section)
return MergeableConst16Section;
if (Kind.isReadOnly())
return ReadOnlySection;
--- /dev/null
+; RUN: llvm-as < %s | llc -march=xcore -mcpu=xs1b-generic | FileCheck %s
+
+; CHECK: .section .cp.rodata,"ac",@progbits
+; CHECK: .LCPI1_0:
+; CHECK: .long 12345678
+; CHECK: f:
+; CHECK: ldw r0, cp[.LCPI1_0]
+define i32 @f() {
+entry:
+ ret i32 12345678
+}