From b1d7d1b8c504a1e1bc1f9fc8ac298ab04b8b9e83 Mon Sep 17 00:00:00 2001 From: Ilya Enkovich Date: Thu, 6 Nov 2014 09:44:05 +0000 Subject: [PATCH] mpx-dg.exp: New. gcc/testsuite/ * 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. From-SVN: r217180 --- gcc/testsuite/ChangeLog | 14 +++++++++++ .../gcc.target/i386/chkp-builtins-1.c | 1 + .../gcc.target/i386/chkp-builtins-2.c | 1 + .../gcc.target/i386/chkp-builtins-3.c | 1 + .../gcc.target/i386/chkp-builtins-4.c | 1 + .../gcc.target/i386/chkp-const-check-1.c | 1 + .../gcc.target/i386/chkp-const-check-2.c | 1 + .../gcc.target/i386/chkp-lifetime-1.c | 1 + .../gcc.target/i386/chkp-remove-bndint-1.c | 1 + .../gcc.target/i386/chkp-remove-bndint-2.c | 1 + gcc/testsuite/gcc.target/i386/i386.exp | 1 + gcc/testsuite/lib/mpx-dg.exp | 24 +++++++++++++++++++ 12 files changed, 48 insertions(+) create mode 100644 gcc/testsuite/lib/mpx-dg.exp diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5c8e8c1f728..b40df261fea 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,17 @@ +2014-11-06 Ilya Enkovich + + * 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. + 2014-11-06 Richard Biener * gcc.dg/tree-ssa/forwprop-28.c: Adjust scanning for the diff --git a/gcc/testsuite/gcc.target/i386/chkp-builtins-1.c b/gcc/testsuite/gcc.target/i386/chkp-builtins-1.c index bcc1198b5b1..2acc087e62a 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 1f4a244ee92..dc62238c5bd 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 ea54ede3c57..055f0ed07d9 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 cee780b2371..434df78ac34 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 2cd5af1f626..53e08289516 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 98497f958a1..18e497a0b92 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 bcecdd032c1..5ceaa8e4621 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 db710041f87..377f5c47164 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 c97ac277893..3547035785e 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 493a1f425e5..4fcb8a6ab5e 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 00000000000..de7eba87877 --- /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 +# . + +# 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"] +} -- 2.30.2