From 4afdcfaa6f925047857feebc13d50a4583a75eb0 Mon Sep 17 00:00:00 2001 From: Ilya Enkovich Date: Fri, 1 Apr 2016 10:40:51 +0000 Subject: [PATCH] re PR target/69890 (FAIL: gcc.target/i386/chkp-* on x86_64-apple-darwin15) gcc/testsuite/ PR target/69890 * gcc.dg/strlenopt.h (memmove): New. * gcc.target/i386/chkp-strlen-1.c: Include "../../gcc.dg/strlenopt.h" instead of "string.h". * gcc.target/i386/chkp-strlen-2.c: Likewise. * gcc.target/i386/chkp-strlen-3.c: Likewise. * gcc.target/i386/chkp-strlen-4.c: Likewise. * gcc.target/i386/chkp-strlen-5.c: Likewise. * gcc.target/i386/chkp-stropt-1.c: Likewise. * gcc.target/i386/chkp-stropt-10.c: Likewise. * gcc.target/i386/chkp-stropt-11.c: Likewise. * gcc.target/i386/chkp-stropt-12.c: Likewise. * gcc.target/i386/chkp-stropt-13.c: Likewise. * gcc.target/i386/chkp-stropt-14.c: Likewise. * gcc.target/i386/chkp-stropt-15.c: Likewise. * gcc.target/i386/chkp-stropt-16.c: Likewise. * gcc.target/i386/chkp-stropt-2.c: Likewise. * gcc.target/i386/chkp-stropt-3.c: Likewise. * gcc.target/i386/chkp-stropt-4.c: Likewise. * gcc.target/i386/chkp-stropt-5.c: Likewise. * gcc.target/i386/chkp-stropt-6.c: Likewise. * gcc.target/i386/chkp-stropt-7.c: Likewise. * gcc.target/i386/chkp-stropt-8.c: Likewise. * gcc.target/i386/chkp-stropt-9.c: Likewise. From-SVN: r234666 --- gcc/testsuite/ChangeLog | 27 +++++++++++++++++++ gcc/testsuite/gcc.dg/strlenopt.h | 7 +++++ gcc/testsuite/gcc.target/i386/chkp-strlen-1.c | 2 +- gcc/testsuite/gcc.target/i386/chkp-strlen-2.c | 4 +-- gcc/testsuite/gcc.target/i386/chkp-strlen-3.c | 2 +- gcc/testsuite/gcc.target/i386/chkp-strlen-4.c | 4 +-- gcc/testsuite/gcc.target/i386/chkp-strlen-5.c | 2 +- gcc/testsuite/gcc.target/i386/chkp-stropt-1.c | 2 +- .../gcc.target/i386/chkp-stropt-10.c | 2 +- .../gcc.target/i386/chkp-stropt-11.c | 2 +- .../gcc.target/i386/chkp-stropt-12.c | 4 +-- .../gcc.target/i386/chkp-stropt-13.c | 2 +- .../gcc.target/i386/chkp-stropt-14.c | 2 +- .../gcc.target/i386/chkp-stropt-15.c | 2 +- .../gcc.target/i386/chkp-stropt-16.c | 4 +-- gcc/testsuite/gcc.target/i386/chkp-stropt-2.c | 2 +- gcc/testsuite/gcc.target/i386/chkp-stropt-3.c | 2 +- gcc/testsuite/gcc.target/i386/chkp-stropt-4.c | 4 +-- gcc/testsuite/gcc.target/i386/chkp-stropt-5.c | 2 +- gcc/testsuite/gcc.target/i386/chkp-stropt-6.c | 2 +- gcc/testsuite/gcc.target/i386/chkp-stropt-7.c | 2 +- gcc/testsuite/gcc.target/i386/chkp-stropt-8.c | 4 +-- gcc/testsuite/gcc.target/i386/chkp-stropt-9.c | 2 +- 23 files changed, 61 insertions(+), 27 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fc7fd586440..8f6210a5bfa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,30 @@ +2016-04-01 Ilya Enkovich + + PR target/69890 + * gcc.dg/strlenopt.h (memmove): New. + * gcc.target/i386/chkp-strlen-1.c: Include "../../gcc.dg/strlenopt.h" + instead of "string.h". + * gcc.target/i386/chkp-strlen-2.c: Likewise. + * gcc.target/i386/chkp-strlen-3.c: Likewise. + * gcc.target/i386/chkp-strlen-4.c: Likewise. + * gcc.target/i386/chkp-strlen-5.c: Likewise. + * gcc.target/i386/chkp-stropt-1.c: Likewise. + * gcc.target/i386/chkp-stropt-10.c: Likewise. + * gcc.target/i386/chkp-stropt-11.c: Likewise. + * gcc.target/i386/chkp-stropt-12.c: Likewise. + * gcc.target/i386/chkp-stropt-13.c: Likewise. + * gcc.target/i386/chkp-stropt-14.c: Likewise. + * gcc.target/i386/chkp-stropt-15.c: Likewise. + * gcc.target/i386/chkp-stropt-16.c: Likewise. + * gcc.target/i386/chkp-stropt-2.c: Likewise. + * gcc.target/i386/chkp-stropt-3.c: Likewise. + * gcc.target/i386/chkp-stropt-4.c: Likewise. + * gcc.target/i386/chkp-stropt-5.c: Likewise. + * gcc.target/i386/chkp-stropt-6.c: Likewise. + * gcc.target/i386/chkp-stropt-7.c: Likewise. + * gcc.target/i386/chkp-stropt-8.c: Likewise. + * gcc.target/i386/chkp-stropt-9.c: Likewise. + 2016-03-31 Rainer Orth * g++.dg/template/ptrmem30.C (read): Rename to data_read. diff --git a/gcc/testsuite/gcc.dg/strlenopt.h b/gcc/testsuite/gcc.dg/strlenopt.h index ef47e5ac9ad..8f69940b027 100644 --- a/gcc/testsuite/gcc.dg/strlenopt.h +++ b/gcc/testsuite/gcc.dg/strlenopt.h @@ -10,6 +10,7 @@ void free (void *); char *strdup (const char *); size_t strlen (const char *); void *memcpy (void *__restrict, const void *__restrict, size_t); +void *memmove (void *, const void *, size_t); char *strcpy (char *__restrict, const char *__restrict); char *strcat (char *__restrict, const char *__restrict); char *strchr (const char *, int); @@ -31,6 +32,12 @@ memcpy (void *__restrict dest, const void *__restrict src, size_t len) return __builtin___memcpy_chk (dest, src, len, bos0 (dest)); } +extern inline __attribute__((gnu_inline, always_inline, artificial)) void * +memmove (void *dest, const void *src, size_t len) +{ + return __builtin___memmove_chk (dest, src, len, bos0 (dest)); +} + extern inline __attribute__((gnu_inline, always_inline, artificial)) char * strcpy (char *__restrict dest, const char *__restrict src) { diff --git a/gcc/testsuite/gcc.target/i386/chkp-strlen-1.c b/gcc/testsuite/gcc.target/i386/chkp-strlen-1.c index de6279f1dfa..38d53900627 100644 --- a/gcc/testsuite/gcc.target/i386/chkp-strlen-1.c +++ b/gcc/testsuite/gcc.target/i386/chkp-strlen-1.c @@ -2,7 +2,7 @@ /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-strlen" } */ /* { dg-final { scan-tree-dump "memcpy.chkp" "strlen" } } */ -#include "string.h" +#include "../../gcc.dg/strlenopt.h" char *test (char *str1, char *str2) { diff --git a/gcc/testsuite/gcc.target/i386/chkp-strlen-2.c b/gcc/testsuite/gcc.target/i386/chkp-strlen-2.c index 470ac4715a9..789ebc1f2d8 100644 --- a/gcc/testsuite/gcc.target/i386/chkp-strlen-2.c +++ b/gcc/testsuite/gcc.target/i386/chkp-strlen-2.c @@ -3,8 +3,8 @@ /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-strlen" } */ /* { dg-final { scan-tree-dump-not "strlen" "strlen" } } */ -#define _GNU_SOURCE -#include "string.h" +#define USE_GNU +#include "../../gcc.dg/strlenopt.h" char *test (char *str1, char *str2) { diff --git a/gcc/testsuite/gcc.target/i386/chkp-strlen-3.c b/gcc/testsuite/gcc.target/i386/chkp-strlen-3.c index 311c9a042e0..276f4127975 100644 --- a/gcc/testsuite/gcc.target/i386/chkp-strlen-3.c +++ b/gcc/testsuite/gcc.target/i386/chkp-strlen-3.c @@ -2,7 +2,7 @@ /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-strlen" } */ /* { dg-final { scan-tree-dump-times "strlen" 1 "strlen" } } */ -#include "string.h" +#include "../../gcc.dg/strlenopt.h" size_t test (char *str1, char *str2) { diff --git a/gcc/testsuite/gcc.target/i386/chkp-strlen-4.c b/gcc/testsuite/gcc.target/i386/chkp-strlen-4.c index dbf568b8418..51ff96028be 100644 --- a/gcc/testsuite/gcc.target/i386/chkp-strlen-4.c +++ b/gcc/testsuite/gcc.target/i386/chkp-strlen-4.c @@ -3,8 +3,8 @@ /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-strlen" } */ /* { dg-final { scan-tree-dump-times "strlen" 1 "strlen" } } */ -#define _GNU_SOURCE -#include "string.h" +#define USE_GNU +#include "../../gcc.dg/strlenopt.h" char * test (char *str1, char *str2) { diff --git a/gcc/testsuite/gcc.target/i386/chkp-strlen-5.c b/gcc/testsuite/gcc.target/i386/chkp-strlen-5.c index e44096cd429..bbafecc3063 100644 --- a/gcc/testsuite/gcc.target/i386/chkp-strlen-5.c +++ b/gcc/testsuite/gcc.target/i386/chkp-strlen-5.c @@ -3,7 +3,7 @@ /* { dg-final { scan-tree-dump-times "strlen" 2 "strlen" } } */ /* { dg-final { scan-tree-dump "memcpy" "strlen" } } */ -#include "string.h" +#include "../../gcc.dg/strlenopt.h" size_t test (char *str1, char *str2) { diff --git a/gcc/testsuite/gcc.target/i386/chkp-stropt-1.c b/gcc/testsuite/gcc.target/i386/chkp-stropt-1.c index 18aa2819cdf..d6148a87fd1 100644 --- a/gcc/testsuite/gcc.target/i386/chkp-stropt-1.c +++ b/gcc/testsuite/gcc.target/i386/chkp-stropt-1.c @@ -2,7 +2,7 @@ /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkpopt -fchkp-use-nochk-string-functions" } */ /* { dg-final { scan-tree-dump "memcpy_nochk" "chkpopt" } } */ -#include "string.h" +#include "../../gcc.dg/strlenopt.h" void test (int *buf1, int *buf2, size_t len) { diff --git a/gcc/testsuite/gcc.target/i386/chkp-stropt-10.c b/gcc/testsuite/gcc.target/i386/chkp-stropt-10.c index 26e9f13a190..18cff739b01 100644 --- a/gcc/testsuite/gcc.target/i386/chkp-stropt-10.c +++ b/gcc/testsuite/gcc.target/i386/chkp-stropt-10.c @@ -2,7 +2,7 @@ /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkpopt -fchkp-use-fast-string-functions" } */ /* { dg-final { scan-tree-dump-not "memset_nobnd" "chkpopt" } } */ -#include "string.h" +#include "../../gcc.dg/strlenopt.h" void test (void *buf1, int c, size_t len) { diff --git a/gcc/testsuite/gcc.target/i386/chkp-stropt-11.c b/gcc/testsuite/gcc.target/i386/chkp-stropt-11.c index e84963f11f7..c53db6a17e4 100644 --- a/gcc/testsuite/gcc.target/i386/chkp-stropt-11.c +++ b/gcc/testsuite/gcc.target/i386/chkp-stropt-11.c @@ -2,7 +2,7 @@ /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkpopt -fchkp-use-fast-string-functions" } */ /* { dg-final { scan-tree-dump-not "memmove_nobnd" "chkpopt" } } */ -#include "string.h" +#include "../../gcc.dg/strlenopt.h" void test (void *buf1, void *buf2, size_t len) { diff --git a/gcc/testsuite/gcc.target/i386/chkp-stropt-12.c b/gcc/testsuite/gcc.target/i386/chkp-stropt-12.c index 638810b8be5..a076d17cd9a 100644 --- a/gcc/testsuite/gcc.target/i386/chkp-stropt-12.c +++ b/gcc/testsuite/gcc.target/i386/chkp-stropt-12.c @@ -3,8 +3,8 @@ /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkpopt -fchkp-use-fast-string-functions" } */ /* { dg-final { scan-tree-dump-not "mempcpy_nobnd" "chkpopt" } } */ -#define _GNU_SOURCE -#include "string.h" +#define USE_GNU +#include "../../gcc.dg/strlenopt.h" void test (void *buf1, void *buf2, size_t len) { diff --git a/gcc/testsuite/gcc.target/i386/chkp-stropt-13.c b/gcc/testsuite/gcc.target/i386/chkp-stropt-13.c index 3b926b11f83..279cae3e5bf 100644 --- a/gcc/testsuite/gcc.target/i386/chkp-stropt-13.c +++ b/gcc/testsuite/gcc.target/i386/chkp-stropt-13.c @@ -2,7 +2,7 @@ /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkpopt -fchkp-use-nochk-string-functions -fchkp-use-fast-string-functions" } */ /* { dg-final { scan-tree-dump "memcpy_nobnd_nochk" "chkpopt" } } */ -#include "string.h" +#include "../../gcc.dg/strlenopt.h" void test (int *buf1, int *buf2, size_t len) { diff --git a/gcc/testsuite/gcc.target/i386/chkp-stropt-14.c b/gcc/testsuite/gcc.target/i386/chkp-stropt-14.c index a8d000ba1fa..b810c682569 100644 --- a/gcc/testsuite/gcc.target/i386/chkp-stropt-14.c +++ b/gcc/testsuite/gcc.target/i386/chkp-stropt-14.c @@ -2,7 +2,7 @@ /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkpopt -fchkp-use-nochk-string-functions -fchkp-use-fast-string-functions" } */ /* { dg-final { scan-tree-dump "memset_nobnd_nochk" "chkpopt" } } */ -#include "string.h" +#include "../../gcc.dg/strlenopt.h" void test (int *buf1, int c, size_t len) { diff --git a/gcc/testsuite/gcc.target/i386/chkp-stropt-15.c b/gcc/testsuite/gcc.target/i386/chkp-stropt-15.c index 7c6065657c0..a9a79c1e330 100644 --- a/gcc/testsuite/gcc.target/i386/chkp-stropt-15.c +++ b/gcc/testsuite/gcc.target/i386/chkp-stropt-15.c @@ -2,7 +2,7 @@ /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkpopt -fchkp-use-nochk-string-functions -fchkp-use-fast-string-functions" } */ /* { dg-final { scan-tree-dump "memmove_nobnd_nochk" "chkpopt" } } */ -#include "string.h" +#include "../../gcc.dg/strlenopt.h" void test (int *buf1, int *buf2, size_t len) { diff --git a/gcc/testsuite/gcc.target/i386/chkp-stropt-16.c b/gcc/testsuite/gcc.target/i386/chkp-stropt-16.c index b0f43a6880d..6ce170c9d68 100644 --- a/gcc/testsuite/gcc.target/i386/chkp-stropt-16.c +++ b/gcc/testsuite/gcc.target/i386/chkp-stropt-16.c @@ -3,8 +3,8 @@ /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkpopt -fchkp-use-nochk-string-functions -fchkp-use-fast-string-functions" } */ /* { dg-final { scan-tree-dump "mempcpy_nobnd_nochk" "chkpopt" } } */ -#define _GNU_SOURCE -#include "string.h" +#define USE_GNU +#include "../../gcc.dg/strlenopt.h" void test (int *buf1, int *buf2, size_t len) { diff --git a/gcc/testsuite/gcc.target/i386/chkp-stropt-2.c b/gcc/testsuite/gcc.target/i386/chkp-stropt-2.c index cac0feaecbb..6a0c24ee887 100644 --- a/gcc/testsuite/gcc.target/i386/chkp-stropt-2.c +++ b/gcc/testsuite/gcc.target/i386/chkp-stropt-2.c @@ -2,7 +2,7 @@ /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkpopt -fchkp-use-nochk-string-functions" } */ /* { dg-final { scan-tree-dump "memset_nochk" "chkpopt" } } */ -#include "string.h" +#include "../../gcc.dg/strlenopt.h" void test (int *buf1, int c, size_t len) { diff --git a/gcc/testsuite/gcc.target/i386/chkp-stropt-3.c b/gcc/testsuite/gcc.target/i386/chkp-stropt-3.c index 72ff3869f7b..310dec77456 100644 --- a/gcc/testsuite/gcc.target/i386/chkp-stropt-3.c +++ b/gcc/testsuite/gcc.target/i386/chkp-stropt-3.c @@ -2,7 +2,7 @@ /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkpopt -fchkp-use-nochk-string-functions" } */ /* { dg-final { scan-tree-dump "memmove_nochk" "chkpopt" } } */ -#include "string.h" +#include "../../gcc.dg/strlenopt.h" void test (int *buf1, int *buf2, size_t len) { diff --git a/gcc/testsuite/gcc.target/i386/chkp-stropt-4.c b/gcc/testsuite/gcc.target/i386/chkp-stropt-4.c index 216ed521edb..7a30d17b8e6 100644 --- a/gcc/testsuite/gcc.target/i386/chkp-stropt-4.c +++ b/gcc/testsuite/gcc.target/i386/chkp-stropt-4.c @@ -3,8 +3,8 @@ /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkpopt -fchkp-use-nochk-string-functions" } */ /* { dg-final { scan-tree-dump "mempcpy_nochk" "chkpopt" } } */ -#define _GNU_SOURCE -#include "string.h" +#define USE_GNU +#include "../../gcc.dg/strlenopt.h" void test (int *buf1, int *buf2, size_t len) { diff --git a/gcc/testsuite/gcc.target/i386/chkp-stropt-5.c b/gcc/testsuite/gcc.target/i386/chkp-stropt-5.c index 02ad9ccc496..39850d62be8 100644 --- a/gcc/testsuite/gcc.target/i386/chkp-stropt-5.c +++ b/gcc/testsuite/gcc.target/i386/chkp-stropt-5.c @@ -2,7 +2,7 @@ /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkpopt -fchkp-use-fast-string-functions" } */ /* { dg-final { scan-tree-dump "memcpy_nobnd" "chkpopt" } } */ -#include "string.h" +#include "../../gcc.dg/strlenopt.h" void test (int *buf1, int *buf2, size_t len) { diff --git a/gcc/testsuite/gcc.target/i386/chkp-stropt-6.c b/gcc/testsuite/gcc.target/i386/chkp-stropt-6.c index 6db5d83a0bc..06dcbfb9a25 100644 --- a/gcc/testsuite/gcc.target/i386/chkp-stropt-6.c +++ b/gcc/testsuite/gcc.target/i386/chkp-stropt-6.c @@ -2,7 +2,7 @@ /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkpopt -fchkp-use-fast-string-functions" } */ /* { dg-final { scan-tree-dump "memset_nobnd" "chkpopt" } } */ -#include "string.h" +#include "../../gcc.dg/strlenopt.h" void test (int *buf1, int c, size_t len) { diff --git a/gcc/testsuite/gcc.target/i386/chkp-stropt-7.c b/gcc/testsuite/gcc.target/i386/chkp-stropt-7.c index 761e6263d86..40ded068f8e 100644 --- a/gcc/testsuite/gcc.target/i386/chkp-stropt-7.c +++ b/gcc/testsuite/gcc.target/i386/chkp-stropt-7.c @@ -2,7 +2,7 @@ /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkpopt -fchkp-use-fast-string-functions" } */ /* { dg-final { scan-tree-dump "memmove_nobnd" "chkpopt" } } */ -#include "string.h" +#include "../../gcc.dg/strlenopt.h" void test (int *buf1, int *buf2, size_t len) { diff --git a/gcc/testsuite/gcc.target/i386/chkp-stropt-8.c b/gcc/testsuite/gcc.target/i386/chkp-stropt-8.c index afde3c92b9f..7e575bb40bb 100644 --- a/gcc/testsuite/gcc.target/i386/chkp-stropt-8.c +++ b/gcc/testsuite/gcc.target/i386/chkp-stropt-8.c @@ -3,8 +3,8 @@ /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkpopt -fchkp-use-fast-string-functions" } */ /* { dg-final { scan-tree-dump "mempcpy_nobnd" "chkpopt" } } */ -#define _GNU_SOURCE -#include "string.h" +#define USE_GNU +#include "../../gcc.dg/strlenopt.h" void test (int *buf1, int *buf2, size_t len) { diff --git a/gcc/testsuite/gcc.target/i386/chkp-stropt-9.c b/gcc/testsuite/gcc.target/i386/chkp-stropt-9.c index b79d09633dd..bf26874e5a8 100644 --- a/gcc/testsuite/gcc.target/i386/chkp-stropt-9.c +++ b/gcc/testsuite/gcc.target/i386/chkp-stropt-9.c @@ -2,7 +2,7 @@ /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkpopt -fchkp-use-fast-string-functions" } */ /* { dg-final { scan-tree-dump-not "memcpy_nobnd" "chkpopt" } } */ -#include "string.h" +#include "../../gcc.dg/strlenopt.h" void test (void *buf1, void *buf2, size_t len) {