reapply john's patch, he broke mainline again by changing the test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101871 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index 7929b58..981d583 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -886,7 +886,7 @@
 
     // OpenCL & AltiVec require all elements to be initialized.
     if (numEltsInit != maxElements)
-      if (SemaRef.getLangOptions().OpenCL || SemaRef.getLangOptions().AltiVec)
+      if (SemaRef.getLangOptions().OpenCL)
         SemaRef.Diag(IList->getSourceRange().getBegin(),
                      diag::err_vector_incorrect_num_initializers)
           << (numEltsInit < maxElements) << maxElements << numEltsInit;
diff --git a/test/Parser/altivec.c b/test/Parser/altivec.c
index a3e8183..ed14457 100644
--- a/test/Parser/altivec.c
+++ b/test/Parser/altivec.c
@@ -40,6 +40,8 @@
 void f_a(vector int a);
 void f_a2(int b, vector int a);
 
+vector int v = (vector int)(-1);
+
 // These should have warnings.
 __vector long vv_l;                 // expected-warning {{Use of 'long' with '__vector' is deprecated}}
 __vector signed long vv_sl;         // expected-warning {{Use of 'long' with '__vector' is deprecated}}
diff --git a/test/Parser/cxx-altivec.cpp b/test/Parser/cxx-altivec.cpp
index 7f7a9d2..66d4f32 100644
--- a/test/Parser/cxx-altivec.cpp
+++ b/test/Parser/cxx-altivec.cpp
@@ -41,6 +41,8 @@
 void f_a(vector int a);
 void f_a2(int b, vector int a);
 
+vector int v = (vector int)(-1);
+
 // These should have warnings.
 __vector long vv_l;                 // expected-warning {{Use of 'long' with '__vector' is deprecated}}
 __vector signed long vv_sl;         // expected-warning {{Use of 'long' with '__vector' is deprecated}}