summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/testsuite/ChangeLog25
-rw-r--r--gcc/testsuite/g++.dg/opt/asm1.C2
-rw-r--r--gcc/testsuite/g++.dg/opt/strength-reduce.C6
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/simd-4.c4
-rw-r--r--gcc/testsuite/gcc.dg/20040625-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/20040910-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-align-1_x.c15
-rw-r--r--gcc/testsuite/gcc.dg/cpp/if-2.c3
-rw-r--r--gcc/testsuite/gcc.dg/i386-sse-8.c3
-rw-r--r--gcc/testsuite/gcc.dg/ultrasp4.c17
10 files changed, 65 insertions, 14 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d3653718546..76dd567d06f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
diff --git a/gcc/testsuite/g++.dg/opt/asm1.C b/gcc/testsuite/g++.dg/opt/asm1.C
index 3f932a6d70c..333533526ba 100644
--- a/gcc/testsuite/g++.dg/opt/asm1.C
+++ b/gcc/testsuite/g++.dg/opt/asm1.C
@@ -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-*-* } }
}
diff --git a/gcc/testsuite/g++.dg/opt/strength-reduce.C b/gcc/testsuite/g++.dg/opt/strength-reduce.C
index 7c4619a36fa..2dc6c01e853 100644
--- a/gcc/testsuite/g++.dg/opt/strength-reduce.C
+++ b/gcc/testsuite/g++.dg/opt/strength-reduce.C
@@ -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--;
}
diff --git a/gcc/testsuite/gcc.c-torture/execute/simd-4.c b/gcc/testsuite/gcc.c-torture/execute/simd-4.c
index 0d4481f7cef..5942839b30a 100644
--- a/gcc/testsuite/gcc.c-torture/execute/simd-4.c
+++ b/gcc/testsuite/gcc.c-torture/execute/simd-4.c
@@ -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});
diff --git a/gcc/testsuite/gcc.dg/20040625-1.c b/gcc/testsuite/gcc.dg/20040625-1.c
index e05e87c9124..bbda6fd05fc 100644
--- a/gcc/testsuite/gcc.dg/20040625-1.c
+++ b/gcc/testsuite/gcc.dg/20040625-1.c
@@ -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;
diff --git a/gcc/testsuite/gcc.dg/20040910-1.c b/gcc/testsuite/gcc.dg/20040910-1.c
index ff772ab57b4..b89c95351b6 100644
--- a/gcc/testsuite/gcc.dg/20040910-1.c
+++ b/gcc/testsuite/gcc.dg/20040910-1.c
@@ -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'" } */
diff --git a/gcc/testsuite/gcc.dg/compat/struct-align-1_x.c b/gcc/testsuite/gcc.dg/compat/struct-align-1_x.c
index 6b99ceb002f..51b2ef44241 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-align-1_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-align-1_x.c
@@ -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
diff --git a/gcc/testsuite/gcc.dg/cpp/if-2.c b/gcc/testsuite/gcc.dg/cpp/if-2.c
index 866d25c3a60..8bca251b46b 100644
--- a/gcc/testsuite/gcc.dg/cpp/if-2.c
+++ b/gcc/testsuite/gcc.dg/cpp/if-2.c
@@ -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" } */
diff --git a/gcc/testsuite/gcc.dg/i386-sse-8.c b/gcc/testsuite/gcc.dg/i386-sse-8.c
index e74f0c0f679..3197e99a24c 100644
--- a/gcc/testsuite/gcc.dg/i386-sse-8.c
+++ b/gcc/testsuite/gcc.dg/i386-sse-8.c
@@ -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-*-* } } */
diff --git a/gcc/testsuite/gcc.dg/ultrasp4.c b/gcc/testsuite/gcc.dg/ultrasp4.c
index 6cd08b23d71..1c72d0659d4 100644
--- a/gcc/testsuite/gcc.dg/ultrasp4.c
+++ b/gcc/testsuite/gcc.dg/ultrasp4.c
@@ -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);
}