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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [anon-struct-1.c] - Blame information for rev 823

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

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-options "-std=iso9899:1990" } */
2
/* In strict ISO C mode, we don't recognize the anonymous struct/union
3
   extension or any Microsoft extensions.  */
4
 
5
struct A { char a; };
6
 
7
/* MS extension.  */
8
struct B {
9
  struct A;                     /* { dg-warning "does not declare anything" } */
10
  char b;
11
};
12
char testB[sizeof(struct B) == sizeof(struct A) ? 1 : -1];
13
 
14
/* MS extension.  */
15
struct C {
16
  struct D { char d; };         /* { dg-warning "does not declare anything" } */
17
  char c;
18
};
19
char testC[sizeof(struct C) == sizeof(struct A) ? 1 : -1];
20
char testD[sizeof(struct D) == sizeof(struct A) ? 1 : -1];
21
 
22
/* GNU extension.  */
23
struct E {
24
  struct { char z; };           /* { dg-warning "does not declare anything" } */
25
  char e;
26
};
27
char testE[sizeof(struct E) == sizeof(struct A) ? 1 : -1];
28
 
29
/* MS extension.  */
30
typedef struct A typedef_A;
31
struct F {
32
  typedef_A;                    /* { dg-warning "does not declare anything" } */
33
  char f;
34
};
35
char testF[sizeof(struct F) == sizeof(struct A) ? 1 : -1];
36
 
37
/* __extension__ enables GNU C mode for the duration of the declaration.  */
38
__extension__ struct G {
39
  struct { char z; };
40
  char g;
41
};
42
char testG[sizeof(struct G) == 2 * sizeof(struct A) ? 1 : -1];
43
 
44
struct H {
45
  __extension__ struct { char z; };
46
  char h;
47
};
48
char testH[sizeof(struct H) == 2 * sizeof(struct A) ? 1 : -1];
49
 
50
/* Make sure __extension__ gets turned back off.  */
51
struct I {
52
  struct { char z; };           /* { dg-warning "does not declare anything" } */
53
  char i;
54
};
55
char testI[sizeof(struct I) == sizeof(struct A) ? 1 : -1];
56
 

powered by: WebSVN 2.1.0

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