diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/mpx/memmove-zero-length.c')
-rw-r--r-- | gcc/testsuite/gcc.target/i386/mpx/memmove-zero-length.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/mpx/memmove-zero-length.c b/gcc/testsuite/gcc.target/i386/mpx/memmove-zero-length.c new file mode 100644 index 000000000000..78bfdebff030 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/mpx/memmove-zero-length.c @@ -0,0 +1,18 @@ +/* { dg-do run } */ +/* { dg-options "-fcheck-pointer-bounds -mmpx" } */ + + +#include "mpx-check.h" +#include "string.h" + +int mpx_test (int argc, const char **argv) +{ + int *buf = (int *)malloc (100 * sizeof(int)); + + memmove (buf, NULL, 0); + memmove (NULL, buf, 0); + + free (buf); + + return 0; +} |