Commit 77cacee4 by Andy Hutchinson Committed by Andy Hutchinson

limits-fndefn.c: Skip for AVR.

* gcc.c-torture/compile/limits-fndefn.c: Skip for AVR.
* gcc.dg/builtins-config.h: Use standard independent __AVR__ symbol.
* gcc.dg/cdce1.c: Skip for AVR.
* gcc.dg/cdce2.c: Ditto.
* gcc.dg/fold-bitand-1.c: Ignore warnings such as alignment.
* gcc.dg/fold-eqandshift-3.c: Use long on AVR.
* gcc.dg/fold-overflow-1.c: Skip for AVR.
* gcc.dg/multiple-overflow-warn-3.c: Use target independent macro for ms bit position.
* gcc.dg/pch/struct-1.c: Allow for target without 32 bit int.
* gcc.dg/tree-ssa/pr33920.c: Add warning check for AVR.
* gcc.dg/ucnid-5.c: Skip for AVR.
* gcc.dg/Wconversion-5.c: Mark warning xfail for AVR target.
* gcc.dg/Wconversion-real-integer.c: Skip for AVR.
* gcc.dg/Wconversion-real.c: Ditto.
* gcc.dg/wtr-conversion-1.c: Add warning test for AVR.
* gcc.dg/utf-cvt.c: Skip tests and mark excess xfail for AVR.
* gcc.dg/Wtype-limits-Wextra.c: Ditto.
* gcc.dg/Wtype-limits.c: Ditto.

