Local static variables must be available module-wise
as they are accessible in static methods in a class
local to the same function. Fixes PR6769.

llvm-svn: 101756
diff --git a/clang/test/CodeGenCXX/static-local-in-local-class.cpp b/clang/test/CodeGenCXX/static-local-in-local-class.cpp
new file mode 100644
index 0000000..d9e044c
--- /dev/null
+++ b/clang/test/CodeGenCXX/static-local-in-local-class.cpp
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -emit-llvm -o %t %s
+// PR6769
+
+struct X {
+  static void f();
+};
+
+void X::f() {
+  static int *i;
+  {
+    struct Y {
+      static void g() {
+        i = new int();
+	*i = 100;
+	(*i) = (*i) +1;
+      }
+    };
+    (void)Y::g();
+  }
+  (void)i;
+}