2 /* { dg-options "-fcheck-pointer-bounds -mmpx" } */
10 /* i386 directory size is 4MB. */
11 #define MPX_NUM_L2_BITS 10
12 #define MPX_NUM_IGN_BITS 2
14 /* x86_64 directory size is 2GB. */
15 #define MPX_NUM_L2_BITS 17
16 #define MPX_NUM_IGN_BITS 3
17 #endif /* !__i386__ */
20 /* bt_num_of_elems is the number of elements in bounds table. */
21 unsigned long bt_num_of_elems
= (1UL << MPX_NUM_L2_BITS
);
23 /* Function to test MPX wrapper of memmove function.
24 Check case with no BT allocated for data. */
27 mpx_test (int argc
, const char **argv
)
30 posix_memalign ((void **) (&arr
),
31 1UL << (MPX_NUM_L2_BITS
+ MPX_NUM_IGN_BITS
),
32 2 * bt_num_of_elems
* sizeof (void *));
33 void **src
= arr
, **dst
= arr
, **ptr
= arr
;
36 ptr
+= bt_num_of_elems
+ 100;
37 ptr
[0] = __bnd_set_ptr_bounds (arr
+ 1, sizeof (void *) + 1);
38 memmove (dst
, src
, 5 * sizeof (void *));