[llvm-commits] [llvm-gcc-4.2] r44891 - in /llvm-gcc-4.2/trunk/gcc: llvm-backend.cpp testsuite/g++.dg/init/llvm-convert-1.C
Devang Patel
dpatel at apple.com
Tue Dec 11 15:17:57 PST 2007
Author: dpatel
Date: Tue Dec 11 17:17:57 2007
New Revision: 44891
URL: http://llvm.org/viewvc/llvm-project?rev=44891&view=rev
Log:
Do not emit pending decls twice.
This fixes PR1805.
Added:
llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/init/llvm-convert-1.C
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=44891&r1=44890&r2=44891&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Tue Dec 11 17:17:57 2007
@@ -897,7 +897,8 @@
}
if (TheDebugInfo) TheDebugInfo->EmitGlobalVariable(GV, decl);
-
+
+ TREE_ASM_WRITTEN(decl) = 1;
timevar_pop(TV_LLVM_GLOBALS);
}
Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/init/llvm-convert-1.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/init/llvm-convert-1.C?rev=44891&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/init/llvm-convert-1.C (added)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/init/llvm-convert-1.C Tue Dec 11 17:17:57 2007
@@ -0,0 +1,21 @@
+// LLVM LOCAL file
+// { dg-do compile }
+// { dg-options "" }
+// PR 1805
+
+int baz(void*);
+
+int foo() {
+ static void* bar[] = { &&bb1, &&bb2, &&bb3 };
+ switch (baz(bar)) {
+ case 1:
+ goto bb1;
+ case 2:
+ goto bb2;
+ default:
+ goto bb3;
+ }
+ bb1: return 1;
+ bb2: return 2;
+ bb3: return 3;
+}
More information about the llvm-commits
mailing list