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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [powerpc/] [ppc-switch-1.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do compile { target { powerpc*-*-* } } } */
2
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
3
/* { dg-options "-O2 --param case-values-threshold=2" } */
4
/* { dg-final { scan-assembler "mtctr" } } */
5
/* { dg-final { scan-assembler "bctr" } } */
6
 
7
/* Force using a dispatch table even though by default we would generate
8
   ifs.  */
9
 
10
extern long call (long);
11
 
12
long
13
test_switch (long a, long b)
14
{
15
  long c;
16
 
17
  switch (a)
18
    {
19
    case 0:  c = -b;     break;
20
    case 1:  c = ~b;    break;
21
    case 2:  c = b+1;   break;
22
    default: c = b & 9; break;
23
    }
24
 
25
  return call (c) + 1;
26
}

powered by: WebSVN 2.1.0

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