summaryrefslogtreecommitdiffstats
path: root/test/CodeGen
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2018-07-19 21:38:56 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2018-07-19 21:38:56 +0000
commitf9af50d37f8d3ae675069543ba14b2a6ace05428 (patch)
treecc589a97fd59f83a3025ac79fa7acca6a3bd0489 /test/CodeGen
parent48b5ee7a0b384726615ebdbace53d37a87d889e5 (diff)
When we choose to use zeroinitializer for a trailing portion of an array
constant, don't convert the rest into a packed struct. If an array constant has a large non-zero portion and a large zero portion, we want to emit the first part as an array and the rest as a zeroinitializer if possible. This fixes a memory usage regression from r333141 when compiling PHP. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337498 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/init.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/CodeGen/init.c b/test/CodeGen/init.c
index b539681010..770995f93f 100644
--- a/test/CodeGen/init.c
+++ b/test/CodeGen/init.c
@@ -81,6 +81,10 @@ struct Huge {
int arr[1000 * 1000 * 1000];
} huge_struct = {1, {2, 0, 0, 0}};
+// CHECK-DAG: @large_array_with_zeroes = constant <{ [21 x i8], [979 x i8] }> <{ [21 x i8] c"abc\01\02\03xyzzy\00\00\00\00\00\00\00\00\00q", [979 x i8] zeroinitializer }>
+const char large_array_with_zeroes[1000] = {
+ 'a', 'b', 'c', 1, 2, 3, 'x', 'y', 'z', 'z', 'y', [20] = 'q'
+};
// PR279 comment #3
char test8(int X) {