From d7f41b7f66ab25db2b654665576efa3d86910d29 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Tue, 9 Aug 2011 18:56:35 +0000 Subject: [PATCH] Revert r137134. It breaks some code as Eli pointed out. llvm-svn: 137135 --- llvm/lib/Target/CBackend/CBackend.cpp | 2 +- llvm/test/CodeGen/CBackend/pr10081.ll | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) delete mode 100644 llvm/test/CodeGen/CBackend/pr10081.ll diff --git a/llvm/lib/Target/CBackend/CBackend.cpp b/llvm/lib/Target/CBackend/CBackend.cpp index e4ecb9e1c564..5b9a0a297fb3 100644 --- a/llvm/lib/Target/CBackend/CBackend.cpp +++ b/llvm/lib/Target/CBackend/CBackend.cpp @@ -1817,7 +1817,7 @@ bool CWriter::doInitialization(Module &M) { Out << "\n\n/* Global Variable Declarations */\n"; for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) - if (I->isDeclaration()) { + if (!I->isDeclaration()) { // Ignore special globals, such as debug info. if (getGlobalVariableClass(I)) continue; diff --git a/llvm/test/CodeGen/CBackend/pr10081.ll b/llvm/test/CodeGen/CBackend/pr10081.ll deleted file mode 100644 index 723bf5c757c6..000000000000 --- a/llvm/test/CodeGen/CBackend/pr10081.ll +++ /dev/null @@ -1,11 +0,0 @@ -; RUN: llc < %s -march=c | grep {static float _ZL3foo} | count 1 -; PR10081 - -@_ZL3foo = internal global float 0.000000e+00, align 4 - -define float @_Z3barv() nounwind ssp { - %1 = load float* @_ZL3foo, align 4 - %2 = fadd float %1, 1.000000e+00 - store float %2, float* @_ZL3foo, align 4 - ret float %1 -}