3 struct big_struct
{ char a
[262144]; };
5 static const char str
[] = "abcdefghijklmnopqrstuvwxyz";
14 #if defined __BOUNDS_CHECKING_ON || defined BC_ON
15 printf("BOUNDS ON:\n");
17 printf("BOUNDS OFF:\n");
23 r
= (__builtin_offsetof(struct big_struct
, a
) != 0);
26 p
= __builtin_memcpy (tmp
, str
, sizeof(str
));
30 r
= __builtin_memcmp (p
, str
, sizeof(str
));
33 p
= __builtin_memmove(tmp
, str
, sizeof(str
));
34 r
= (__builtin_memcmp (p
, str
, sizeof(str
)));
37 p
= __builtin_memset(tmp
, 0, sizeof (tmp
));
38 r
= (p
!= tmp
|| tmp
[0] != 0 || tmp
[99] != 0);
41 r
= (__builtin_strlen(str
) != sizeof(str
) - 1);
44 p
= __builtin_strcpy(tmp
, str
);
45 r
= (__builtin_memcmp (p
, str
, sizeof(str
)));
48 p
= __builtin_strncpy(tmp
, str
, sizeof(str
));
49 r
= (__builtin_memcmp (p
, str
, sizeof(str
)));
52 r
= (__builtin_strcmp (p
, str
));
55 r
= (__builtin_strncmp (p
, str
, sizeof(str
)));
59 p
= __builtin_strcat(tmp
, str
);
60 r
= (__builtin_memcmp (p
, str
, sizeof(str
)));
63 r
= (__builtin_strchr(p
, 'z') != &p
[25]);
66 p
= __builtin_strdup (str
);
67 r
= (__builtin_memcmp (p
, str
, sizeof(str
)));
71 p
= __builtin_malloc (100);
72 __builtin_memset(p
, 0, 100);
73 p
= __builtin_realloc (p
, 1000);
74 __builtin_memset(p
, 0, 1000);
77 p
= __builtin_calloc(10, 10);
78 __builtin_memset(p
, 0, 100);
81 #if defined(__i386__) || defined(__x86_64__)
82 p
= __builtin_alloca(100);
83 __builtin_memset(p
, 0, 100);