From-SVN: r136918
parent 0cf7fb1f
2008-06-18 Andy Hutchinson <hutchinsonandy@aim.com>
* gcc.c-torture/compile/limits-fndefn.c: Skip for AVR.
* gcc.dg/builtins-config.h: Use standard independent __AVR__ symbol.
* gcc.dg/cdce1.c: Skip for AVR.
* gcc.dg/cdce2.c: Ditto.
* gcc.dg/fold-bitand-1.c: Ignore warnings such as alignment.
* gcc.dg/fold-eqandshift-3.c: Use long on AVR.
* gcc.dg/fold-overflow-1.c: Skip for AVR.
* gcc.dg/multiple-overflow-warn-3.c: Use target independent macro for ms bit position.
* gcc.dg/pch/struct-1.c: Allow for target without 32 bit int.
* gcc.dg/tree-ssa/pr33920.c: Add warning check for AVR.
* gcc.dg/ucnid-5.c: Skip for AVR.
* gcc.dg/Wconversion-5.c: Mark warning xfail for AVR target.
* gcc.dg/Wconversion-real-integer.c: Skip for AVR.
* gcc.dg/Wconversion-real.c: Ditto.
* gcc.dg/wtr-conversion-1.c: Add warning test for AVR.
* gcc.dg/utf-cvt.c: Skip tests and mark excess xfail for AVR.
* gcc.dg/Wtype-limits-Wextra.c: Ditto.
* gcc.dg/Wtype-limits.c: Ditto.
2008-06-18 Joseph Myers <joseph@codesourcery.com> 2008-06-18 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/dfp/convert-bfp-6.c, gcc.dg/dfp/convert-bfp-9.c: XFAIL * gcc.dg/dfp/convert-bfp-6.c, gcc.dg/dfp/convert-bfp-9.c: XFAIL
......
/* { dg-skip-if "too complex for avr" { "avr-*-*" } { "*" } { "" } } */
#define LIM1(x) x##0, x##1, x##2, x##3, x##4, x##5, x##6, x##7, x##8, x##9, #define LIM1(x) x##0, x##1, x##2, x##3, x##4, x##5, x##6, x##7, x##8, x##9,
#define LIM2(x) LIM1(x##0) LIM1(x##1) LIM1(x##2) LIM1(x##3) LIM1(x##4) \ #define LIM2(x) LIM1(x##0) LIM1(x##1) LIM1(x##2) LIM1(x##3) LIM1(x##4) \
LIM1(x##5) LIM1(x##6) LIM1(x##7) LIM1(x##8) LIM1(x##9) LIM1(x##5) LIM1(x##6) LIM1(x##7) LIM1(x##8) LIM1(x##9)
......
...@@ -19,7 +19,7 @@ void test1 (void) ...@@ -19,7 +19,7 @@ void test1 (void)
unsigned char f = (int) uc; unsigned char f = (int) uc;
signed char g = (int) sc; signed char g = (int) sc;
unsigned char h = (unsigned int) (short int) uc; unsigned char h = (unsigned int) (short int) uc;
signed char i = (int) (unsigned short int) sc; /* { dg-warning "may alter its value" } */ signed char i = (int) (unsigned short int) sc; /* { dg-warning "may alter its value" "" { xfail avr-*-* } } */
unsigned char j = (unsigned int) (short int) us; /* { dg-warning "may alter its value" } */ unsigned char j = (unsigned int) (short int) us; /* { dg-warning "may alter its value" } */
signed char k = (int) (unsigned short int) ss; /* { dg-warning "may alter its value" } */ signed char k = (int) (unsigned short int) ss; /* { dg-warning "may alter its value" } */
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
integers. */ integers. */
/* { dg-do compile } /* { dg-do compile }
/* { dg-skip-if "doubles are floats,ints are 16bits" { "avr-*-*" } { "*" } { "" } } */
/* { dg-options "-std=c99 -Wconversion" } */ /* { dg-options "-std=c99 -Wconversion" } */
#include <limits.h> #include <limits.h>
...@@ -70,3 +71,4 @@ void h (void) ...@@ -70,3 +71,4 @@ void h (void)
} }
/* Test for diagnostics for Wconversion for floating-point. */ /* Test for diagnostics for Wconversion for floating-point. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-skip-if "doubles are floats" { "avr-*-*" } { "*" } { "" } } */
/* { dg-options "-std=c99 -Wconversion" } */ /* { dg-options "-std=c99 -Wconversion" } */
float vfloat; float vfloat;
......
/* Test that -Wtype-limits is enabled by -Wextra */ /* Test that -Wtype-limits is enabled by -Wextra */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-excess-errors "short=int" { target { avr-*-* } } } */
/* { dg-options "-Wextra" } */ /* { dg-options "-Wextra" } */
void a (unsigned char x) void a (unsigned char x)
{ {
if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" } */ if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" } */
...@@ -22,10 +22,10 @@ void a (unsigned char x) ...@@ -22,10 +22,10 @@ void a (unsigned char x)
void b (unsigned short x) void b (unsigned short x)
{ {
if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" } */ if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" "" { target { ! "avr-*-*" } } } */
if (x >= 0) return;/* { dg-warning "comparison is always true due to limited range of data type" } */ if (x >= 0) return;/* { dg-warning "comparison is always true due to limited range of data type" "" { target { ! "avr-*-*" } } } */
if (0 > x) return;/* { dg-warning "comparison is always false due to limited range of data type" } */ if (0 > x) return;/* { dg-warning "comparison is always false due to limited range of data type" "" { target { ! "avr-*-*" } } } */
if (0 <= x) return;/* { dg-warning "comparison is always true due to limited range of data type" } */ if (0 <= x) return;/* { dg-warning "comparison is always true due to limited range of data type" "" { target { ! "avr-*-*" } } } */
} }
void c (unsigned int x) void c (unsigned int x)
...@@ -64,3 +64,4 @@ int test (int x) ...@@ -64,3 +64,4 @@ int test (int x)
return 0; return 0;
} }
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-excess-errors "short=int" { target { avr-*-* } } } */
/* { dg-options "-Wtype-limits" } */ /* { dg-options "-Wtype-limits" } */
void a (unsigned char x) void a (unsigned char x)
{ {
if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" } */ if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" } */
...@@ -22,10 +22,10 @@ void a (unsigned char x) ...@@ -22,10 +22,10 @@ void a (unsigned char x)
void b (unsigned short x) void b (unsigned short x)
{ {
if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" } */ if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" "" { target { ! "avr-*-*" } } } */
if (x >= 0) return;/* { dg-warning "comparison is always true due to limited range of data type" } */ if (x >= 0) return;/* { dg-warning "comparison is always true due to limited range of data type" "" { target { ! "avr-*-*" } } } */
if (0 > x) return;/* { dg-warning "comparison is always false due to limited range of data type" } */ if (0 > x) return;/* { dg-warning "comparison is always false due to limited range of data type" "" { target { ! "avr-*-*" } } } */
if (0 <= x) return;/* { dg-warning "comparison is always true due to limited range of data type" } */ if (0 <= x) return;/* { dg-warning "comparison is always true due to limited range of data type" "" { target { ! "avr-*-*" } } } */
} }
void c (unsigned int x) void c (unsigned int x)
...@@ -64,3 +64,4 @@ int test (int x) ...@@ -64,3 +64,4 @@ int test (int x)
return 0; return 0;
} }
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/* PA HP-UX doesn't have the entire C99 runtime. */ /* PA HP-UX doesn't have the entire C99 runtime. */
#elif defined(__sgi) #elif defined(__sgi)
/* Irix6 doesn't have the entire C99 runtime. */ /* Irix6 doesn't have the entire C99 runtime. */
#elif defined(AVR) #elif defined(__AVR__)
/* AVR doesn't have the entire C99 runtime. */ /* AVR doesn't have the entire C99 runtime. */
#elif defined(__FreeBSD__) && (__FreeBSD__ < 5) #elif defined(__FreeBSD__) && (__FreeBSD__ < 5)
/* FreeBSD before version 5 doesn't have the entire C99 runtime. */ /* FreeBSD before version 5 doesn't have the entire C99 runtime. */
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-skip-if "doubles are floats" { "avr-*-*" } { "*" } { "" } } */
/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -lm" } */ /* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -lm" } */
/* { dg-final { scan-tree-dump "cdce1.c:16: note: function call is shrink-wrapped into error conditions\." "cdce" } } */ /* { dg-final { scan-tree-dump "cdce1.c:16: note: function call is shrink-wrapped into error conditions\." "cdce" } } */
/* { dg-final { cleanup-tree-dump "cdce" } } */ /* { dg-final { cleanup-tree-dump "cdce" } } */
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include <errno.h> #include <errno.h>
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-skip-if "doubles are floats" { "avr-*-*" } { "*" } { "" } } */
/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -lm" } */ /* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -lm" } */
/* { dg-final { scan-tree-dump "cdce2.c:16: note: function call is shrink-wrapped into error conditions\." "cdce" } }*/ /* { dg-final { scan-tree-dump "cdce2.c:16: note: function call is shrink-wrapped into error conditions\." "cdce" } }*/
/* { dg-final { cleanup-tree-dump "cdce" } } */ /* { dg-final { cleanup-tree-dump "cdce" } } */
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include <errno.h> #include <errno.h>
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-fdump-tree-original" } */ /* { dg-options "-w -fdump-tree-original" } */
char c1 __attribute__ ((aligned (1))); char c1 __attribute__ ((aligned (1)));
char c2 __attribute__ ((aligned (2))); char c2 __attribute__ ((aligned (2)));
char c4 __attribute__ ((aligned (4))); char c4 __attribute__ ((aligned (4)));
char c8 __attribute__ ((aligned (8))); char c8 __attribute__ ((aligned (8)));
unsigned f1(void) unsigned f1(void)
{ {
return 3 & (__SIZE_TYPE__)&c1; return 3 & (__SIZE_TYPE__)&c1;
......
...@@ -3,14 +3,22 @@ ...@@ -3,14 +3,22 @@
/* { dg-options "-O2 -fdump-tree-original" } */ /* { dg-options "-O2 -fdump-tree-original" } */
void foo (void); void foo (void);
#if(__SIZEOF_INT__ >= 4)
int test1 (int a) int test1 (int a)
#else
int test1 (long a)
#endif
{ {
if ((a >> 3) & 134217728) if ((a >> 3) & 134217728)
foo (); foo ();
} }
#if(__SIZEOF_INT__ >= 4)
int test2 (unsigned int b) int test2 (unsigned int b)
#else
int test2 (unsigned long b)
#endif
{ {
if ((b >> 3) & 134217728) if ((b >> 3) & 134217728)
foo (); foo ();
......
/* { dg-compile } */ /* { dg-compile } */
/* { dg-skip-if "consts are shorts, not longs" { "m32c-*-*" } { "*" } { "" } } */ /* { dg-skip-if "consts are shorts, not longs" { "m32c-*-*" "avr-*-*" } { "*" } { "" } } */
/* { dg-options "-O -ftrapping-math" } */ /* { dg-options "-O -ftrapping-math" } */
/* There should be exactly 2 +Inf in the assembly file. */ /* There should be exactly 2 +Inf in the assembly file. */
......
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
short int short int
g (void) g (void)
{ {
short int wc = ((short int)1 << 31) - 1; /* { dg-bogus "overflow .* overflow" } */ short int wc = ((short int)1 << (8 * __SIZEOF_INT__ - 1)) - 1; /* { dg-bogus "overflow .* overflow" } */
/* { dg-warning "overflow" "" { target *-*-* } 8 } */ /* { dg-warning "overflow" "" { target *-*-* } 8 } */
return wc; return wc;
} }
/* { dg-require-effective-target int32plus } */
#include "struct-1.h" #include "struct-1.h"
struct ChainSearchRecord { struct ChainSearchRecord {
...@@ -7,6 +6,11 @@ struct ChainSearchRecord { ...@@ -7,6 +6,11 @@ struct ChainSearchRecord {
typedef struct ChainSearchRecord ChainSearchRecord; typedef struct ChainSearchRecord ChainSearchRecord;
void foo (ChainSearchPtr s) void foo (ChainSearchPtr s)
{ {
#if(__SIZEOF_INT__ >= 4)
s->identity = 0x6a73616d; s->identity = 0x6a73616d;
#else
s->identity = 0x616d;
#endif
} }
...@@ -29,7 +29,7 @@ void init_code () ...@@ -29,7 +29,7 @@ void init_code ()
object V658; object V658;
T1240: T1240:
if (V648 >= (long)V651) if (V648 >= (long)V651) /* { dg-warning "cast from pointer to integer of different size" "" { target { "avr-*-*" } } } */
goto T1243; goto T1243;
V653 = ((char *) V654->v.v_self)[V648]; V653 = ((char *) V654->v.v_self)[V648];
V659 = (object) V654 + V653; V659 = (object) V654 + V653;
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-xfail-if "" { "powerpc-ibm-aix*" } { "*" } { "" } } */ /* { dg-xfail-if "" { "powerpc-ibm-aix*" } { "*" } { "" } } */
/* { dg-skip-if "No dollar in identfiers" { "avr-*-*" } { "*" } { "" } } */
/* { dg-options "-std=c99 -fdollars-in-identifiers -fextended-identifiers" } */ /* { dg-options "-std=c99 -fdollars-in-identifiers -fextended-identifiers" } */
void abort (void); void abort (void);
......
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */ /* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Test the char16_t and char32_t promotion rules. */ /* Test the char16_t and char32_t promotion rules. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-excess-errors "short and int are 16bit" { target { "avr-*-*" } } } */
/* { dg-options "-std=gnu99 -Wall -Wconversion -Wsign-conversion" } */ /* { dg-options "-std=gnu99 -Wall -Wconversion -Wsign-conversion" } */
typedef short unsigned int char16_t; typedef short unsigned int char16_t;
...@@ -43,9 +44,9 @@ void m (char16_t c0, char32_t c1) ...@@ -43,9 +44,9 @@ void m (char16_t c0, char32_t c1)
f_c (c1); /* { dg-warning "alter its value" } */ f_c (c1); /* { dg-warning "alter its value" } */
fsc (c1); /* { dg-warning "alter its value" } */ fsc (c1); /* { dg-warning "alter its value" } */
fuc (c1); /* { dg-warning "alter its value" } */ fuc (c1); /* { dg-warning "alter its value" } */
f_s (c1); /* { dg-warning "alter its value" } */ f_s (c1); /* { dg-warning "alter its value" "" { target { ! "avr-*-*" } } } */
fss (c1); /* { dg-warning "alter its value" } */ fss (c1); /* { dg-warning "alter its value" "" { target { ! "avr-*-*" } } } */
fus (c1); /* { dg-warning "alter its value" } */ fus (c1); /* { dg-warning "alter its value" "" { target { ! "avr-*-*" } } } */
f_i (c1); /* { dg-warning "change the sign" } */ f_i (c1); /* { dg-warning "change the sign" } */
fsi (c1); /* { dg-warning "change the sign" } */ fsi (c1); /* { dg-warning "change the sign" } */
fui (c1); fui (c1);
......
...@@ -28,9 +28,9 @@ testfunc1 () ...@@ -28,9 +28,9 @@ testfunc1 ()
foo_f (cd); /* { dg-warning "as floating rather than complex" "prototype conversion warning" } */ foo_f (cd); /* { dg-warning "as floating rather than complex" "prototype conversion warning" } */
foo_ld (i); /* { dg-warning "as floating rather than integer" "prototype conversion warning" } */ foo_ld (i); /* { dg-warning "as floating rather than integer" "prototype conversion warning" } */
foo_ld (f); foo_ld (f); /* { dg-warning "as 'float' rather than 'double'" "small double" { target { "avr-*-*" } } } */
foo_ld (ld); foo_ld (ld);/* { dg-warning "as 'float' rather than 'double'" "small long double" { target { "avr-*-*" } } } */
foo_ld (cd); /* { dg-warning "as floating rather than complex" "prototype conversion warning" } */ foo_ld (cd);/* { dg-warning "as floating rather than complex" "prototype conversion warning" } */
foo_cd (i); /* { dg-warning "as complex rather than integer" "prototype conversion warning" } */ foo_cd (i); /* { dg-warning "as complex rather than integer" "prototype conversion warning" } */
foo_cd (f); /* { dg-warning "as complex rather than floating" "prototype conversion warning" } */ foo_cd (f); /* { dg-warning "as complex rather than floating" "prototype conversion warning" } */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment