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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [Wcxx-compat-4.c] - Blame information for rev 749

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-Wc++-compat" } */
3
enum E1 { A, B, C };
4
enum E2 { D, E, F };
5
 
6
enum E1 g1;
7
enum E2 g2;
8
 
9
void
10
f1 ()
11
{
12
  int a;
13
  int d;
14
  enum E1 e1;
15
  enum E2 e2;
16
  a = A;
17
  a = !B;
18
  d = E;
19
  e1 = A;
20
  e1 = D;               /* { dg-warning "invalid in C\[+\]\[+\]" } */
21
  e1 = 0;                /* { dg-warning "invalid in C\[+\]\[+\]" } */
22
  e1 = (enum E1) 0;
23
  e1 = (enum E2) 0;      /* { dg-warning "invalid in C\[+\]\[+\]" } */
24
  e1 = e2;              /* { dg-warning "invalid in C\[+\]\[+\]" } */
25
  e1 = g1;
26
  e1 = g2;              /* { dg-warning "invalid in C\[+\]\[+\]" } */
27
  e2 = A;               /* { dg-warning "invalid in C\[+\]\[+\]" } */
28
  e2 = D;
29
}
30
 
31
struct s { enum E1 e1 : 3; };
32
 
33
void
34
f2 (struct s sv)
35
{
36
  sv.e1 = A;
37
  sv.e1 = D;            /* { dg-warning "invalid in C\[+\]\[+\]" } */
38
  g1 = sv.e1;
39
  g2 = sv.e1;           /* { dg-warning "invalid in C\[+\]\[+\]" } */
40
}
41
 
42
void
43
f3 (struct s *pv)
44
{
45
  pv->e1 = A;
46
  pv->e1 = D;           /* { dg-warning "invalid in C\[+\]\[+\]" } */
47
  g1 = pv->e1;
48
  g2 = pv->e1;          /* { dg-warning "invalid in C\[+\]\[+\]" } */
49
}

powered by: WebSVN 2.1.0

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