Arrays are permitted to be zero-length in some situations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135036 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/constructors.cpp b/test/CodeGenCXX/constructors.cpp
index 9e09099..ec7f06c 100644
--- a/test/CodeGenCXX/constructors.cpp
+++ b/test/CodeGenCXX/constructors.cpp
@@ -104,3 +104,14 @@
C tmp = in;
}
}
+
+namespace test1 {
+ struct A { A(); void *ptr; };
+ struct B { B(); int x; A a[0]; };
+ B::B() {}
+ // CHECK: define void @_ZN5test11BC2Ev(
+ // CHECK: [[THIS:%.*]] = load [[B:%.*]]**
+ // CHECK-NEXT: [[A:%.*]] = getelementptr inbounds [[B:%.*]]* [[THIS]], i32 0, i32 1
+ // CHECK-NEXT: [[BEGIN:%.*]] = getelementptr inbounds [0 x {{%.*}}]* [[A]], i32 0, i32 0
+ // CHECK-NEXT: ret void
+}