diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-12-14 12:16:43 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-12-14 12:16:43 +0000 |
commit | 17e2633cd65d43ec0a14d247c7be83e2b793ef86 (patch) | |
tree | 5271c453ac6943f7f2a4bcd663699d090e03e14e /clang/test/CodeGenCXX/lambda-expressions.cpp | |
parent | 3fcafa2cdb0d128507308a05555049d3424da2a5 (diff) | |
download | bcm5719-llvm-17e2633cd65d43ec0a14d247c7be83e2b793ef86.tar.gz bcm5719-llvm-17e2633cd65d43ec0a14d247c7be83e2b793ef86.zip |
CodeGen: Compound literals with funny types shouldn't crash
CodeGen assumed that a compound literal with array type should have a
corresponding LLVM IR array type.
We had two bugs in this area:
- Zero sized arrays in compound literals would lead to the creation of
an opaque type. This is unnecessary, we should just create an array
type with a bound of zero.
- Funny record types (like unions) lead to exotic IR types for compound
literals. In this case, CodeGen must be prepared to deal with the
possibility that it might not have an array IR type.
This fixes PR21912.
llvm-svn: 224219
Diffstat (limited to 'clang/test/CodeGenCXX/lambda-expressions.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/lambda-expressions.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/lambda-expressions.cpp b/clang/test/CodeGenCXX/lambda-expressions.cpp index 2f9a4f2d4f5..e35c6163d56 100644 --- a/clang/test/CodeGenCXX/lambda-expressions.cpp +++ b/clang/test/CodeGenCXX/lambda-expressions.cpp @@ -81,7 +81,7 @@ int g() { }; // PR14773 -// CHECK: [[ARRVAL:%[0-9a-zA-Z]*]] = load i32* getelementptr inbounds ([0 x i32]* bitcast (<{}>* @_ZZ14staticarrayrefvE5array to [0 x i32]*), i32 0, i64 0), align 4 +// CHECK: [[ARRVAL:%[0-9a-zA-Z]*]] = load i32* getelementptr inbounds ([0 x i32]* @_ZZ14staticarrayrefvE5array, i32 0, i64 0), align 4 // CHECK-NEXT: store i32 [[ARRVAL]] void staticarrayref(){ static int array[] = {}; |