]> granicus.if.org Git - clang/commitdiff
Auto var init test fix #2
authorJF Bastien <jfbastien@apple.com>
Tue, 7 Aug 2018 04:44:13 +0000 (04:44 +0000)
committerJF Bastien <jfbastien@apple.com>
Tue, 7 Aug 2018 04:44:13 +0000 (04:44 +0000)
It turns out that the AVX bots have different alignment for their vectors, and my test mistakenly assumed a particular vector alignent on the stack. Instead, capture the alignment and test for it in subsequent operations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339093 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGenCXX/auto-var-init.cpp

index b1a07d867fb0645f0148834499edbba9b2754ae7..f8656f0fd3393df36b87602fe44de6581dd8492b 100644 (file)
@@ -946,53 +946,53 @@ TEST_BRACES(intvec16, int  __attribute__((vector_size(16))));
 
 TEST_UNINIT(longlongvec32, long long  __attribute__((vector_size(32))));
 // CHECK-LABEL: @test_longlongvec32_uninit()
-// CHECK:       %uninit = alloca <4 x i64>, align 16
+// CHECK:       %uninit = alloca <4 x i64>, align
 // CHECK-NEXT:  call void @{{.*}}used{{.*}}%uninit)
 
 TEST_BRACES(longlongvec32, long long  __attribute__((vector_size(32))));
 // CHECK-LABEL: @test_longlongvec32_braces()
-// CHECK:       %braces = alloca <4 x i64>, align 16
-// CHECK-NEXT:  store <4 x i64> zeroinitializer, <4 x i64>* %braces, align 16
+// CHECK:       %braces = alloca <4 x i64>, align [[ALIGN:[0-9]*]]
+// CHECK-NEXT:  store <4 x i64> zeroinitializer, <4 x i64>* %braces, align [[ALIGN]]
 // CHECK-NEXT:  call void @{{.*}}used{{.*}}%braces)
 
 TEST_CUSTOM(longlongvec32, long long  __attribute__((vector_size(32))), { 0x3333333333333333, 0x3333333333333333, 0x3333333333333333, 0x3333333333333333 });
 // CHECK-LABEL: @test_longlongvec32_custom()
-// CHECK:       %custom = alloca <4 x i64>, align 16
-// CHECK-NEXT:  store <4 x i64> <i64 3689348814741910323, i64 3689348814741910323, i64 3689348814741910323, i64 3689348814741910323>, <4 x i64>* %custom, align 16
+// CHECK:       %custom = alloca <4 x i64>, align [[ALIGN:[0-9]*]]
+// CHECK-NEXT:  store <4 x i64> <i64 3689348814741910323, i64 3689348814741910323, i64 3689348814741910323, i64 3689348814741910323>, <4 x i64>* %custom, align [[ALIGN]]
 // CHECK-NEXT:  call void @{{.*}}used{{.*}}%custom)
 
 TEST_UNINIT(floatvec16, float  __attribute__((vector_size(16))));
 // CHECK-LABEL: @test_floatvec16_uninit()
-// CHECK:       %uninit = alloca <4 x float>, align 16
+// CHECK:       %uninit = alloca <4 x float>, align
 // CHECK-NEXT:  call void @{{.*}}used{{.*}}%uninit)
 
 TEST_BRACES(floatvec16, float  __attribute__((vector_size(16))));
 // CHECK-LABEL: @test_floatvec16_braces()
-// CHECK:       %braces = alloca <4 x float>, align 16
-// CHECK-NEXT:  store <4 x float> zeroinitializer, <4 x float>* %braces, align 16
+// CHECK:       %braces = alloca <4 x float>, align [[ALIGN:[0-9]*]]
+// CHECK-NEXT:  store <4 x float> zeroinitializer, <4 x float>* %braces, align [[ALIGN]]
 // CHECK-NEXT:  call void @{{.*}}used{{.*}}%braces)
 
 TEST_CUSTOM(floatvec16, float  __attribute__((vector_size(16))), { 3.1415926535897932384626433, 3.1415926535897932384626433, 3.1415926535897932384626433, 3.1415926535897932384626433 });
 // CHECK-LABEL: @test_floatvec16_custom()
-// CHECK:       %custom = alloca <4 x float>, align 16
-// CHECK-NEXT:  store <4 x float> <float 0x400921FB60000000, float 0x400921FB60000000, float 0x400921FB60000000, float 0x400921FB60000000>, <4 x float>* %custom, align 16
+// CHECK:       %custom = alloca <4 x float>, align [[ALIGN:[0-9]*]]
+// CHECK-NEXT:  store <4 x float> <float 0x400921FB60000000, float 0x400921FB60000000, float 0x400921FB60000000, float 0x400921FB60000000>, <4 x float>* %custom, align [[ALIGN]]
 // CHECK-NEXT:  call void @{{.*}}used{{.*}}%custom)
 
 TEST_UNINIT(doublevec32, double  __attribute__((vector_size(32))));
 // CHECK-LABEL: @test_doublevec32_uninit()
-// CHECK:       %uninit = alloca <4 x double>, align 16
+// CHECK:       %uninit = alloca <4 x double>, align
 // CHECK-NEXT:  call void @{{.*}}used{{.*}}%uninit)
 
 TEST_BRACES(doublevec32, double  __attribute__((vector_size(32))));
 // CHECK-LABEL: @test_doublevec32_braces()
-// CHECK:       %braces = alloca <4 x double>, align 16
-// CHECK-NEXT:  store <4 x double> zeroinitializer, <4 x double>* %braces, align 16
+// CHECK:       %braces = alloca <4 x double>, align [[ALIGN:[0-9]*]]
+// CHECK-NEXT:  store <4 x double> zeroinitializer, <4 x double>* %braces, align [[ALIGN]]
 // CHECK-NEXT:  call void @{{.*}}used{{.*}}%braces)
 
 TEST_CUSTOM(doublevec32, double  __attribute__((vector_size(32))), { 3.1415926535897932384626433, 3.1415926535897932384626433, 3.1415926535897932384626433, 3.1415926535897932384626433 });
 // CHECK-LABEL: @test_doublevec32_custom()
-// CHECK:       %custom = alloca <4 x double>, align 16
-// CHECK-NEXT:  store <4 x double> <double 0x400921FB54442D18, double 0x400921FB54442D18, double 0x400921FB54442D18, double 0x400921FB54442D18>, <4 x double>* %custom, align 16
+// CHECK:       %custom = alloca <4 x double>, align [[ALIGN:[0-9]*]]
+// CHECK-NEXT:  store <4 x double> <double 0x400921FB54442D18, double 0x400921FB54442D18, double 0x400921FB54442D18, double 0x400921FB54442D18>, <4 x double>* %custom, align [[ALIGN]]
 // CHECK-NEXT:  call void @{{.*}}used{{.*}}%custom)