{
cpp_hashnode *ident = tok->val.node;
- if (ident == C_CPP_HASHNODE (vector_keyword)
- || ident == C_CPP_HASHNODE (__vector_keyword))
+ if (ident == C_CPP_HASHNODE (vector_keyword))
return C_CPP_HASHNODE (__vector_keyword);
- if (ident == C_CPP_HASHNODE (pixel_keyword)
- || ident == C_CPP_HASHNODE (__pixel_keyword))
+ if (ident == C_CPP_HASHNODE (pixel_keyword))
return C_CPP_HASHNODE (__pixel_keyword);
- if (ident == C_CPP_HASHNODE (bool_keyword)
- || ident == C_CPP_HASHNODE (__bool_keyword))
+ if (ident == C_CPP_HASHNODE (bool_keyword))
return C_CPP_HASHNODE (__bool_keyword);
return ident;
ident = altivec_categorize_keyword (tok);
+ if (ident != expand_this)
+ expand_this = NULL;
+
if (ident == C_CPP_HASHNODE (__vector_keyword))
{
- tok = cpp_peek_token (pfile, 0);
+ int idx = 0;
+ do
+ tok = cpp_peek_token (pfile, idx++);
+ while (tok->type == CPP_PADDING);
ident = altivec_categorize_keyword (tok);
- if (ident == C_CPP_HASHNODE (__pixel_keyword))
+ if (ident == C_CPP_HASHNODE (__pixel_keyword))
{
expand_this = C_CPP_HASHNODE (__vector_keyword);
expand_bool_pixel = __pixel_keyword;
enum rid rid_code = (enum rid)(ident->rid_code);
if (ident->type == NT_MACRO)
{
- (void)cpp_get_token (pfile);
- tok = cpp_peek_token (pfile, 0);
+ do
+ (void) cpp_get_token (pfile);
+ while (--idx > 0);
+ do
+ tok = cpp_peek_token (pfile, idx++);
+ while (tok->type == CPP_PADDING);
ident = altivec_categorize_keyword (tok);
if (ident)
rid_code = (enum rid)(ident->rid_code);
expand_this = C_CPP_HASHNODE (__vector_keyword);
/* If the next keyword is bool or pixel, it
will need to be expanded as well. */
- tok = cpp_peek_token (pfile, 1);
+ do
+ tok = cpp_peek_token (pfile, idx++);
+ while (tok->type == CPP_PADDING);
ident = altivec_categorize_keyword (tok);
- if (ident == C_CPP_HASHNODE (__pixel_keyword))
+ if (ident == C_CPP_HASHNODE (__pixel_keyword))
expand_bool_pixel = __pixel_keyword;
else if (ident == C_CPP_HASHNODE (__bool_keyword))
expand_bool_pixel = __bool_keyword;
else
{
/* Try two tokens down, too. */
- tok = cpp_peek_token (pfile, 2);
+ do
+ tok = cpp_peek_token (pfile, idx++);
+ while (tok->type == CPP_PADDING);
ident = altivec_categorize_keyword (tok);
- if (ident == C_CPP_HASHNODE (__pixel_keyword))
+ if (ident == C_CPP_HASHNODE (__pixel_keyword))
expand_bool_pixel = __pixel_keyword;
else if (ident == C_CPP_HASHNODE (__bool_keyword))
expand_bool_pixel = __bool_keyword;
--- /dev/null
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-maltivec" } */
+
+#define f0() void x0 (vector float x) { }
+f0 ()
+
+#define f1(type) void x1##type (vector type x) { }
+f1 (float)
+
+#define f2(v, type) void x2##type (v type x) { }
+f2 (vector, float)
+
+#define f3(type) void x3##type (vector bool type x) { }
+f3 (int)
+
+#define f4(v, type) void x4##type (v bool type x) { }
+f4 (vector, int)
+
+#define f5(b, type) void x5##type (vector b type x) { }
+f5 (bool, int)
+
+#define f6(v, b, type) void x6##type (v b type x) { }
+f6 (vector, bool, int)
+
+#define f7(v, b, type) void x7##type (v type b x) { }
+f7 (vector, bool, int)
+
+int vector = 6;
+
+#define v1(v) int x8 (int v) { return v; }
+v1(vector)