OSDN Git Service

* gcc.dg/dfp/func-array.c: Support -DDBG to report individual failures.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / attr-invalid.c
1 /* { dg-do compile } */
2 /* { dg-options "" } */
3
4 #define CONCAT_(A,B) A ## B
5 #define CONCAT(A,B) CONCAT_(A,B)
6
7 #define ATTR __attribute__((AT))
8 #define ATSYM(suf) CONCAT (AT, CONCAT_ (_, suf))
9
10 #define AT noinline
11
12 typedef int ATSYM(type) ATTR; /* { dg-warning "attribute ignored" "" } */
13
14 typedef int (*ATSYM(fntype))(void) ATTR; /* { dg-warning "attribute ignored" "" } */
15
16 struct ATSYM(struct) {
17   char dummy ATTR; /* { dg-warning "attribute ignored" "" } */
18 } ATTR; /* { dg-warning "does not apply to types" "" } */
19
20 int ATSYM(var) ATTR;  /* { dg-warning "attribute ignored" "" } */
21
22 int ATSYM(fn_knrarg) (arg)
23   int arg ATTR; /* { dg-warning "attribute ignored" "" } */
24 { return 0; }
25
26 int ATSYM(fn_isoarg) (int arg ATTR) { return 0; } /* { dg-warning "attribute ignored" "" } */
27
28 int ATSYM(fn_vars) (void) {
29   static int svar ATTR; /* { dg-warning "attribute ignored" "" } */
30   auto int lvar ATTR; /* { dg-warning "attribute ignored" "" } */
31   return 0;
32 }
33
34
35 #undef AT
36 #define AT used
37
38 typedef int ATSYM(type) ATTR; /* { dg-warning "attribute ignored" "" } */
39
40 typedef int (*ATSYM(fntype))(void) ATTR; /* { dg-warning "attribute ignored" "" } */
41
42 struct ATSYM(struct) {
43   char dummy ATTR; /* { dg-warning "attribute ignored" "" } */
44 } ATTR; /* { dg-warning "does not apply to types" "" } */
45
46 int ATSYM(var) ATTR;
47
48 int ATSYM(fn_knrarg) (arg)
49   int arg ATTR; /* { dg-warning "attribute ignored" "" } */
50 { return 0; }
51
52 int ATSYM(fn_isoarg) (int arg ATTR) { return 0; } /* { dg-warning "attribute ignored" "" } */
53
54 int ATSYM(fn_vars) (void) {
55   static int svar ATTR;
56   auto int lvar ATTR; /* { dg-warning "attribute ignored" "" } */
57   return 0;
58 }
59
60
61 /* PR 28287 */
62 /* These are invalid on all targets.  Applying to PARM_ or FIELD_DECL
63    also caused a tree checking ice on targets that support weak,  */
64 #undef AT
65 #define AT weak
66
67 typedef int ATSYM(type) ATTR; /* { dg-warning "attribute ignored" "" } */
68
69 typedef int (*ATSYM(fntype))(void) ATTR; /* { dg-warning "attribute ignored" "" } */
70
71 struct ATSYM(struct) {
72   char dummy ATTR; /* { dg-warning "attribute ignored" "" } */
73 };
74
75 int ATSYM(fn_knrarg) (arg)
76   int arg ATTR; /* { dg-warning "attribute ignored" "" } */
77 { return 0; }
78
79 int ATSYM(fn_isoarg) (int arg ATTR) { return 0; } /* { dg-warning "attribute ignored" "" } */
80
81
82 /* PR target/28648  */
83 /* These are invalid on all targets.  Applying to PARM_ or FIELD_DECL
84    also caused a tree checking ice on targets that support dllimport.  */
85 #undef AT
86 #define AT dllimport
87
88 typedef int ATSYM(type) ATTR;  /* { dg-warning "attribute |directive ignored" "" } */
89
90 typedef int (*ATSYM(fntype))(void) ATTR;   /* { dg-warning "attribute |directive ignored" "" } */
91
92 struct ATSYM(struct) {
93   char dummy ATTR;  /* { dg-warning "attribute |directive ignored" "" } */
94 };
95
96 int ATSYM(fn_knrarg) (arg)
97   int arg ATTR;  /* { dg-warning "attribute |directive ignored" "" } */
98 { return 0; }
99
100 int ATSYM(fn_isoarg) (int arg ATTR) { return 0; }  /* { dg-warning "attribute |directive ignored" "" } */