(which indicates vector expression is a string of hex
values) instead of crashing in code gen. // rdar://
16492792
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205557
91177308-0d34-0410-b5e6-
96231b3b80d8
// This flag determines whether or not CompName has an 's' char prefix,
// indicating that it is a string of hex values to be used as vector indices.
- bool HexSwizzle = *compStr == 's' || *compStr == 'S';
+ bool HexSwizzle = (*compStr == 's' || *compStr == 'S') && compStr[1];
bool HasRepeated = false;
bool HasIndex[16] = {};
enum { e_2 } x3 __attribute__((vector_size(64))); // expected-error {{invalid vector element type}}
int x4 __attribute__((ext_vector_type(64))); // expected-error {{'ext_vector_type' attribute only applies to types}}
+
+// rdar://16492792
+typedef __attribute__ ((ext_vector_type(32),__aligned__(32))) unsigned char uchar32;
+
+void convert() {
+ uchar32 r = 0;
+ r.s[ 1234 ] = 1; // expected-error {{illegal vector component name 's'}}
+}