Tighten condition in vect/pr85586.c (PR 85654)
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-alias-check-9.c
blob5685bfee576efd7e1665ba6469f155f383cea863
1 #define N 200
2 #define M 4
4 typedef signed char sc;
5 typedef unsigned char uc;
6 typedef signed short ss;
7 typedef unsigned short us;
8 typedef int si;
9 typedef unsigned int ui;
10 typedef signed long long sll;
11 typedef unsigned long long ull;
13 #define FOR_EACH_TYPE(M) \
14 M (sc) M (uc) \
15 M (ss) M (us) \
16 M (si) M (ui) \
17 M (sll) M (ull) \
18 M (float) M (double)
20 #define TEST_VALUE(I) ((I) * 5 / 2)
22 #define ADD_TEST(TYPE) \
23 void __attribute__((noinline, noclone)) \
24 test_##TYPE (TYPE *a, TYPE *b) \
25 { \
26 for (int i = 0; i < N; i += 2) \
27 { \
28 a[i + 0] = b[i + 0] + 2; \
29 a[i + 1] = b[i + 1] + 3; \
30 } \
33 #define DO_TEST(TYPE) \
34 for (int j = 1; j < M; ++j) \
35 { \
36 TYPE a[N + M]; \
37 for (int i = 0; i < N + M; ++i) \
38 a[i] = TEST_VALUE (i); \
39 test_##TYPE (a + j, a); \
40 for (int i = 0; i < N; i += 2) \
41 if (a[i + j] != (TYPE) (a[i] + 2) \
42 || a[i + j + 1] != (TYPE) (a[i + 1] + 3)) \
43 __builtin_abort (); \
46 FOR_EACH_TYPE (ADD_TEST)
48 int
49 main (void)
51 FOR_EACH_TYPE (DO_TEST)
52 return 0;