2018-06-05 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / c-c++-common / opaque-vector.c
blobae4a9a84bbd45f44eb1e030834f4654b1f319c06
1 #define B_TEST(TYPE) { TYPE v __attribute__((vector_size(16))); (void)((v < v) < v); }
2 #ifdef __cplusplus
3 #define T_TEST(TYPE) { TYPE s; TYPE v __attribute__((vector_size(16))); __typeof((v<v)[0]) iv __attribute__((vector_size(16))); (void)((iv ? s : s) < v); }
4 #else
5 #define T_TEST(TYPE)
6 #endif
7 #define T(TYPE) B_TEST(TYPE) T_TEST(TYPE)
8 #ifdef __SIZEOF_INT128__
9 #define SIZEOF_MAXINT __SIZEOF_INT128__
10 #else
11 #define SIZEOF_MAXINT __SIZEOF_LONG_LONG__
12 #endif
14 void f ()
16 T(short)
17 T(int)
18 T(long)
19 T(long long)
21 T_TEST(float)
22 T_TEST(double)
23 /* Avoid trouble with non-power-of-two sizes.
24 Also avoid trouble with long double larger than integral types. */
25 #if !defined(__i386__) && !defined(__x86_64__) && !defined(__m68k__) \
26 && !defined(__ia64__) && !defined(__hppa__) \
27 && (__SIZEOF_LONG_DOUBLE__ & (__SIZEOF_LONG_DOUBLE__ - 1)) == 0 \
28 && __SIZEOF_LONG_DOUBLE__ <= 16 \
29 && __SIZEOF_LONG_DOUBLE__ <= SIZEOF_MAXINT
30 T_TEST(long double)
31 #endif