diff options
author | YamaArashi <shadow962@live.com> | 2016-01-06 01:47:28 -0800 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2016-01-06 01:47:28 -0800 |
commit | be8b04496302184c6e8f04d6179f9c3afc50aeb6 (patch) | |
tree | 726e2468c0c07add773c0dbd86ab6386844259ae /gcc/testsuite/gcc.c-torture/unsorted/bcopy.c |
initial commit
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/unsorted/bcopy.c')
-rwxr-xr-x | gcc/testsuite/gcc.c-torture/unsorted/bcopy.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/unsorted/bcopy.c b/gcc/testsuite/gcc.c-torture/unsorted/bcopy.c new file mode 100755 index 0000000..1732b34 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/unsorted/bcopy.c @@ -0,0 +1,64 @@ +void +bcopy1 (s, d, c) + long long *s; + long long *d; + int c; +{ + int i; + c = c / 8; + for (i = 0; i < c; i++) + d[i] = s[i]; +} + +void +bcopy2 (s, d, c) + long *s; + long *d; + int c; +{ + int i; + c = c / 4; + for (i = 0; i < c; i++) + d[i] = s[i]; +} + + +void +bcopy3 (s, d, c) + char *s; + char *d; + int c; +{ + long long z0, z1; + int r = d - s; + + int i; + + c /= 16; + + z0 = *((long long *) s); + s += 8; + z1 = *((long long *) s); + s += 8; + for (i = 0; i < c; i++) + { + *(long long *)(s + r) = z0; + z0 = *((long long *) s); + s += 8; + *(long long *)(s + r) = z1; + z1 = *((long long *) s); + s += 8; + } +} + +#define BYTES 16384 + +main () +{ + long long s[BYTES / 8]; + long long d[BYTES / 8]; + int i; + + for (i = 1; i < 67108864 / BYTES; i++) + bcopy (s, d, BYTES); +} |