From: JF Bastien Date: Wed, 8 Aug 2018 17:05:17 +0000 (+0000) Subject: CDDecl More automatic variable tail padding test X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dc1c8b8da0ababf171178217926d0a7a56ca2afd;p=clang CDDecl More automatic variable tail padding test Test tail padded automatic variable at different width, because they encounter different codegen. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339273 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGenCXX/auto-var-init.cpp b/test/CodeGenCXX/auto-var-init.cpp index 6f2929c687..f9fe986ef6 100644 --- a/test/CodeGenCXX/auto-var-init.cpp +++ b/test/CodeGenCXX/auto-var-init.cpp @@ -612,13 +612,32 @@ TEST_BRACES(tailpad4, tailpad[4]); // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 16, i1 false) // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) -TEST_CUSTOM(tailpad4, tailpad[4], { {17, 1}, {17, 1}, {17, 1}, {17, 1} }); +TEST_CUSTOM(tailpad4, tailpad[4], { {257, 1}, {257, 1}, {257, 1}, {257, 1} }); // CHECK-LABEL: @test_tailpad4_custom() // CHECK: %custom = alloca [4 x %struct.tailpad], align // CHECK-NEXT: bitcast // CHECK-NEXT: call void @llvm.memcpy // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) +TEST_UNINIT(tailpad9, tailpad[9]); +// CHECK-LABEL: @test_tailpad9_uninit() +// CHECK: %uninit = alloca [9 x %struct.tailpad], align +// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) + +TEST_BRACES(tailpad9, tailpad[9]); +// CHECK-LABEL: @test_tailpad9_braces() +// CHECK: %braces = alloca [9 x %struct.tailpad], align [[ALIGN:[0-9]*]] +// CHECK-NEXT: bitcast +// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 36, i1 false) +// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) + +TEST_CUSTOM(tailpad9, tailpad[9], { {257, 1}, {257, 1}, {257, 1}, {257, 1}, {257, 1}, {257, 1}, {257, 1}, {257, 1}, {257, 1} }); +// CHECK-LABEL: @test_tailpad9_custom() +// CHECK: %custom = alloca [9 x %struct.tailpad], align [[ALIGN:[0-9]*]] +// CHECK-NEXT: bitcast +// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 1, i64 36, i1 false) +// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) + TEST_UNINIT(atomicbool, _Atomic(bool)); // CHECK-LABEL: @test_atomicbool_uninit()