4 typedef signed char sc
;
5 typedef unsigned char uc
;
6 typedef signed short ss
;
7 typedef unsigned short us
;
9 typedef unsigned int ui
;
10 typedef signed long long sll
;
11 typedef unsigned long long ull
;
13 #define FOR_EACH_TYPE(M) \
20 #define TEST_VALUE(I) ((I) * 13 / 2)
22 #define ADD_TEST(TYPE) \
23 TYPE __attribute__((noinline, noclone)) \
24 test_##TYPE (TYPE *x, TYPE *y) \
27 for (int i = 0; i < N; ++i) \
35 #define DO_TEST(TYPE) \
36 _Pragma("GCC novector") \
37 for (int i = 0; i < DIST * 2; ++i) \
39 TYPE a[N + DIST * 2]; \
40 for (int j = 0; j < N + DIST * 2; ++j) \
41 a[j] = TEST_VALUE (j); \
42 TYPE res = test_##TYPE (a + DIST, a + i); \
43 _Pragma("GCC novector") \
44 for (int j = 0; j < N; ++j) \
45 if (a[j + DIST] != (TYPE) j) \
47 TYPE expected_res = 0; \
48 for (int j = i; j < i + N; ++j) \
49 if (i <= DIST && j >= DIST && j < DIST + N) \
50 expected_res += j - DIST; \
52 expected_res += TEST_VALUE (j); \
53 if (expected_res != res) \
57 FOR_EACH_TYPE (ADD_TEST
)
62 FOR_EACH_TYPE (DO_TEST
)
66 /* { dg-final { scan-tree-dump {flags: *RAW\n} "vect" { target vect_int } } } */
67 /* { dg-final { scan-tree-dump "using an address-based overlap test" "vect" { target { ! vect_check_ptrs } } } } */
68 /* { dg-final { scan-tree-dump "using an IFN_CHECK_RAW_PTRS test" "vect" { target vect_check_ptrs } } } */
69 /* { dg-final { scan-tree-dump-not "using an index-based" "vect" } } */