S.Diag(TSTLoc, diag::err_invalid_vector_float_decl_spec);
} else if (TypeSpecWidth == TSW_long) {
// vector long is unsupported for ZVector and deprecated for AltiVec.
- if (S.getLangOpts().ZVector)
+ // It has also been historically deprecated on AIX (as an alias for
+ // "vector int" in both 32-bit and 64-bit modes). It was then made
+ // unsupported in the Clang-based XL compiler since the deprecated type
+ // has a number of conflicting semantics and continuing to support it
+ // is a disservice to users.
+ if (S.getLangOpts().ZVector ||
+ S.Context.getTargetInfo().getTriple().isOSAIX())
S.Diag(TSWRange.getBegin(), diag::err_invalid_vector_long_decl_spec);
else
S.Diag(TSWRange.getBegin(),
-// RUN: %clang_cc1 -triple=powerpc-apple-darwin8 -target-feature +altivec -fsyntax-only -verify %s
-// RUN: %clang_cc1 -triple=powerpc64-unknown-linux-gnu -target-feature +altivec -fsyntax-only -verify %s
-// RUN: %clang_cc1 -triple=powerpc64le-unknown-linux-gnu -target-feature +altivec -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple=powerpc-apple-darwin8 -target-feature +altivec -fsyntax-only -verify=expected,nonaix %s
+// RUN: %clang_cc1 -triple=powerpc64-unknown-linux-gnu -target-feature +altivec -fsyntax-only -verify=expected,nonaix %s
+// RUN: %clang_cc1 -triple=powerpc64le-unknown-linux-gnu -target-feature +altivec -fsyntax-only -verify=expected,nonaix %s
+// RUN: %clang_cc1 -triple=powerpc-ibm-aix -target-feature +altivec -fsyntax-only -verify=expected,aix %s
+// RUN: %clang_cc1 -triple=powerpc64-ibm-aix -target-feature +altivec -fsyntax-only -verify=expected,aix %s
__vector char vv_c;
__vector signed char vv_sc;
vector int v = (vector int)(-1);
+// These should have errors on AIX and warnings otherwise.
+__vector long vv_l; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+__vector signed long vv_sl; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+__vector unsigned long vv_ul; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+__vector long int vv_li; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+__vector signed long int vv_sli; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+__vector unsigned long int vv_uli; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector long v_l; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector signed long v_sl; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector unsigned long v_ul; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector long int v_li; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector signed long int v_sli; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector unsigned long int v_uli; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+
// 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}}
-__vector unsigned long vv_ul; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-__vector long int vv_li; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-__vector signed long int vv_sli; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-__vector unsigned long int vv_uli; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-vector long v_l; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-vector signed long v_sl; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-vector unsigned long v_ul; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-vector long int v_li; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-vector signed long int v_sli; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-vector unsigned long int v_uli; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
__vector long double vv_ld; // expected-error {{cannot use 'long double' with '__vector'}}
vector long double v_ld; // expected-error {{cannot use 'long double' with '__vector'}}
vector bool v_b; // expected-warning {{type specifier missing, defaults to 'int'}}
// i8, i16, i32 here are field names, not type names.
vector bool i8; // expected-error {{requires a specifier or qualifier}}
vector pixel i16;
- vector long i32; // expected-warning {{deprecated}}
+ vector short i32;
};
void f() {
-// RUN: %clang_cc1 -triple=powerpc-apple-darwin8 -target-feature +altivec -fsyntax-only -verify -std=c++11 %s
-// RUN: %clang_cc1 -triple=powerpc64-unknown-linux-gnu -target-feature +altivec -fsyntax-only -verify -std=c++11 %s
-// RUN: %clang_cc1 -triple=powerpc64le-unknown-linux-gnu -target-feature +altivec -fsyntax-only -verify -std=c++11 %s
+// RUN: %clang_cc1 -triple=powerpc-apple-darwin8 -target-feature +altivec -fsyntax-only -verify=expected,nonaix -std=c++11 %s
+// RUN: %clang_cc1 -triple=powerpc64-unknown-linux-gnu -target-feature +altivec -fsyntax-only -verify=expected,nonaix -std=c++11 %s
+// RUN: %clang_cc1 -triple=powerpc64le-unknown-linux-gnu -target-feature +altivec -fsyntax-only -verify=expected,nonaix -std=c++11 %s
+// RUN: %clang_cc1 -triple=powerpc-ibm-aix -target-feature +altivec -fsyntax-only -verify=expected,aix -std=c++11 %s
+// RUN: %clang_cc1 -triple=powerpc64-ibm-aix -target-feature +altivec -fsyntax-only -verify=expected,aix -std=c++11 %s
#include <altivec.h>
__vector char vv_c;
vector int v = (vector int)(-1);
+// These should have errors on AIX and warnings otherwise.
+__vector long vv_l; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+__vector signed long vv_sl; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+__vector unsigned long vv_ul; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+__vector long int vv_li; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+__vector signed long int vv_sli; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+__vector unsigned long int vv_uli; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector long v_l; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector signed long v_sl; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector unsigned long v_ul; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector long int v_li; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector signed long int v_sli; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector unsigned long int v_uli; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+ // aix-error@-1 {{cannot use 'long' with '__vector'}}
+
// 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}}
-__vector unsigned long vv_ul; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-__vector long int vv_li; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-__vector signed long int vv_sli; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-__vector unsigned long int vv_uli; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-vector long v_l; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-vector signed long v_sl; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-vector unsigned long v_ul; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-vector long int v_li; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-vector signed long int v_sli; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-vector unsigned long int v_uli; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
__vector long double vv_ld; // expected-error {{cannot use 'long double' with '__vector'}}
vector long double v_ld; // expected-error {{cannot use 'long double' with '__vector'}}