From a45d9a15ba45eedc55b7b8cad292afbd4cb57cba Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 13 Aug 2007 18:42:37 +0000 Subject: [PATCH] Fix PR1607 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41048 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86AsmPrinter.cpp | 6 +++--- test/CodeGen/X86/2007-08-13-AppendingLinkage.ll | 12 ++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 test/CodeGen/X86/2007-08-13-AppendingLinkage.ll diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp index ce0fc1349e0..a06cc6f61b1 100644 --- a/lib/Target/X86/X86AsmPrinter.cpp +++ b/lib/Target/X86/X86AsmPrinter.cpp @@ -231,12 +231,12 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) { O << "\t.weak\t" << name << "\n"; } break; - case GlobalValue::AppendingLinkage: - // FIXME: appending linkage variables should go into a section of - // their name or something. For now, just emit them as external. case GlobalValue::DLLExportLinkage: DLLExportedGVs.insert(Mang->makeNameProper(I->getName(),"")); // FALL THROUGH + case GlobalValue::AppendingLinkage: + // FIXME: appending linkage variables should go into a section of + // their name or something. For now, just emit them as external. case GlobalValue::ExternalLinkage: // If external or appending, declare as a global symbol O << "\t.globl " << name << "\n"; diff --git a/test/CodeGen/X86/2007-08-13-AppendingLinkage.ll b/test/CodeGen/X86/2007-08-13-AppendingLinkage.ll new file mode 100644 index 00000000000..f6ed0fe7a5f --- /dev/null +++ b/test/CodeGen/X86/2007-08-13-AppendingLinkage.ll @@ -0,0 +1,12 @@ +; RUN: llvm-as < %s | llc -march=x86 | not grep drectve +; PR1607 + +%hlvm_programs_element = type { i8*, i32 (i32, i8**)* } +@hlvm_programs = appending constant [1 x %hlvm_programs_element] +zeroinitializer + +define %hlvm_programs_element* @hlvm_get_programs() { +entry: + ret %hlvm_programs_element* getelementptr([1 x %hlvm_programs_element]* + @hlvm_programs, i32 0, i32 0) +}