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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [falign-labels-1.c] - Blame information for rev 774

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-falign-labels=8" } */
3
 
4
/* On ARMv7-A CPUs, this test resulted in incorrect code generation.
5
   The code generated for the switch statement expected the jump table
6
   to immediately follow the jump instruction, but -falign-labels
7
   caused the label preceding the table to be aligned.  */
8
/* M68K and fido only support -falign-labels argument <= 2.  */
9
 
10
volatile int x;
11
 
12
int main(void)
13
{
14
  int y;
15
 
16
  x = 0;
17
 
18
  switch(x)
19
    {
20
    case 0:
21
      y = 2 * x;
22
      break;
23
    case 1:
24
      y = -3 * x;
25
      break;
26
    case 2:
27
      y = x + 5;
28
      break;
29
    case 3:
30
      y = x - 7;
31
      break;
32
    default:
33
      break;
34
    }
35
 
36
  x = y;
37
 
38
  return 0;
39
}

powered by: WebSVN 2.1.0

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