Hi,

This patch adds target filter for recently added MPX tests.  I put check 
function into a new file because I'm going to also add there some MPX runtime 
tests related functions and use in it another exp file.

Since there is no change in compiler I just checked I get no fails for modified 
tests on x86_64 and x32.

OK for trunk?

Thanks,
Ilya
--
gcc/testsuite/

2014-11-06  Ilya Enkovich  <ilya.enkov...@intel.com>

        * lib/mpx-dg.exp: New.
        * gcc.target/i386/i386.exp: Load mpx-dg.exp.
        * gcc.target/i386/chkp-builtins-1.c: Require mpx target.
        * gcc.target/i386/chkp-builtins-2.c: Likewise.
        * gcc.target/i386/chkp-builtins-3.c: Likewise.
        * gcc.target/i386/chkp-builtins-4.c: Likewise.
        * gcc.target/i386/chkp-const-check-1.c: Likewise.
        * gcc.target/i386/chkp-const-check-2.c: Likewise.
        * gcc.target/i386/chkp-lifetime-1.c: Likewise.
        * gcc.target/i386/chkp-remove-bndint-1.c: Likewise.
        * gcc.target/i386/chkp-remove-bndint-2.c: Likewise.


diff --git a/gcc/testsuite/gcc.target/i386/chkp-builtins-1.c 
b/gcc/testsuite/gcc.target/i386/chkp-builtins-1.c
index bcc1198..2acc087 100644
--- a/gcc/testsuite/gcc.target/i386/chkp-builtins-1.c
+++ b/gcc/testsuite/gcc.target/i386/chkp-builtins-1.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target mpx } */
 /* { dg-options "-fcheck-pointer-bounds -mmpx -fdump-tree-chkp" } */
 /* { dg-final { scan-tree-dump-not "bnd_init_ptr_bounds" "chkp" } } */
 
diff --git a/gcc/testsuite/gcc.target/i386/chkp-builtins-2.c 
b/gcc/testsuite/gcc.target/i386/chkp-builtins-2.c
index 1f4a244..dc62238 100644
--- a/gcc/testsuite/gcc.target/i386/chkp-builtins-2.c
+++ b/gcc/testsuite/gcc.target/i386/chkp-builtins-2.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target mpx } */
 /* { dg-options "-fcheck-pointer-bounds -mmpx -fdump-tree-chkp" } */
 /* { dg-final { scan-tree-dump-not "bnd_copy_ptr_bounds" "chkp" } } */
 
diff --git a/gcc/testsuite/gcc.target/i386/chkp-builtins-3.c 
b/gcc/testsuite/gcc.target/i386/chkp-builtins-3.c
index ea54ede..055f0ed 100644
--- a/gcc/testsuite/gcc.target/i386/chkp-builtins-3.c
+++ b/gcc/testsuite/gcc.target/i386/chkp-builtins-3.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target mpx } */
 /* { dg-options "-fcheck-pointer-bounds -mmpx -fdump-tree-chkp" } */
 /* { dg-final { scan-tree-dump-not "bnd_set_ptr_bounds" "chkp" } } */
 
diff --git a/gcc/testsuite/gcc.target/i386/chkp-builtins-4.c 
b/gcc/testsuite/gcc.target/i386/chkp-builtins-4.c
index cee780b..434df78 100644
--- a/gcc/testsuite/gcc.target/i386/chkp-builtins-4.c
+++ b/gcc/testsuite/gcc.target/i386/chkp-builtins-4.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target mpx } */
 /* { dg-options "-fcheck-pointer-bounds -mmpx -fdump-tree-chkp" } */
 /* { dg-final { scan-tree-dump-not "bnd_null_ptr_bounds" "chkp" } } */
 
