Fix some fallout for small targets.
authorGeorg-Johann Lay <avr@gjlay.de>
Fri, 18 Oct 2019 06:46:03 +0000 (06:46 +0000)
committerGeorg-Johann Lay <gjl@gcc.gnu.org>
Fri, 18 Oct 2019 06:46:03 +0000 (06:46 +0000)
gcc/testsuite/
Fix some fallout for small targets.

PR testsuite/52641
* gcc.c-torture/execute/20190820-1.c:
Add dg-require-effective-target int32plus.
* gcc.c-torture/execute/pr85331.c
Add dg-require-effective-target double64plus.
* gcc.dg/pow-sqrt-1.c: Same.
* gcc.dg/pow-sqrt-2.c: Same.
* gcc.dg/pow-sqrt-3.c: Same.
* gcc.c-torture/execute/20190901-1.c: Same.
* gcc.c-torture/execute/user-printf.c [avr]: Skip.
* gcc.c-torture/execute/fprintf-2.c [avr]: Skip.
* gcc.c-torture/execute/printf-2.c [avr]: Skip.
* gcc.dg/Wlarger-than3.c [avr]: Skip.
* gcc.c-torture/execute/ieee/20041213-1.c (sqrt)
[avr,double=float]: Provide custom prototype.
* gcc.dg/pr36017.c: Same.
* gcc.c-torture/execute/pr90025.c: Use 32-bit int.
* gcc.dg/complex-7.c: Add dg-require-effective-target double64.
* gcc.dg/loop-versioning-1.c:
Add dg-require-effective-target size32plus.
* gcc.dg/loop-versioning-2.c: Same.

From-SVN: r277142

17 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20190820-1.c
gcc/testsuite/gcc.c-torture/execute/20190901-1.c
gcc/testsuite/gcc.c-torture/execute/fprintf-2.c
gcc/testsuite/gcc.c-torture/execute/ieee/20041213-1.c
gcc/testsuite/gcc.c-torture/execute/pr85331.c
gcc/testsuite/gcc.c-torture/execute/pr90025.c
gcc/testsuite/gcc.c-torture/execute/printf-2.c
gcc/testsuite/gcc.c-torture/execute/user-printf.c
gcc/testsuite/gcc.dg/Wlarger-than3.c
gcc/testsuite/gcc.dg/complex-7.c
gcc/testsuite/gcc.dg/loop-versioning-1.c
gcc/testsuite/gcc.dg/loop-versioning-2.c
gcc/testsuite/gcc.dg/pow-sqrt-1.c
gcc/testsuite/gcc.dg/pow-sqrt-2.c
gcc/testsuite/gcc.dg/pow-sqrt-3.c
gcc/testsuite/gcc.dg/pr36017.c

index fc6345794682d1ec692af40f9776117ea9384f3f..b783c8dede37411a449dd488aa43b62c529620f3 100644 (file)
@@ -1,3 +1,29 @@
+2019-10-18  Georg-Johann Lay  <avr@gjlay.de>
+
+       Fix some fallout for small targets.
+
+       PR testsuite/52641
+       * gcc.c-torture/execute/20190820-1.c:
+       Add dg-require-effective-target int32plus.
+       * gcc.c-torture/execute/pr85331.c
+       Add dg-require-effective-target double64plus.
+       * gcc.dg/pow-sqrt-1.c: Same.
+       * gcc.dg/pow-sqrt-2.c: Same.
+       * gcc.dg/pow-sqrt-3.c: Same.
+       * gcc.c-torture/execute/20190901-1.c: Same.
+       * gcc.c-torture/execute/user-printf.c [avr]: Skip.
+       * gcc.c-torture/execute/fprintf-2.c [avr]: Skip.
+       * gcc.c-torture/execute/printf-2.c [avr]: Skip.
+       * gcc.dg/Wlarger-than3.c [avr]: Skip.
+       * gcc.c-torture/execute/ieee/20041213-1.c (sqrt)
+       [avr,double=float]: Provide custom prototype.
+       * gcc.dg/pr36017.c: Same.
+       * gcc.c-torture/execute/pr90025.c: Use 32-bit int.
+       * gcc.dg/complex-7.c: Add dg-require-effective-target double64.
+       * gcc.dg/loop-versioning-1.c:
+       Add dg-require-effective-target size32plus.
+       * gcc.dg/loop-versioning-2.c: Same.
+
 2019-10-18  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
            Richard Sandiford  <richard.sandiford@arm.com>
 
