g++.dg/opt/strength-reduce.C...
authorNick Clifton <nickc@redhat.com>
Mon, 15 Nov 2004 13:33:38 +0000 (13:33 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Mon, 15 Nov 2004 13:33:38 +0000 (13:33 +0000)
g++.dg/opt/strength-reduce.C: Replace 0x7fffffff with __INT_MAX__ so that
the test can be compiled by toolchains targeted at 16-bit processors.

* gcc.dg/20040625-1.c: Use long constants rather than integers when
performing arithmetic that will overflow 16-bits.

* gcc.dg/i386-sse-8.c: Expect this test to fail for the xstormy16.
It does not support 128-bit vector operations.

* gcc.dg/ultrasp4.c: Replace all occurrences of the type 'long' with the
macro PTR_TYPE.  Define this macro to an integer type suitable for
holding a pointer.

* gcc.dg/compat/struct-align-1_x.c: Use shorter integers if the target
is a 16-bit processor.

* gcc.dg/cpp/if-2.c: Expect a different warning message from 16-bit
targets where the character constant will be too long.

* g++.dg/opt/asm1.C: Expect this test to fail on the xstormy16 where
the double will not be directly addressable.

From-SVN: r90667

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/asm1.C
gcc/testsuite/g++.dg/opt/strength-reduce.C
gcc/testsuite/gcc.c-torture/execute/simd-4.c
gcc/testsuite/gcc.dg/20040625-1.c
gcc/testsuite/gcc.dg/20040910-1.c
gcc/testsuite/gcc.dg/compat/struct-align-1_x.c
gcc/testsuite/gcc.dg/cpp/if-2.c
gcc/testsuite/gcc.dg/i386-sse-8.c
gcc/testsuite/gcc.dg/ultrasp4.c

index d3653718546c6ff3df52716dff003794a46815fe..76dd567d06fa667c5be2122b6294a75370bae0f2 100644 (file)
@@ -1,3 +1,28 @@
+2004-11-15  Nick Clifton  <nickc@redhat.com>
+
+       * g++.dg/opt/strength-reduce.C: Replace 0x7fffffff with
+       __INT_MAX__ so that the test can be compiled by toolchains
+       targeted at 16-bit processors.
+
+       * gcc.dg/20040625-1.c: Use long constants rather than integers
+       when performing arithmetic that will overflow 16-bits.
+
+       * gcc.dg/i386-sse-8.c: Expect this test to fail for the
+       xstormy16.  It does not support 128-bit vector operations.
+
+       * gcc.dg/ultrasp4.c: Replace all occurrences of the type 'long'
+       with the macro PTR_TYPE.  Define this macro to an integer type
+       suitable for holding a pointer.
+
+       * gcc.dg/compat/struct-align-1_x.c: Use shorter integers if
+       the target is a 16-bit processor.
+
+       * gcc.dg/cpp/if-2.c: Expect a different warning message from
+       16-bit targets where the character constant will be too long.
+
+       * g++.dg/opt/asm1.C: Expect this test to fail on the xstormy16
+       where the double will not be directly addressable.
+
 2004-11-15  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
 
        Friend class name lookup 1/n, PR c++/18471
index 3f932a6d70c3bebada9da1d3fee019bcc2a2935a..333533526ba0bd6a5ab782c378abebd50bf15e75 100644 (file)
@@ -5,5 +5,5 @@
 void foo()
 {
   union { double d; char c[sizeof(double)]; } tmp;
-  __asm__ ("" : "=m" (tmp.d)); // { dg-bogus "not directly addressable" }
+  __asm__ ("" : "=m" (tmp.d)); // { dg-bogus "not directly addressable" "double sized union element should be addressible" { xfail xstormy16-*-* } }
 }
index 7c4619a36fa0a57cbb60174b518b62345512f397..2dc6c01e853a5f3a852716e3dd96c8f11c1c6d1f 100644 (file)
@@ -8,7 +8,7 @@ extern "C" void abort (void);
 
 struct C
 {
-  int foo (char ch, int offset = 0x7fffffff) const;
+  int foo (char ch, int offset = __INT_MAX__) const;
   int bar (int offset, char c) const;
   char *a;
 };
@@ -27,14 +27,14 @@ int C::foo (char ch, int offset) const
 {
   int len = __builtin_strlen (a);
   if (len == 0)
-    return 0x7fffffff;
+    return __INT_MAX__;
   if (offset >= len)
     offset = len - 1;
 
   while (bar (offset, ch) != 0)
     {
       if (offset == 0)
-        return 0x7fffffff;
+        return __INT_MAX__;
       offset--;
     }
 
index 0d4481f7cef302239fb8ef1d526af45932e1a577..5942839b30a88ec292d1088408d34d89c06c6e1d 100644 (file)
@@ -1,4 +1,4 @@
-typedef int __attribute__((vector_size(8))) v2si;
+typedef long __attribute__((vector_size(8))) v2si;
 long long s64;
 
 static inline long long
@@ -9,7 +9,7 @@ __ev_convert_s64 (v2si a)
 
 int main()
 {
-  union { long long ll; int i[2]; } endianness_test;
+  union { long long ll; long i[2]; } endianness_test;
   endianness_test.ll = 1;
   int little_endian = endianness_test.i[0];
   s64 = __ev_convert_s64 ((v2si){1,0xffffffff});
index e05e87c9124556e1bf03f8cae78a1d3bf263f700..bbda6fd05fc0aa42aefb8beda2819ce41517e4b1 100644 (file)
@@ -22,7 +22,7 @@ test (void)
 {
   double x = foo ();
   x = bar (x);
-  x /= 1024 * 1024 * 1024;
+  x /= 1024L * 1024L * 1024L;
   x *= 70;
   x = x < 70 ? x : 70;
   x += 30;
index ff772ab57b4a73110fd4782b083cbc6b59d8140a..b89c95351b6dbe7c1f618bfbf7569dfb0eff6671 100644 (file)
@@ -1,2 +1,2 @@
 /* Tests error recovery for invalid code.  */
-__attribute__((foo)  int f (){} /* { dg-error "(parse error|syntax error|expected '\\)') before 'int'" } */
+__attribute__((foo)  int f (){} /* { dg-error "(parse error|syntax error|expected '\\)') before `int'" } */
index 6b99ceb002f747e29c57141bd24dcd30ef25a699..51b2ef44241256f0eac591456cbe198157888d5c 100644 (file)
@@ -63,14 +63,27 @@ return3_##NAME (void)                                       \
 
 #define CHECK(NAME) test_##NAME()
 
+#if __INT_MAX__ > 32767
 SETUP (orig, 49, 1.0, 111111)
+#else
+SETUP (orig, 49, 1.0, 1111)
+#endif
 #ifndef SKIP_ATTRIBUTE
+#if __INT_MAX__ > 32767
 SETUP (p_all, 50, 2.0, 222222)
 SETUP (p_inner, 51, 3.0, 333333)
 SETUP (p_outer, 52, 4.0, 444444)
 SETUP (a_max, 53, 5.0, 555555)
 SETUP (m_outer_p_inner, 54, 6.0, 666666)
-SETUP (m_inner_p_outer, 55, 7.0, 777777) 
+SETUP (m_inner_p_outer, 55, 7.0, 777777)
+#else
+SETUP (p_all, 50, 2.0, 2222)
+SETUP (p_inner, 51, 3.0, 3333)
+SETUP (p_outer, 52, 4.0, 4444)
+SETUP (a_max, 53, 5.0, 5555)
+SETUP (m_outer_p_inner, 54, 6.0, 6666)
+SETUP (m_inner_p_outer, 55, 7.0, 7777)
+#endif
 #endif
 
 void
index 866d25c3a60605ce7cd927d5d7d4c189d0ada48b..8bca251b46b8415ddce899e87b293ae5ad49fe2d 100644 (file)
@@ -17,7 +17,8 @@
 #error 0x1234  /* { dg-bogus "error" "wide charconst recognition 3" } */
 #endif
 
-#if 'abcd' /* { dg-warning "multi-character character constant" "multi-character charconst" } */
+/* The 'character constant (is )?too long' message is produced by 16-bit targets.  */
+#if 'abcd' /* { dg-warning "(multi-character character constant)|(character constant (is )?too long)" "multi-character charconst" } */
 #endif
 
 #if 'abcdefghi' /* { dg-error "character constant (is )?too long" "charconst too long" } */
index e74f0c0f6792c7c4f9789a9fe46190e5e23a34f4..3197e99a24c0813bd49f23ec11449e6ffab282b1 100644 (file)
@@ -1,7 +1,8 @@
 /* PR target/14313 */
 /* Origin: <Pawe Sikora <pluto@ds14.agh.edu.pl> */
 
-/* { dg-do compile } */
+/* The xstormy16 doesn't support V2DI.  */
+/* { dg-do compile { xfail xstormy16-*-* } } */
 /* { dg-options "" } */
 /* { dg-options "-march=pentium3" { target i?86-*-* } } */
 /* { dg-forbid-option "-m64" { target i?86-*-* } } */
index 6cd08b23d712582762214cd82d1f613373b6c0b8..1c72d0659d4fa0b3c31a2902235266ba73ba3b0a 100644 (file)
@@ -3,8 +3,19 @@
 /* { dg-options "-O2" } */
 /* { dg-options "-O2 -mcpu=ultrasparc" { target sparc64-*-* sparcv9-*-* } } */
 
-long bar (unsigned int);
-long foo (long x, unsigned int y)
+#if __INT_MAX__ > 32767
+#define PTR_TYPE long
+#else
+/* For 16-bit ports a long is a 32-bit quantity.  So you cannot
+   cast a 32-bit long integer into a pointer which will only be
+   16-bits long.  */
+#define PTR_TYPE int
+#endif
+
+extern PTR_TYPE bar (unsigned int);
+
+PTR_TYPE
+foo (PTR_TYPE x, unsigned int y)
 {
-  return *(((long *) (bar (y) - 1)) + 1 + (x >> 2) % 359);
+  return *(((PTR_TYPE *) (bar (y) - 1)) + 1 + (x >> 2) % 359);
 }