Commit 768fbdd4 by Ilya Enkovich Committed by Ilya Enkovich

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
parent 226d62d2
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.
......
/* { 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;
}
/* { 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;
}
/* { 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;
}
/* { 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;
}
/* { 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;
}
/* { 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;
}
/* { 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;
}
/* { 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;
}
/* { 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;
}
/* { 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;
}
/* { 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;
}
/* { 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;
}
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment