/* { dg-do run } */
/* { dg-options "-O2" } */
+/* { dg-require-effective-target size20plus } */
#include "builtin-object-size-common.h"
}
}
+#ifndef __AVR__ /* avr has no strndup */
/* Tests for strdup/strndup. */
size_t
__attribute__ ((noinline))
FAIL ();
free (res);
}
+#endif /* avr */
int
main (void)
test8 ();
test9 (1);
test10 ();
+#ifndef __AVR__ /* avr has no strndup */
test11 ();
+#endif
DONE ();
}
#endif
}
+#ifndef __AVR__ /* avr has no strndup */
/* Tests for strdup/strndup. */
size_t
__attribute__ ((noinline))
FAIL ();
free (res);
}
+#endif /* avr */
int
main (void)
test6 ();
test7 ();
test8 (1);
+#ifndef __AVR__ /* avr has no strndup */
test9 ();
+#endif
DONE ();
}
}
}
+#ifndef __AVR__ /* avr has no strndup */
/* Tests for strdup/strndup. */
size_t
__attribute__ ((noinline))
FAIL ();
free (res);
}
+#endif /* avr */
int
main (void)
test8 ();
test9 (1);
test10 ();
+#ifndef __AVR__ /* avr has no strndup */
test11 ();
+#endif
DONE ();
}
#endif
}
+#ifndef __AVR__ /* avr has no strndup */
/* Tests for strdup/strndup. */
size_t
__attribute__ ((noinline))
FAIL ();
free (res);
}
+#endif /* avr */
int
main (void)
test6 ();
test7 ();
test8 (1);
+#ifndef __AVR__ /* avr has no strndup */
test9 ();
+#endif
DONE ();
}
/* Only 2 members. */
/* { dg-final { scan-assembler-times "MEMBER" 2 } } */
+#if __SIZEOF_INT__ < 4
+#define unsigned __UINT32_TYPE__
+#endif
+
struct foo
{
unsigned a : 31;
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__ func () {
+ __UINTPTR_TYPE__ x = (__UINTPTR_TYPE__) &foo;
return x;
}
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
{
// { 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:
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" } }
/* { 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 *);
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));
/* { 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;
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-vrp2" } */
+/* { dg-require-effective-target int32plus } */
int a, b;
int main() {
/* { dg-do compile } */
/* { dg-options "-O" } */
+#if __SIZEOF_INT__ < 4
+#define int __INT32_TYPE__
+#endif
+
int _setjmp ();
void abcd ();
void abcde ();
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;
}
/* { 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) {