diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gcc.c-torture/execute/mode-dependent-address.c | |
download | cbb-gcc-4.6.4-upstream.tar.bz2 cbb-gcc-4.6.4-upstream.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig;
imported gcc-4.6.4 source tree from verified upstream tarball.
downloading a git-generated archive based on the 'upstream' tag
should provide you with a source tree that is binary identical
to the one extracted from the above tarball.
if you have obtained the source via the command 'git clone',
however, do note that line-endings of files in your working
directory might differ from line-endings of the respective
files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/mode-dependent-address.c')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/mode-dependent-address.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/mode-dependent-address.c b/gcc/testsuite/gcc.c-torture/execute/mode-dependent-address.c new file mode 100644 index 000000000..5bf840cf2 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/mode-dependent-address.c @@ -0,0 +1,49 @@ +#include <stdint.h> +#include <string.h> +#include <stdlib.h> + +void f883b (int8_t * result, + int16_t * __restrict arg1, + uint32_t * __restrict arg2, + uint64_t * __restrict arg3, + uint8_t * __restrict arg4) +{ + int idx; + for (idx=0;idx<96;idx += 1) { + result[idx] = (((((((((((-27 + 2+1)>>1) || arg4[idx]) < arg1[idx]) + ? (((-27 + 2+1)>>1) || arg4[idx]) + : arg1[idx]) + >> (arg2[idx] & 31)) ^ 1) - -32)>>7) | -5) & arg3[idx]); + } +} + +int8_t result[96]; +int16_t arg1[96]; +uint32_t arg2[96]; +uint64_t arg3[96]; +uint8_t arg4[96]; + +int main (void) +{ + int i; + int correct[] = {0x0,0x1,0x2,0x3,0x0,0x1,0x2,0x3,0x8,0x9,0xa,0xb,0x8,0x9, + 0xa,0xb,0x10,0x11,0x12,0x13,0x10,0x11,0x12,0x13, + 0x18,0x19,0x1a,0x1b,0x18,0x19,0x1a,0x1b,0x20,0x21,0x22, + 0x23,0x20,0x21,0x22,0x23,0x28,0x29,0x2a, + 0x2b,0x28,0x29,0x2a,0x2b,0x30,0x31,0x32,0x33, + 0x30,0x31,0x32,0x33,0x38,0x39,0x3a,0x3b,0x38,0x39,0x3a, + 0x3b,0x40,0x41,0x42,0x43,0x40,0x41,0x42,0x43,0x48,0x49, + 0x4a,0x4b,0x48,0x49,0x4a,0x4b,0x50,0x51, + 0x52,0x53,0x50,0x51,0x52,0x53,0x58,0x59,0x5a,0x5b, + 0x58,0x59,0x5a,0x5b}; + + for (i=0; i < 96; i++) + arg3[i] = arg2[i] = arg1[i] = arg4[i] = i; + + f883b(result, arg1, arg2, arg3, arg4); + + for (i=0; i < 96; i++) + if (result[i] != correct[i]) abort(); + + return 0; +} |