| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O1 -minline-all-stringops -minline-stringops-dynamically" } */ |
| 3 |
|
| 4 |
#include <string.h> |
| 5 |
|
| 6 |
extern double ran(void); |
| 7 |
|
| 8 |
struct spec_fd_t { |
| 9 |
int limit; |
| 10 |
int len; |
| 11 |
int pos; |
| 12 |
unsigned char *buf; |
| 13 |
} spec_fd[3]; |
| 14 |
|
| 15 |
int spec_random_load (int fd) { |
| 16 |
int i, j; |
| 17 |
char random_text[(32)][(128*1024)]; |
| 18 |
|
| 19 |
for (j = 0; j < (128*1024); j++) { |
| 20 |
random_text[i][j] = (int)(ran()*256); |
| 21 |
} |
| 22 |
|
| 23 |
for (i = 0 ; i < spec_fd[fd].limit; i+= (128*1024)) { |
| 24 |
memcpy(spec_fd[fd].buf + i, random_text[(int)(ran()*(32))], |
| 25 |
(128*1024)); |
| 26 |
} |
| 27 |
|
| 28 |
spec_fd[fd].len = 1024*1024; |
| 29 |
return 0; |
| 30 |
} |