typedef __WCHAR_TYPE__ wchar_t;
typedef __SIZE_TYPE__ size_t;
void *memcpy(void *, void const *, size_t);
void *memccpy(void *, void const *, int, size_t);
int test1(int argc, char **argv) {
unsigned char a = 0x11223344;
unsigned char b = 0x11223344;
__builtin_bzero(&a, sizeof(a));
__builtin_memset(&a, 0, sizeof(a));
__builtin_memcpy(&a, &b, sizeof(a));
__builtin_memmove(&a, &b, sizeof(a));
return 0;
}
char* test2(char* a, char* b) {
return __builtin_memcpy(a, b, 4);
}
void test3(char *P) {
__builtin___memset_chk(P, 42, 128, 128);
}
void test4(char *P, char *Q) {
__builtin___memcpy_chk(P, Q, 128, 128);
}
void test5(char *P, char *Q) {
__builtin___memmove_chk(P, Q, 128, 128);
}
int test6(char *X) {
return __builtin___memcpy_chk(X, X, 42, 42) != 0;
}
int test7(int *p) {
struct snd_pcm_hw_params_t* hwparams;
__builtin_memset(p, 0, 256);
__builtin_memset((char*)p, 0, 256);
__builtin_memset(hwparams, 0, 256); }
struct PS {
int modes[4];
} __attribute__((packed));
struct PS ps;
void test8(int *arg) {
__builtin_memcpy(arg, ps.modes, sizeof(struct PS));
}
__attribute((aligned(16))) int x[4], y[4];
void test9(void) {
__builtin_memcpy(x, y, sizeof(y));
}
wchar_t dest;
wchar_t src;
void test10(void) {
__builtin_wmemcpy(&dest, &src, 4);
__builtin_wmemmove(&dest, &src, 4);
}
void test11(void) {
typedef struct { int a; } b;
int d;
b e;
memcpy(&d, (char *)&e.a, sizeof(e));
}
extern char dest_array[];
extern char src_array[];
void test12(void) {
memcpy(&dest_array, &dest_array, 2);
}
void test13(char *d, char *s, int c, size_t n) {
memccpy(d, s, c, n);
}