index 6a06eff757143597189ebe1f0668d5673a382731..10e48d35750f947e6a66a6a314b8d41ef1c0cf89 100644 (file)
@@ -1,5 +1,6 @@
 /* PR rtl-optimization/91347 */\r
 /* Reported by John David Anglin <danglin@gcc.gnu.org> */\r
+/* { dg-require-effective-target int32plus } */\r
 \r
 typedef unsigned short __u16;\r
 typedef __signed__ int __s32;\r
index c78715ef2c17459ef5718674a68d79fcee52efb5..2345e51896f2eedca0e65de7fd7b6f522bf1b880 100644 (file)
@@ -1,7 +1,12 @@
 /* PR target/91472 */
 /* Reported by John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> */
+/* { dg-require-effective-target double64plus } */
 
+#if __SIZEOF_INT__ >= 4
 typedef unsigned int gmp_uint_least32_t;
+#else
+typedef __UINT_LEAST32_TYPE__ gmp_uint_least32_t;
+#endif
 
 union ieee_double_extract
 {
index bba4a446ee95822540866462ee5cab8dfc10598b..7280b9b5e3cf11ae2e5905fc80e96275eacc9a4f 100644 (file)
@@ -1,6 +1,7 @@
 /* Verify that calls to fprintf don't get eliminated even if their
    result on success can be computed at compile time (they can fail).
    The calls can still be transformed into those of other functions.
+   { dg-skip-if "requires io" { avr-*-* } }
    { dg-skip-if "requires io" { freestanding } } */
 
 #include <stdio.h>
index 07bdf6860d4ec2a73f1615c2eff19bd328eb53f0..6830359e1f901dc301a1f45fa2a874b50bbff016 100644 (file)
@@ -1,4 +1,8 @@
+#if defined (__AVR__) && (__SIZEOF_DOUBLE__ == __SIZEOF_FLOAT__)
+extern double sqrt (double) __asm ("sqrtf");
+#else
 extern double sqrt (double);
+#endif
 extern void abort (void);
 int once;
 
index 3ef805a289e3debf1ff74c6b7b4dc4a859218b6e..e0c426f81dafb49494bc8c71813c3140b60b0304 100644 (file)
@@ -1,4 +1,5 @@
 /* PR tree-optimization/85331 */
+/* { dg-require-effective-target double64plus } */
 
 typedef double V __attribute__((vector_size (2 * sizeof (double))));
 typedef long long W __attribute__((vector_size (2 * sizeof (long long))));
index a1ddd0027d66bd0eb84f890e8777aa14482b50de..052d97c7fc2574fab1a8f1fe407fa924a9a35872 100644 (file)
@@ -13,10 +13,10 @@ bar (char *p)
 }
 
 __attribute__((noipa)) void
-foo (unsigned int x)
+foo (__UINT32_TYPE__ x)
 {
   char s[32] = { 'f', 'o', 'o', 'b', 'a', 'r', 0 };
-  ((unsigned int *) s)[2] = __builtin_bswap32 (x);
+  ((__UINT32_TYPE__ *) s)[2] = __builtin_bswap32 (x);
   bar (s);
 }
 
index 2e9f2a2bb755221ec49baccccad0737e51f579bf..c2d729a665cb0376b5647c88374cae4006c351da 100644 (file)
@@ -2,6 +2,7 @@
    result on success can be computed at compile time (they can fail).
    The calls can still be transformed into those of other functions.
    { dg-require-effective-target unwrapped }
+   { dg-skip-if "requires io" { avr-*-* } }
    { dg-skip-if "requires io" { freestanding } } */
 
 #include <stdio.h>
