OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [mode-dependent-address.c] - Blame information for rev 297

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
#include <stdint.h>
2
#include <string.h>
3
#include <stdlib.h>
4
 
5
void f883b (int8_t * result,
6
    int16_t * __restrict arg1,
7
    uint32_t * __restrict arg2,
8
    uint64_t * __restrict arg3,
9
    uint8_t * __restrict arg4)
10
{
11
    int idx;
12
    for (idx=0;idx<96;idx += 1) {
13
        result[idx] = (((((((((((-27 + 2+1)>>1) || arg4[idx]) < arg1[idx])
14
                                ? (((-27 + 2+1)>>1) || arg4[idx])
15
                                : arg1[idx])
16
                               >> (arg2[idx] & 31)) ^ 1) - -32)>>7) | -5) & arg3[idx]);
17
    }
18
}
19
 
20
int8_t result[96];
21
int16_t arg1[96];
22
uint32_t arg2[96];
23
uint64_t arg3[96];
24
uint8_t arg4[96];
25
 
26
int main (void)
27
{
28
  int i;
29
  int correct[] = {0x0,0x1,0x2,0x3,0x0,0x1,0x2,0x3,0x8,0x9,0xa,0xb,0x8,0x9,
30
                   0xa,0xb,0x10,0x11,0x12,0x13,0x10,0x11,0x12,0x13,
31
                   0x18,0x19,0x1a,0x1b,0x18,0x19,0x1a,0x1b,0x20,0x21,0x22,
32
                   0x23,0x20,0x21,0x22,0x23,0x28,0x29,0x2a,
33
                   0x2b,0x28,0x29,0x2a,0x2b,0x30,0x31,0x32,0x33,
34
                   0x30,0x31,0x32,0x33,0x38,0x39,0x3a,0x3b,0x38,0x39,0x3a,
35
                   0x3b,0x40,0x41,0x42,0x43,0x40,0x41,0x42,0x43,0x48,0x49,
36
                   0x4a,0x4b,0x48,0x49,0x4a,0x4b,0x50,0x51,
37
                   0x52,0x53,0x50,0x51,0x52,0x53,0x58,0x59,0x5a,0x5b,
38
                   0x58,0x59,0x5a,0x5b};
39
 
40
  for (i=0; i < 96; i++)
41
    arg3[i] = arg2[i] = arg1[i] = arg4[i] = i;
42
 
43
  f883b(result, arg1, arg2, arg3, arg4);
44
 
45
  for (i=0; i < 96; i++)
46
    if (result[i] != correct[i]) abort();
47
 
48
  return 0;
49
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.