Static local variables don't result in global constructors being emitted.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112933 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/warn-global-constructors.cpp b/test/SemaCXX/warn-global-constructors.cpp
index a9347ea..107bbe1 100644
--- a/test/SemaCXX/warn-global-constructors.cpp
+++ b/test/SemaCXX/warn-global-constructors.cpp
@@ -56,3 +56,26 @@
char b[5] = "hello";
char c[][5] = { "hello" };
}
+
+namespace test5 {
+ struct A { A(); };
+
+ void f1() {
+ static A a;
+ }
+ void f2() {
+ static A& a = *new A;
+ }
+}
+
+namespace test6 {
+ struct A { ~A(); };
+
+ void f1() {
+ static A a; // expected-warning {{global destructor}}
+ }
+ void f2() {
+ static A& a = *new A;
+ }
+
+}
\ No newline at end of file