index 11c61fa3949e962595ca7142bbcecb774fb8231f..0f81bec60b7bd7b8d1a65c6687d01bfd73db4d1d 100644 (file)
@@ -2,6 +2,7 @@
    don't get eliminated even if their result on success can be computed at
    compile time (they can fail).
    { dg-require-effective-target unwrapped }
+   { dg-skip-if "requires io" { avr-*-* } }
    { dg-skip-if "requires io" { freestanding } } */
 
 #include <stdarg.h>
index ebac525ed62d05e5617131b57e4c8bea8b800a9f..17af07b72e2fba115cd90b76aa600004c6c07c9a 100644 (file)
@@ -1,6 +1,6 @@
 /* Exercise -Wlarger-than= with a byte-size suffix.
    { dg-do compile }
-   { dg-skip-if "small address space" { "pdp11-*-*" } }
+   { dg-skip-if "small address space" { "pdp11-*-*" } { "avr-*-*" } }
    { dg-options "-Wlarger-than=1MiB" } */
 
 #define MB (1000 * 1000)    /* MegaByte */
index 78f1a290e34af0c092a00639d979bc32b332b1da..a1f136ce9a23ca248ec6a9f409c9905950b81126 100644 (file)
@@ -2,6 +2,7 @@
 
 /* { dg-do compile } */
 /* { dg-options "-O2 -fdump-tree-cplxlower" } */
+/* { dg-require-effective-target double64 } */
 
 __complex double
 foo (__complex double a, __complex double b)
index e61ff7a5d107977ba25d5dc1f660bcfaca0c61ad..17e95fdfbab3266e76c1ca93f5e92e3e9b1d97bf 100644 (file)
@@ -1,4 +1,5 @@
 /* { dg-options "-O3 -fdump-tree-lversion-details" } */
+/* { dg-require-effective-target size32plus } */
 
 /* The simplest IV case.  */
 
index 9416b540614b8b8f6291a7b4758022f0e2c94ae1..3d07f83d20544abc0944156ac7d9e4c8384fa9a9 100644 (file)
@@ -1,4 +1,5 @@
 /* { dg-options "-O3 -fdump-tree-lversion-details" } */
+/* { dg-require-effective-target size32plus } */
 
 /* Versioning for step == 1 in these loops would allow loop interchange,
    but otherwise isn't worthwhile.  At the moment we decide not to version.  */
index 0793b6f9eaf8100d50e20b2db5375d3da16158e7..17003c5d71c5ed21604feba5c7c40a0c011ccefc 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -ffast-math --param max-pow-sqrt-depth=5" } */
+/* { dg-require-effective-target double64plus } */
 
 #define EXPN (-6 * (0.5*0.5*0.5*0.5))
 
index b2fada49e85316a4490684d1d25901a0ef06b4d2..96d7ce9c8cff0fa2c69690a6951555f88295c916 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -ffast-math --param max-pow-sqrt-depth=5" } */
+/* { dg-require-effective-target double64plus } */
 
 #define EXPN (-5.875)
 #include "pow-sqrt.x"
index 18c7231a5bbb5bfb6a0ac250df6975c3862ae6bf..c166586ac6317fe95e1446db2d43f8ef0a9ec36f 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -ffast-math --param max-pow-sqrt-depth=3" } */
+/* { dg-require-effective-target double64plus } */
 
 #define EXPN (1.25)
 #include "pow-sqrt.x"
index 2af71e6006e80058c2acbe19b5e0de7bfe0662f7..d18c97ddfadb16c055074ad19ac8f214f4b342da 100644 (file)
@@ -2,7 +2,11 @@
 /* { dg-do run } */
 /* { dg-options "-O2" } */
 
+#if defined (__AVR__) && (__SIZEOF_DOUBLE__ == __SIZEOF_FLOAT__)
+extern double sqrt (double) __asm ("sqrtf");
+#else
 extern double sqrt (double);
+#endif
 extern void abort (void);
 
 __attribute__((noinline)) double