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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90667
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
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-*-* } }
}
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;
};
{
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--;
}
-typedef int __attribute__((vector_size(8))) v2si;
+typedef long __attribute__((vector_size(8))) v2si;
long long s64;
static inline long long
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});
{
double x = foo ();
x = bar (x);
- x /= 1024 * 1024 * 1024;
+ x /= 1024L * 1024L * 1024L;
x *= 70;
x = x < 70 ? x : 70;
x += 30;
/* 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'" } */
#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
#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" } */
/* 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-*-* } } */
/* { 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);
}