diff --git a/gcc/testsuite/gcc.target/i386/chkp-const-check-1.c 
b/gcc/testsuite/gcc.target/i386/chkp-const-check-1.c
index 2cd5af1..53e0828 100644
--- a/gcc/testsuite/gcc.target/i386/chkp-const-check-1.c
+++ b/gcc/testsuite/gcc.target/i386/chkp-const-check-1.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target mpx } */
 /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkpopt" } */
 /* { dg-final { scan-tree-dump-not "bndcl" "chkpopt" } } */
 /* { dg-final { scan-tree-dump-not "bndcu" "chkpopt" } } */
diff --git a/gcc/testsuite/gcc.target/i386/chkp-const-check-2.c 
b/gcc/testsuite/gcc.target/i386/chkp-const-check-2.c
index 98497f9..18e497a 100644
--- a/gcc/testsuite/gcc.target/i386/chkp-const-check-2.c
+++ b/gcc/testsuite/gcc.target/i386/chkp-const-check-2.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target mpx } */
 /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -Wchkp" } */
 
 int test (int *p)
diff --git a/gcc/testsuite/gcc.target/i386/chkp-lifetime-1.c 
b/gcc/testsuite/gcc.target/i386/chkp-lifetime-1.c
index bcecdd0..5ceaa8e 100644
--- a/gcc/testsuite/gcc.target/i386/chkp-lifetime-1.c
+++ b/gcc/testsuite/gcc.target/i386/chkp-lifetime-1.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target mpx } */
 /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkpopt-details" 
} */
 /* { dg-final { scan-tree-dump "Moving creation of \[^ \]+ down to its use" 
"chkpopt" } } */
 
diff --git a/gcc/testsuite/gcc.target/i386/chkp-remove-bndint-1.c 
b/gcc/testsuite/gcc.target/i386/chkp-remove-bndint-1.c
index db71004..377f5c4 100644
--- a/gcc/testsuite/gcc.target/i386/chkp-remove-bndint-1.c
+++ b/gcc/testsuite/gcc.target/i386/chkp-remove-bndint-1.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target mpx } */
 /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-optimized" } */
 /* { dg-final { scan-tree-dump-not "bndint" "optimized" } } */
 
diff --git a/gcc/testsuite/gcc.target/i386/chkp-remove-bndint-2.c 
b/gcc/testsuite/gcc.target/i386/chkp-remove-bndint-2.c
index c97ac27..3547035 100644
--- a/gcc/testsuite/gcc.target/i386/chkp-remove-bndint-2.c
+++ b/gcc/testsuite/gcc.target/i386/chkp-remove-bndint-2.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target mpx } */
 /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-optimized 
-Wchkp" } */
 /* { dg-final { scan-tree-dump-not "bndint" "optimized" } } */
 
diff --git a/gcc/testsuite/gcc.target/i386/i386.exp 
b/gcc/testsuite/gcc.target/i386/i386.exp
index 493a1f4..4fcb8a6 100644
--- a/gcc/testsuite/gcc.target/i386/i386.exp
+++ b/gcc/testsuite/gcc.target/i386/i386.exp
@@ -24,6 +24,7 @@ if { ![istarget i?86*-*-*] && ![istarget x86_64-*-*] } then {
 # Load support procs.
 load_lib gcc-dg.exp
 load_lib clearcap.exp
+load_lib mpx-dg.exp
 
 # Return 1 if attribute ms_hook_prologue is supported.
 proc check_effective_target_ms_hook_prologue { } {
diff --git a/gcc/testsuite/lib/mpx-dg.exp b/gcc/testsuite/lib/mpx-dg.exp
new file mode 100644
index 0000000..de7eba8
--- /dev/null
+++ b/gcc/testsuite/lib/mpx-dg.exp
@@ -0,0 +1,24 @@
+# Copyright (C) 2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+# Return 1 if compilation with "-fcheck-pointer-bounds -mmpx" is
+# error-free for trivial code, 0 otherwise.
+
+proc check_effective_target_mpx {} {
+    return [check_no_compiler_messages mpx object {
+       int *foo (int *arg) { return arg; }
+    } "-fcheck-pointer-bounds -mmpx"]
+}

Reply via email to