CodeGen: allow __asm renaming on static local variables.

Fixes PR4777.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145015 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/asm-label.c b/test/CodeGen/asm-label.c
index 7be2ad3..c06f11f 100644
--- a/test/CodeGen/asm-label.c
+++ b/test/CodeGen/asm-label.c
@@ -2,11 +2,18 @@
 // RUN: %clang_cc1 -triple=i686-apple-darwin9 -emit-llvm %s -o - | FileCheck %s --check-prefix=DARWIN
 
 char *strerror(int) asm("alias");
+int x __asm("foo");
 
-void test(void)
-{
-	strerror(-1);
+int *test(void) {
+  static int y __asm("bar");
+  strerror(-1);
+  return &y;
 }
 
+// LINUX: @bar = internal global i32 0
+// LINUX: @foo = common global i32 0
 // LINUX: declare i8* @alias(i32)
+
+// DARWIN: @"\01bar" = internal global i32 0
+// DARWIN: @"\01foo" = common global i32 0
 // DARWIN: declare i8* @"\01alias"(i32)