aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIlya Enkovich <ilya.enkovich@intel.com>2015-03-10 09:48:51 +0000
committerIlya Enkovich <ienkovich@gcc.gnu.org>2015-03-10 09:48:51 +0000
commit768fbdd49e8535486ea71eebc507c3b813521a1b (patch)
tree1f913dee19299f6e2dca2bcdbb70403cbe412720 /gcc
parent226d62d2d1fae33873e8ecda6004fb24ec36e421 (diff)
downloadgcc-768fbdd49e8535486ea71eebc507c3b813521a1b.zip
gcc-768fbdd49e8535486ea71eebc507c3b813521a1b.tar.gz
gcc-768fbdd49e8535486ea71eebc507c3b813521a1b.tar.bz2
mpx-dg.exp (mpx_link_flags): Set path to wrappers library.
* lib/mpx-dg.exp (mpx_link_flags): Set path to wrappers library. * gcc.target/i386/mpx/calloc-1-lbv.c: New. * gcc.target/i386/mpx/calloc-1-ubv.c: New. * gcc.target/i386/mpx/calloc-1-nov.c: New. * gcc.target/i386/mpx/malloc-1-lbv.c: New. * gcc.target/i386/mpx/malloc-1-nov.c: New. * gcc.target/i386/mpx/malloc-1-ubv.c: New. * gcc.target/i386/mpx/realloc-1-lbv.c: New. * gcc.target/i386/mpx/realloc-1-nov.c: New. * gcc.target/i386/mpx/realloc-1-ubv.c: New. * gcc.target/i386/mpx/realloc-2-lbv.c: New. * gcc.target/i386/mpx/realloc-2-nov.c: New. * gcc.target/i386/mpx/realloc-2-ubv.c: New. From-SVN: r221315
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog16
-rw-r--r--gcc/testsuite/gcc.target/i386/mpx/calloc-1-lbv.c26
-rw-r--r--gcc/testsuite/gcc.target/i386/mpx/calloc-1-nov.c24
-rw-r--r--gcc/testsuite/gcc.target/i386/mpx/calloc-1-ubv.c26
-rw-r--r--gcc/testsuite/gcc.target/i386/mpx/malloc-1-lbv.c26
-rw-r--r--gcc/testsuite/gcc.target/i386/mpx/malloc-1-nov.c24
-rw-r--r--gcc/testsuite/gcc.target/i386/mpx/malloc-1-ubv.c26
-rw-r--r--gcc/testsuite/gcc.target/i386/mpx/realloc-1-lbv.c27
-rw-r--r--gcc/testsuite/gcc.target/i386/mpx/realloc-1-nov.c25
-rw-r--r--gcc/testsuite/gcc.target/i386/mpx/realloc-1-ubv.c27
-rw-r--r--gcc/testsuite/gcc.target/i386/mpx/realloc-2-lbv.c27
-rw-r--r--gcc/testsuite/gcc.target/i386/mpx/realloc-2-nov.c25
-rw-r--r--gcc/testsuite/gcc.target/i386/mpx/realloc-2-ubv.c27
-rw-r--r--gcc/testsuite/lib/mpx-dg.exp14
14 files changed, 340 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9a48aed..564944d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,21 @@
2015-03-10 Ilya Enkovich <ilya.enkovich@intel.com>
+ * lib/mpx-dg.exp (mpx_link_flags): Set path to wrappers library.
+ * gcc.target/i386/mpx/calloc-1-lbv.c: New.
+ * gcc.target/i386/mpx/calloc-1-ubv.c: New.
+ * gcc.target/i386/mpx/calloc-1-nov.c: New.
+ * gcc.target/i386/mpx/malloc-1-lbv.c: New.
+ * gcc.target/i386/mpx/malloc-1-nov.c: New.
+ * gcc.target/i386/mpx/malloc-1-ubv.c: New.
+ * gcc.target/i386/mpx/realloc-1-lbv.c: New.
+ * gcc.target/i386/mpx/realloc-1-nov.c: New.
+ * gcc.target/i386/mpx/realloc-1-ubv.c: New.
+ * gcc.target/i386/mpx/realloc-2-lbv.c: New.
+ * gcc.target/i386/mpx/realloc-2-nov.c: New.
+ * gcc.target/i386/mpx/realloc-2-ubv.c: New.
+
+2015-03-10 Ilya Enkovich <ilya.enkovich@intel.com>
+
* gcc/testsuite/lib/mpx-dg.exp (mpx_link_flags): New.
(mpx_init): New.
(mpx_finish): New.
diff --git a/gcc/testsuite/gcc.target/i386/mpx/calloc-1-lbv.c b/gcc/testsuite/gcc.target/i386/mpx/calloc-1-lbv.c
new file mode 100644
index 0000000..0ba5d73
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/calloc-1-lbv.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-shouldfail "bounds violation" } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
+
+
+#define SHOULDFAIL
+
+#include "mpx-check.h"
+
+int rd (int *p, int i)
+{
+ int res = p[i];
+ printf ("%d\n", res);
+ return res;
+}
+
+int mpx_test (int argc, const char **argv)
+{
+ int *buf = (int *)calloc (100, sizeof(int));
+
+ rd (buf, -1);
+
+ free (buf);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/mpx/calloc-1-nov.c b/gcc/testsuite/gcc.target/i386/mpx/calloc-1-nov.c
new file mode 100644
index 0000000..cb755e5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/calloc-1-nov.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
+
+
+#include "mpx-check.h"
+
+int rd (int *p, int i)
+{
+ int res = p[i];
+ printf ("%d\n", res);
+ return res;
+}
+
+int mpx_test (int argc, const char **argv)
+{
+ int *buf = (int *)calloc (100, sizeof(int));
+
+ rd (buf, 0);
+ rd (buf, 99);
+
+ free (buf);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/mpx/calloc-1-ubv.c b/gcc/testsuite/gcc.target/i386/mpx/calloc-1-ubv.c
new file mode 100644
index 0000000..a932a8c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/calloc-1-ubv.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-shouldfail "bounds violation" } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
+
+
+#define SHOULDFAIL
+
+#include "mpx-check.h"
+
+int rd (int *p, int i)
+{
+ int res = p[i];
+ printf ("%d\n", res);
+ return res;
+}
+
+int mpx_test (int argc, const char **argv)
+{
+ int *buf = (int *)calloc (100, sizeof(int));
+
+ rd (buf, 100);
+
+ free (buf);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/mpx/malloc-1-lbv.c b/gcc/testsuite/gcc.target/i386/mpx/malloc-1-lbv.c
new file mode 100644
index 0000000..aa2aed9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/malloc-1-lbv.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-shouldfail "bounds violation" } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
+
+
+#define SHOULDFAIL
+
+#include "mpx-check.h"
+
+int rd (int *p, int i)
+{
+ int res = p[i];
+ printf ("%d\n", res);
+ return res;
+}
+
+int mpx_test (int argc, const char **argv)
+{
+ int *buf = (int *)malloc (100 * sizeof(int));
+
+ rd (buf, -1);
+
+ free (buf);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/mpx/malloc-1-nov.c b/gcc/testsuite/gcc.target/i386/mpx/malloc-1-nov.c
new file mode 100644
index 0000000..56f26e9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/malloc-1-nov.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
+
+
+#include "mpx-check.h"
+
+int rd (int *p, int i)
+{
+ int res = p[i];
+ printf ("%d\n", res);
+ return res;
+}
+
+int mpx_test (int argc, const char **argv)
+{
+ int *buf = (int *)malloc (100 * sizeof(int));
+
+ rd (buf, 0);
+ rd (buf, 99);
+
+ free (buf);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/mpx/malloc-1-ubv.c b/gcc/testsuite/gcc.target/i386/mpx/malloc-1-ubv.c
new file mode 100644
index 0000000..6f48ec2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/malloc-1-ubv.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-shouldfail "bounds violation" } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
+
+
+#define SHOULDFAIL
+
+#include "mpx-check.h"
+
+int rd (int *p, int i)
+{
+ int res = p[i];
+ printf ("%d\n", res);
+ return res;
+}
+
+int mpx_test (int argc, const char **argv)
+{
+ int *buf = (int *)malloc (100 * sizeof(int));
+
+ rd (buf, 100);
+
+ free (buf);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/mpx/realloc-1-lbv.c b/gcc/testsuite/gcc.target/i386/mpx/realloc-1-lbv.c
new file mode 100644
index 0000000..961196f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/realloc-1-lbv.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* { dg-shouldfail "bounds violation" } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
+
+
+#define SHOULDFAIL
+
+#include "mpx-check.h"
+
+int rd (int *p, int i)
+{
+ int res = p[i];
+ printf ("%d\n", res);
+ return res;
+}
+
+int mpx_test (int argc, const char **argv)
+{
+ int *buf = (int *)malloc (100 * sizeof(int));
+ buf = (int *)realloc (buf, 200 * sizeof(int));
+
+ rd (buf, -1);
+
+ free (buf);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/mpx/realloc-1-nov.c b/gcc/testsuite/gcc.target/i386/mpx/realloc-1-nov.c
new file mode 100644
index 0000000..f4b3dd8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/realloc-1-nov.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
+
+
+#include "mpx-check.h"
+
+int rd (int *p, int i)
+{
+ int res = p[i];
+ printf ("%d\n", res);
+ return res;
+}
+
+int mpx_test (int argc, const char **argv)
+{
+ int *buf = (int *)malloc (100 * sizeof(int));
+ buf = (int *)realloc (buf, 200 * sizeof(int));
+
+ rd (buf, 0);
+ rd (buf, 199);
+
+ free (buf);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/mpx/realloc-1-ubv.c b/gcc/testsuite/gcc.target/i386/mpx/realloc-1-ubv.c
new file mode 100644
index 0000000..8a14baa
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/realloc-1-ubv.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* { dg-shouldfail "bounds violation" } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
+
+
+#define SHOULDFAIL
+
+#include "mpx-check.h"
+
+int rd (int *p, int i)
+{
+ int res = p[i];
+ printf ("%d\n", res);
+ return res;
+}
+
+int mpx_test (int argc, const char **argv)
+{
+ int *buf = (int *)malloc (100 * sizeof(int));
+ buf = (int *)realloc (buf, 200 * sizeof(int));
+
+ rd (buf, 200);
+
+ free (buf);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/mpx/realloc-2-lbv.c b/gcc/testsuite/gcc.target/i386/mpx/realloc-2-lbv.c
new file mode 100644
index 0000000..919f62a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/realloc-2-lbv.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* { dg-shouldfail "bounds violation" } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
+
+
+#define SHOULDFAIL
+
+#include "mpx-check.h"
+
+int rd (int *p, int i)
+{
+ int res = p[i];
+ printf ("%d\n", res);
+ return res;
+}
+
+int mpx_test (int argc, const char **argv)
+{
+ int *buf = (int *)malloc (100 * sizeof(int));
+ buf = (int *)realloc (buf, 10 * sizeof(int));
+
+ rd (buf, -1);
+
+ free (buf);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/mpx/realloc-2-nov.c b/gcc/testsuite/gcc.target/i386/mpx/realloc-2-nov.c
new file mode 100644
index 0000000..569cd24
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/realloc-2-nov.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
+
+
+#include "mpx-check.h"
+
+int rd (int *p, int i)
+{
+ int res = p[i];
+ printf ("%d\n", res);
+ return res;
+}
+
+int mpx_test (int argc, const char **argv)
+{
+ int *buf = (int *)malloc (100 * sizeof(int));
+ buf = (int *)realloc (buf, 10 * sizeof(int));
+
+ rd (buf, 0);
+ rd (buf, 9);
+
+ free (buf);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/mpx/realloc-2-ubv.c b/gcc/testsuite/gcc.target/i386/mpx/realloc-2-ubv.c
new file mode 100644
index 0000000..36eb90c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/realloc-2-ubv.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* { dg-shouldfail "bounds violation" } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
+
+
+#define SHOULDFAIL
+
+#include "mpx-check.h"
+
+int rd (int *p, int i)
+{
+ int res = p[i];
+ printf ("%d\n", res);
+ return res;
+}
+
+int mpx_test (int argc, const char **argv)
+{
+ int *buf = (int *)malloc (100 * sizeof(int));
+ buf = (int *)realloc (buf, 10 * sizeof(int));
+
+ rd (buf, 10);
+
+ free (buf);
+
+ return 0;
+}
diff --git a/gcc/testsuite/lib/mpx-dg.exp b/gcc/testsuite/lib/mpx-dg.exp
index e1b5f2f..0b731a7 100644
--- a/gcc/testsuite/lib/mpx-dg.exp
+++ b/gcc/testsuite/lib/mpx-dg.exp
@@ -48,6 +48,14 @@ proc mpx_link_flags { paths } {
append flags " -L${gccpath}/libmpx/mpxrt/.libs "
append ld_library_path ":${gccpath}/libmpx/mpxrt/.libs"
}
+
+ if { [file exists "${gccpath}/libmpx/mpxwrap/.libs/libmpxwrappers.a"]
+ || [file exists "${gccpath}/libmpx/mpxwrap/.libs/libmpxwrappers.${shlib_ext}"] } {
+ append flags " -B${gccpath}/libmpx/ "
+ append flags " -B${gccpath}/libmpx/mpxwrap "
+ append flags " -L${gccpath}/libmpx/mpxwrap/.libs "
+ append ld_library_path ":${gccpath}/libmpx/mpxwrap/.libs"
+ }
} else {
global tool_root_dir
@@ -56,6 +64,12 @@ proc mpx_link_flags { paths } {
append flags "-L${libmpx} "
append ld_library_path ":${libmpx}"
}
+
+ set libmpxwrappers [lookfor_file ${tool_root_dir} libmpxwrappers]
+ if { $libmpxwrappers != "" } {
+ append flags "-L${libmpxwrappers} "
+ append ld_library_path ":${libmpxwrappers}"
+ }
}
set_ld_library_path_env_vars