diff options
author | John McCall <rjmccall@apple.com> | 2011-07-13 07:37:11 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-07-13 07:37:11 +0000 |
commit | dd376cae98ce4d0ab92c90d3e9c01ee19e919f44 (patch) | |
tree | 7770885667c74b97acb92201b35d12ab1c661c5f /test/CodeGenCXX/constructors.cpp | |
parent | 862ff87c0d306af8dfdbe7ac59f181a5815546e5 (diff) |
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
Diffstat (limited to 'test/CodeGenCXX/constructors.cpp')
-rw-r--r-- | test/CodeGenCXX/constructors.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGenCXX/constructors.cpp b/test/CodeGenCXX/constructors.cpp index 9e09099ba4..ec7f06c868 100644 --- a/test/CodeGenCXX/constructors.cpp +++ b/test/CodeGenCXX/constructors.cpp @@ -104,3 +104,14 @@ namespace test0 { 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 +} |