From e4c6530e821ba32c47802cecdb5817995a8b4027 Mon Sep 17 00:00:00 2001 From: Oleg Endo Date: Thu, 16 Oct 2014 21:40:22 +0000 Subject: [PATCH] cmpstr.c: Fix excess failures caused by switch to GNU11. gcc/testsuite/ * gcc.target/sh/cmpstr.c: Fix excess failures caused by switch to GNU11. * gcc.target/sh/strlen.c: Likewise. * gcc.target/sh/pr51244-13.c: Likewise. * gcc.target/sh/cmpstrn.c: Likewise. * gcc.target/sh/hiconst.c: Likewise. * gcc.target/sh/pr43417.c: Likewise. From-SVN: r216351 --- gcc/testsuite/ChangeLog | 9 +++++++++ gcc/testsuite/gcc.target/sh/cmpstr.c | 7 +++++-- gcc/testsuite/gcc.target/sh/cmpstrn.c | 9 ++++++--- gcc/testsuite/gcc.target/sh/hiconst.c | 5 +++-- gcc/testsuite/gcc.target/sh/pr43417.c | 11 +++++++++-- gcc/testsuite/gcc.target/sh/pr51244-13.c | 6 ++++++ gcc/testsuite/gcc.target/sh/strlen.c | 4 +++- 7 files changed, 41 insertions(+), 10 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 13af086750a..7f159c65e7f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2014-10-16 Oleg Endo + + * gcc.target/sh/cmpstr.c: Fix excess failures caused by switch to GNU11. + * gcc.target/sh/strlen.c: Likewise. + * gcc.target/sh/pr51244-13.c: Likewise. + * gcc.target/sh/cmpstrn.c: Likewise. + * gcc.target/sh/hiconst.c: Likewise. + * gcc.target/sh/pr43417.c: Likewise. + 2014-10-16 Martin Liska * gcc.dg/guality/pr43077-1.c: IPA ICF disabled diff --git a/gcc/testsuite/gcc.target/sh/cmpstr.c b/gcc/testsuite/gcc.target/sh/cmpstr.c index 4d638cc3e70..1b450899e1f 100644 --- a/gcc/testsuite/gcc.target/sh/cmpstr.c +++ b/gcc/testsuite/gcc.target/sh/cmpstr.c @@ -7,6 +7,7 @@ /* { dg-final { scan-assembler-times "cmp/str" 3 } } */ /* { dg-final { scan-assembler-times "tst\t#3" 2 } } */ +int test00 (const char *s1, const char *s2) { return __builtin_strcmp (s1, s2); @@ -14,13 +15,15 @@ test00 (const char *s1, const char *s2) /* NB: This might change as further optimisation might detect the max length and fallback to cmpstrn. */ -test01(const char *s2) +int +test01 (const char *s2) { return __builtin_strcmp ("abc", s2); } /* Check that no test for alignment is needed. */ -test03(const char *s1, const char *s2) +int +test03 (const char *s1, const char *s2) { return __builtin_strcmp (__builtin_assume_aligned (s1, 4), __builtin_assume_aligned (s2, 4)); diff --git a/gcc/testsuite/gcc.target/sh/cmpstrn.c b/gcc/testsuite/gcc.target/sh/cmpstrn.c index 3a1d0d1519f..65cb9d6ba4e 100644 --- a/gcc/testsuite/gcc.target/sh/cmpstrn.c +++ b/gcc/testsuite/gcc.target/sh/cmpstrn.c @@ -7,19 +7,22 @@ /* { dg-final { scan-assembler-times "cmp/str" 1 } } */ /* Test that cmp/str is not used for small lengths. */ -test01(const char *s1) +int +test01 (const char *s1) { return __builtin_strncmp (s1, "abcde", 3); } /* Test that the cmp/str loop is used. */ -test02(const char *s1) +int +test02 (const char *s1) { return __builtin_strncmp (s1, "abcdefghi", 8); } /* Test that no call is generated */ -test03(const char *s1, int n) +int +test03 (const char *s1, int n) { return __builtin_strncmp (s1, "abcde", n); } diff --git a/gcc/testsuite/gcc.target/sh/hiconst.c b/gcc/testsuite/gcc.target/sh/hiconst.c index d471d20364e..778bb8a3d2e 100644 --- a/gcc/testsuite/gcc.target/sh/hiconst.c +++ b/gcc/testsuite/gcc.target/sh/hiconst.c @@ -4,7 +4,8 @@ char a; int b; -foo(char *pt, int *pti) +int +foo (char *pt, int *pti) { a = 0; b = 0; @@ -12,7 +13,7 @@ foo(char *pt, int *pti) *pti = 0; } -rab(char *pt, int *pti) +int rab (char *pt, int *pti) { pt[2] = 0; pti[3] = 0; diff --git a/gcc/testsuite/gcc.target/sh/pr43417.c b/gcc/testsuite/gcc.target/sh/pr43417.c index 081ff46b998..67b1158950b 100644 --- a/gcc/testsuite/gcc.target/sh/pr43417.c +++ b/gcc/testsuite/gcc.target/sh/pr43417.c @@ -2,11 +2,18 @@ /* { dg-options "-O2 -m4" } */ int pid_count = 0; -main (int argc, char *argv[]) + +unsigned int getopt (int, const char**, const char*); +unsigned long long atoll (const char*); +int fork (void); +void kill (int, int); + +int +main (int argc, const char *argv[]) { unsigned int c; unsigned long long maxbytes = 0; - extern char *optarg; + extern const char *optarg; int i; int pid_cntr; int pid; diff --git a/gcc/testsuite/gcc.target/sh/pr51244-13.c b/gcc/testsuite/gcc.target/sh/pr51244-13.c index 41d23eb9438..f9a851d68f1 100644 --- a/gcc/testsuite/gcc.target/sh/pr51244-13.c +++ b/gcc/testsuite/gcc.target/sh/pr51244-13.c @@ -13,6 +13,10 @@ /* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */ /* { dg-final { scan-assembler-times "tst" 2 } } */ +void printk (const char*, const char*, int); +void __constant_set_bit (int, unsigned long int*); +void __set_bit (int, unsigned long int*); + static __inline__ int __test_bit (unsigned long nr, volatile void * addr) { @@ -32,6 +36,8 @@ struct list_head struct list_head *next, *prev; }; +void list_add (struct list_head*, struct list_head*); + static inline void __list_del (struct list_head *prev, struct list_head *next) { diff --git a/gcc/testsuite/gcc.target/sh/strlen.c b/gcc/testsuite/gcc.target/sh/strlen.c index 115baba99cd..7f2d5195443 100644 --- a/gcc/testsuite/gcc.target/sh/strlen.c +++ b/gcc/testsuite/gcc.target/sh/strlen.c @@ -7,13 +7,15 @@ /* { dg-final { scan-assembler-times "cmp/str" 2 } } */ /* { dg-final { scan-assembler-times "tst\t#3" 1 } } */ +int test00 (const char *s1) { return __builtin_strlen (s1); } /* Check that no test for alignment is needed. */ -test03(const char *s1) +int +test03 (const char *s1) { return __builtin_strlen (__builtin_assume_aligned (s1, 4)); }