Hi, Attached patch fixes warnings in some of the SH test cases which are caused by the switch to GNU11. Committed as r216351.
Cheers, Oleg gcc/testsuite/ChangeLog: * 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.
Index: gcc/testsuite/gcc.target/sh/cmpstr.c =================================================================== --- gcc/testsuite/gcc.target/sh/cmpstr.c (revision 216350) +++ gcc/testsuite/gcc.target/sh/cmpstr.c (working copy) @@ -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 @@ /* 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)); Index: gcc/testsuite/gcc.target/sh/cmpstrn.c =================================================================== --- gcc/testsuite/gcc.target/sh/cmpstrn.c (revision 216350) +++ gcc/testsuite/gcc.target/sh/cmpstrn.c (working copy) @@ -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); } Index: gcc/testsuite/gcc.target/sh/hiconst.c =================================================================== --- gcc/testsuite/gcc.target/sh/hiconst.c (revision 216350) +++ gcc/testsuite/gcc.target/sh/hiconst.c (working copy) @@ -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 @@ *pti = 0; } -rab(char *pt, int *pti) +int rab (char *pt, int *pti) { pt[2] = 0; pti[3] = 0; Index: gcc/testsuite/gcc.target/sh/pr43417.c =================================================================== --- gcc/testsuite/gcc.target/sh/pr43417.c (revision 216350) +++ gcc/testsuite/gcc.target/sh/pr43417.c (working copy) @@ -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; Index: gcc/testsuite/gcc.target/sh/strlen.c =================================================================== --- gcc/testsuite/gcc.target/sh/strlen.c (revision 216350) +++ gcc/testsuite/gcc.target/sh/strlen.c (working copy) @@ -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)); } Index: gcc/testsuite/gcc.target/sh/pr51244-13.c =================================================================== --- gcc/testsuite/gcc.target/sh/pr51244-13.c (revision 216350) +++ gcc/testsuite/gcc.target/sh/pr51244-13.c (working copy) @@ -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 *next, *prev; }; +void list_add (struct list_head*, struct list_head*); + static inline void __list_del (struct list_head *prev, struct list_head *next) {