@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2" } */
+/* { dg-require-effective-target size20plus } */
#include "builtin-object-size-common.h"
@@ -621,6 +621,7 @@ test10 (void)
}
}
+#ifndef __AVR__ /* avr has no strndup */
/* Tests for strdup/strndup. */
size_t
__attribute__ ((noinline))
@@ -708,6 +709,7 @@ test11 (void)
FAIL ();
free (res);
}
+#endif /* avr */
int
main (void)
@@ -724,6 +726,8 @@ main (void)
test8 ();
test9 (1);
test10 ();
+#ifndef __AVR__ /* avr has no strndup */
test11 ();
+#endif
DONE ();
}
@@ -536,6 +536,7 @@ test8 (unsigned cond)
#endif
}
+#ifndef __AVR__ /* avr has no strndup */
/* Tests for strdup/strndup. */
size_t
__attribute__ ((noinline))
@@ -623,6 +624,7 @@ test9 (void)
FAIL ();
free (res);
}
+#endif /* avr */
int
main (void)
@@ -637,6 +639,8 @@ main (void)
test6 ();
test7 ();
test8 (1);
+#ifndef __AVR__ /* avr has no strndup */
test9 ();
+#endif
DONE ();
}
@@ -628,6 +628,7 @@ test10 (void)
}
}
+#ifndef __AVR__ /* avr has no strndup */
/* Tests for strdup/strndup. */
size_t
__attribute__ ((noinline))
@@ -716,6 +717,7 @@ test11 (void)
FAIL ();
free (res);
}
+#endif /* avr */
int
main (void)
@@ -732,6 +734,8 @@ main (void)
test8 ();
test9 (1);
test10 ();
+#ifndef __AVR__ /* avr has no strndup */
test11 ();
+#endif
DONE ();
}
@@ -509,6 +509,7 @@ test8 (unsigned cond)
#endif
}
+#ifndef __AVR__ /* avr has no strndup */
/* Tests for strdup/strndup. */
size_t
__attribute__ ((noinline))
@@ -596,6 +597,7 @@ test9 (void)
FAIL ();
free (res);
}
+#endif /* avr */
int
main (void)
@@ -610,6 +612,8 @@ main (void)
test6 ();
test7 ();
test8 (1);
+#ifndef __AVR__ /* avr has no strndup */
test9 ();
+#endif
DONE ();
}
@@ -18,6 +18,10 @@
/* Only 2 members. */
/* { dg-final { scan-assembler-times "MEMBER" 2 } } */
+#if __SIZEOF_INT__ < 4
+#define unsigned __UINT32_TYPE__
+#endif
+
struct foo
{
unsigned a : 31;
@@ -17,8 +17,8 @@
extern const void foo __attribute__((weak)) __attribute__((section (".ksyms")));
extern const void bar __attribute__((weak)) __attribute__((section (".ksyms")));
-unsigned long func () {
- unsigned long x = (unsigned long) &foo;
+__UINTPTR_TYPE__ long func () {
+ __UINTPTR_TYPE__ x = (__UINTPTR_TYPE__) &foo;
return x;
}
@@ -6,7 +6,7 @@
typedef __INT8_TYPE__ int8_t;
typedef __INT32_TYPE__ int32_t;
-extern void* memchr (const void*, int, long); /* { dg-warning "-Wbuiltin-declaration-mismatch" "" { target llp64 } } */
+extern void* memchr (const void*, int, long); /* { dg-warning "-Wbuiltin-declaration-mismatch" "" { target { llp64 || avr-*-* } } } */
struct SX
{
@@ -1,7 +1,7 @@
// { dg-do compile }
// { dg-options "-O2 --param case-values-threshold=1 -w" }
-int f (int i)
+int f (__INT32_TYPE__ i)
{
switch (i) {
case 2147483647:
@@ -13,7 +13,7 @@ void func_10(long li_8)
void func_9_s_8(void)
{
- func_10((long) func_9_s_8);
+ func_10((long) func_9_s_8); /* { dg-warning "-Wpointer-to-int-cast" "" { target { ! ptr_eq_long } } } */
}
// { dg-final { scan-tree-dump " / 0" "optimized" } }
@@ -2,8 +2,8 @@
/* { dg-do compile } */
/* { dg-options "-Og" } */
-typedef double __attribute__((__vector_size__ (8))) V;
-typedef double __attribute__((__vector_size__ (16))) W;
+typedef double __attribute__((__vector_size__ (__SIZEOF_DOUBLE__))) V;
+typedef double __attribute__((__vector_size__ (__SIZEOF_DOUBLE__*2))) W;
V v;
int i;
extern void bar (void *);
@@ -7,7 +7,7 @@ int f_MV0__x;
void f() {
unsigned char *rptr;
unsigned char valbuf[6];
- rptr = (unsigned char *)contents;
+ rptr = (unsigned char *)contents; /* { dg-warning "-Wint-to-pointer-cast" "" { target { ! ptr_eq_long } } } */
if (decide())
do {
__builtin_memcpy(valbuf, &f_MV0__x, sizeof(int));
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O2" } */
-typedef unsigned uint32_t;
+typedef __UINT32_TYPE__ uint32_t;
typedef uint32_t uint32x4 __attribute__((vector_size(16)));
typedef struct {
uint32x4 b, d;
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-vrp2" } */
+/* { dg-require-effective-target int32plus } */
int a, b;
int main() {
@@ -1,6 +1,10 @@
/* { dg-do compile } */
/* { dg-options "-O" } */
+#if __SIZEOF_INT__ < 4
+#define int __INT32_TYPE__
+#endif
+
int _setjmp ();
void abcd ();
void abcde ();
@@ -12,9 +12,9 @@ char d_ary[1] = {1};
int main ()
{
- if (((unsigned long)&c_ary[0] & 7) != 0)
+ if (((__UINTPTR_TYPE__)&c_ary[0] & 7) != 0)
return 1;
- if (((unsigned long)&d_ary[0] & 7) != 0)
+ if (((__UINTPTR_TYPE__)&d_ary[0] & 7) != 0)
return 1;
return 0;
}
@@ -1,6 +1,10 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fno-inline-functions-called-once -fno-inline-small-functions -fno-tree-dce -fno-tree-forwprop -fno-tree-fre" } */
+#if __SIZEOF_INT__ < 4
+#define int __INT32_TYPE__
+#endif
+
int h(void);
void l(int);
void func_56(int p_57, unsigned p_58) {