case LANG_TYPE: return lang_type_class;
case OPAQUE_TYPE: return opaque_type_class;
case BITINT_TYPE: return bitint_type_class;
+ case VECTOR_TYPE: return vector_type_class;
default: return no_type_class;
}
}
of @var{arg} argument's type, like void type, integer type, enumeral type,
boolean type, pointer type, reference type, offset type, real type, complex
type, function type, method type, record type, union type, array type,
-string type, etc. When the argument is an expression, for
-backwards compatibility reason the argument is promoted like arguments
-passed to @code{...} in varargs function, so some classes are never returned
-in certain languages. Alternatively, the argument of the built-in
-function can be a typename, such as the @code{typeof} specifier.
+string type, bit-precise integer type, vector type, etc. When the argument
+is an expression, for backwards compatibility reason the argument is promoted
+like arguments passed to @code{...} in varargs function, so some classes are
+never returned in certain languages. Alternatively, the argument of the
+built-in function can be a typename, such as the @code{typeof} specifier.
@smallexample
int a[2];
const char *p = (const char *) 0;
float f = 0.0;
_Complex double c = 0.0;
+ typedef int VI __attribute__((vector_size (4 * sizeof (int))));
+ typedef float VF __attribute__((vector_size (4 * sizeof (int))));
+ VI vi = { 0, 0, 0, 0 };
+ VF vf = { 0.0f, 0.0f, 0.0f, 0.0f };
#ifdef __cplusplus
struct T { void foo (); };
int &r = a[0];
static_assert (__builtin_classify_type (struct S) == 12, "");
static_assert (__builtin_classify_type (union U) == 13, "");
static_assert (__builtin_classify_type (int [2]) == 14, "");
+ static_assert (__builtin_classify_type (VI) == 19, "");
+ static_assert (__builtin_classify_type (VF) == 19, "");
static_assert (__builtin_classify_type (__typeof__ (a[0])) == 1, "");
static_assert (__builtin_classify_type (__typeof__ (e)) == 3, "");
static_assert (__builtin_classify_type (__typeof__ (b)) == 4, "");
static_assert (__builtin_classify_type (__typeof__ (s)) == 12, "");
static_assert (__builtin_classify_type (__typeof__ (u)) == 13, "");
static_assert (__builtin_classify_type (__typeof__ (a)) == 14, "");
+ static_assert (__builtin_classify_type (__typeof__ (vi)) == 19, "");
+ static_assert (__builtin_classify_type (__typeof__ (vf)) == 19, "");
#ifndef __cplusplus
static_assert (__builtin_classify_type (a[0]) == 1, "");
static_assert (__builtin_classify_type (e) == 1, "");
abort ();
if (__builtin_classify_type (a) != 5)
abort ();
+ if (__builtin_classify_type (vi) != 19)
+ abort ();
+ if (__builtin_classify_type (vf) != 19)
+ abort ();
}
record_type_class, union_type_class,
array_type_class, string_type_class,
lang_type_class, opaque_type_class,
- bitint_type_class
+ bitint_type_class, vector_type_class
};
#endif /* GCC_TYPECLASS_H */