]> granicus.if.org Git - clang/commitdiff
CDDecl More automatic variable tail padding test
authorJF Bastien <jfbastien@apple.com>
Wed, 8 Aug 2018 17:05:17 +0000 (17:05 +0000)
committerJF Bastien <jfbastien@apple.com>
Wed, 8 Aug 2018 17:05:17 +0000 (17:05 +0000)
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

test/CodeGenCXX/auto-var-init.cpp

index 6f2929c687d3fa3638c43751960f92b1ec2dd521..f9fe986ef6b574ec6db202005f6702e432bb9f5c 100644 (file)
@@ -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()