GV = GenerateStaticBlockVarDecl(D, false, ".",
llvm::GlobalValue::InternalLinkage);
+ // FIXME: Merge attribute handling.
if (const AnnotateAttr *AA = D.getAttr<AnnotateAttr>()) {
SourceManager &SM = CGM.getContext().getSourceManager();
llvm::Constant *Ann =
CGM.AddAnnotation(Ann);
}
+ if (const SectionAttr *SA = D.getAttr<SectionAttr>())
+ GV->setSection(SA->getName());
+
const llvm::Type *LTy = CGM.getTypes().ConvertTypeForMem(D.getType());
const llvm::Type *LPtrTy =
llvm::PointerType::get(LTy, D.getType().getAddressSpace());
// RUN: grep '@t10().*section "SECT"' %t &&
// RUN: grep '@t11().*section "SECT"' %t &&
// RUN: grep '@t12 =.*section "SECT"' %t &&
-// RUN: grep '@t13 =.*section "SECT"' %t
+// RUN: grep '@t13 =.*section "SECT"' %t &&
+// RUN: grep '@t14.x =.*section "SECT"' %t
void t1() __attribute__((noreturn));
void t1() {}
int t12 __attribute__((section("SECT")));
struct s0 { int x; };
-struct s0 t13 __attribute__ ((section ("SECT"))) = { 0 };
+struct s0 t13 __attribute__((section("SECT"))) = { 0 };
+
+void t14(void) {
+ static int x __attribute__((section("SECT"))) = 0;
+}