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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [switch-warn-2.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 689 jeremybenn
/* This should not warn about the case label being out of range.  */
2
/* { dg-do run } */
3
/* { dg-options "-O0" } */
4
 
5
extern void abort (void);
6
extern void exit (int);
7
 
8
int
9
foo (unsigned int i)
10
{
11
  switch (i)
12
  {
13
    case 123456123456ULL: /* { dg-warning "large integer implicitly truncated to unsigned type" } */
14
      return 0;
15
    default:
16
      return 3;
17
  }
18
}
19
 
20
int
21
main (void)
22
{
23
  if (foo (10) != 3)
24
    abort ();
25
  exit (0);
26
}

powered by: WebSVN 2.1.0

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