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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [pr40087.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O1 " } */
3
 
4
extern void abort (void);
5
 
6
static void __attribute__((always_inline))
7
reverse(int *first, int *last)
8
{
9
  if (first == last--)
10
    return;
11
  while (first != last)
12
    {
13
      int t = *first;
14
      *first = *last;
15
      *last = t;
16
      if (++first == last--)
17
        break;
18
    }
19
}
20
 
21
int main()
22
{
23
  int seq[] = { 1, 2, 3, 4, 5, 6, 7, 8 };
24
 
25
  reverse(seq, seq + 8);
26
  if (seq[3] != 5 || seq[4] != 4)
27
    abort ();
28
 
29
  return 0;
30
}

powered by: WebSVN 2.1.0

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