aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/mips/pr104914.c
blob: 5dd10e84c176417be8400d8af3783403fccc23e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* { dg-do run } */
/* { dg-options "-mabi=64" } */

extern void abort (void);
extern void exit (int);

NOMIPS16 int test (const unsigned char *buf)
{
  int val;
  ((unsigned char*)&val)[0] = *buf++;
  ((unsigned char*)&val)[1] = *buf++;
  ((unsigned char*)&val)[2] = *buf++;
  ((unsigned char*)&val)[3] = *buf++;
  if(val > 0)
    return 1;
  else
    return 0;
}

int main ()
{
  if (test("\xff\xff\xff\xff") != 0)
    abort();
  exit(0);
}