Debian Codegraph @

gcc/testsuite/c-c++-common/opaque-vector.c

raw
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
13
14 void f ()
15 {
16 T(short)
17 T(int)
18 T(long)
19 T(long long)
20
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
32 }