annotate gcc/testsuite/gcc.dg/declspec-13.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Test declaration specifiers. Test messages for bad type
kono
parents:
diff changeset
2 specifiers. */
kono
parents:
diff changeset
3 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
kono
parents:
diff changeset
4 /* { dg-do compile } */
kono
parents:
diff changeset
5 /* { dg-options "-std=gnu89 -pedantic" } */
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 /* typeof should act much like typedef, so the following are
kono
parents:
diff changeset
8 invalid. */
kono
parents:
diff changeset
9 typeof(double) long x0; /* { dg-error "two or more data types in declaration specifiers" } */
kono
parents:
diff changeset
10 typeof(double) _Complex x1; /* { dg-error "two or more data types in declaration specifiers" } */
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 /* The following is erroneous, and used to get a bogus message about
kono
parents:
diff changeset
13 complex integer types. */
kono
parents:
diff changeset
14 typedef double D;
kono
parents:
diff changeset
15 D _Complex x2; /* { dg-error "two or more data types in declaration specifiers" } */
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 /* The following empty declarations should have problems in their type
kono
parents:
diff changeset
18 specifiers diagnosed, not just the general problem that they are
kono
parents:
diff changeset
19 empty declarations. */
kono
parents:
diff changeset
20 long short; /* { dg-error "both 'long' and 'short' in declaration specifiers" } */
kono
parents:
diff changeset
21 /* { dg-warning "useless type name in empty declaration" "empty" { target *-*-* } .-1 } */
kono
parents:
diff changeset
22 _Complex double; /* { dg-warning "ISO C90 does not support complex types" } */
kono
parents:
diff changeset
23 /* { dg-warning "useless type name in empty declaration" "empty" { target *-*-* } .-1 } */
kono
parents:
diff changeset
24 _Complex; /* { dg-warning "ISO C90 does not support complex types" } */
kono
parents:
diff changeset
25 /* { dg-warning "ISO C does not support plain 'complex' meaning 'double complex'" "ISO C" { target *-*-* } .-1 } */
kono
parents:
diff changeset
26 /* { dg-warning "useless type name in empty declaration" "empty" { target *-*-* } .-2 } */
kono
parents:
diff changeset
27 _Complex int; /* { dg-warning "ISO C90 does not support complex types" } */
kono
parents:
diff changeset
28 /* { dg-warning "ISO C does not support complex integer types" "ISO C" { target *-*-* } .-1 } */
kono
parents:
diff changeset
29 /* { dg-warning "useless type name in empty declaration" "empty" { target *-*-* } .-2 } */
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 /* Specific messages for each invalid combination. (That some message
kono
parents:
diff changeset
32 is given when appropriate for a larger collection of combinations
kono
parents:
diff changeset
33 of type specifiers is tested in *typespec*.c.) */
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 long double long x3; /* { dg-error "both 'long long' and 'double' in declaration specifiers" } */
kono
parents:
diff changeset
36 short long x4; /* { dg-error "both 'long' and 'short' in declaration specifiers" } */
kono
parents:
diff changeset
37 void long x5; /* { dg-error "both 'long' and 'void' in declaration specifiers" } */
kono
parents:
diff changeset
38 _Bool long x6; /* { dg-error "both 'long' and '_Bool' in declaration specifiers" } */
kono
parents:
diff changeset
39 /* { dg-warning "ISO C90 does not support boolean types" "C90" { target *-*-* } .-1 } */
kono
parents:
diff changeset
40 char long x7; /* { dg-error "both 'long' and 'char' in declaration specifiers" } */
kono
parents:
diff changeset
41 float long x8; /* { dg-error "both 'long' and 'float' in declaration specifiers" } */
kono
parents:
diff changeset
42 long short x9; /* { dg-error "both 'long' and 'short' in declaration specifiers" } */
kono
parents:
diff changeset
43 void short x10; /* { dg-error "both 'short' and 'void' in declaration specifiers" } */
kono
parents:
diff changeset
44 _Bool short x11; /* { dg-error "both 'short' and '_Bool' in declaration specifiers" } */
kono
parents:
diff changeset
45 /* { dg-warning "ISO C90 does not support boolean types" "C90" { target *-*-* } .-1 } */
kono
parents:
diff changeset
46 char short x12; /* { dg-error "both 'short' and 'char' in declaration specifiers" } */
kono
parents:
diff changeset
47 float short x13; /* { dg-error "both 'short' and 'float' in declaration specifiers" } */
kono
parents:
diff changeset
48 double short x14; /* { dg-error "both 'short' and 'double' in declaration specifiers" } */
kono
parents:
diff changeset
49 unsigned signed x15; /* { dg-error "both 'signed' and 'unsigned' in declaration specifiers" } */
kono
parents:
diff changeset
50 void signed x16; /* { dg-error "both 'signed' and 'void' in declaration specifiers" } */
kono
parents:
diff changeset
51 _Bool signed x17; /* { dg-error "both 'signed' and '_Bool' in declaration specifiers" } */
kono
parents:
diff changeset
52 /* { dg-warning "ISO C90 does not support boolean types" "C90" { target *-*-* } .-1 } */
kono
parents:
diff changeset
53 float signed x18; /* { dg-error "both 'signed' and 'float' in declaration specifiers" } */
kono
parents:
diff changeset
54 double signed x19; /* { dg-error "both 'signed' and 'double' in declaration specifiers" } */
kono
parents:
diff changeset
55 signed unsigned x20; /* { dg-error "both 'signed' and 'unsigned' in declaration specifiers" } */
kono
parents:
diff changeset
56 void unsigned x21; /* { dg-error "both 'unsigned' and 'void' in declaration specifiers" } */
kono
parents:
diff changeset
57 _Bool unsigned x22; /* { dg-error "both 'unsigned' and '_Bool' in declaration specifiers" } */
kono
parents:
diff changeset
58 /* { dg-warning "ISO C90 does not support boolean types" "C90" { target *-*-* } .-1 } */
kono
parents:
diff changeset
59 float unsigned x23; /* { dg-error "both 'unsigned' and 'float' in declaration specifiers" } */
kono
parents:
diff changeset
60 double unsigned x24; /* { dg-error "both 'unsigned' and 'double' in declaration specifiers" } */
kono
parents:
diff changeset
61 void _Complex x25; /* { dg-error "both 'complex' and 'void' in declaration specifiers" } */
kono
parents:
diff changeset
62 /* { dg-warning "ISO C90 does not support complex types" "C90" { target *-*-* } .-1 } */
kono
parents:
diff changeset
63 _Bool _Complex x26; /* { dg-error "both 'complex' and '_Bool' in declaration specifiers" } */
kono
parents:
diff changeset
64 /* { dg-warning "ISO C90 does not support complex types" "C90" { target *-*-* } .-1 } */
kono
parents:
diff changeset
65 /* { dg-warning "ISO C90 does not support boolean types" "C90" { target *-*-* } .-2 } */
kono
parents:
diff changeset
66
kono
parents:
diff changeset
67 long void x27; /* { dg-error "both 'long' and 'void' in declaration specifiers" } */
kono
parents:
diff changeset
68 short void x28; /* { dg-error "both 'short' and 'void' in declaration specifiers" } */
kono
parents:
diff changeset
69 signed void x29; /* { dg-error "both 'signed' and 'void' in declaration specifiers" } */
kono
parents:
diff changeset
70 unsigned void x30; /* { dg-error "both 'unsigned' and 'void' in declaration specifiers" } */
kono
parents:
diff changeset
71 _Complex void x31; /* { dg-error "both 'complex' and 'void' in declaration specifiers" } */
kono
parents:
diff changeset
72 /* { dg-warning "ISO C90 does not support complex types" "C90" { target *-*-* } .-1 } */
kono
parents:
diff changeset
73 /* { dg-warning "ISO C does not support plain 'complex' meaning 'double complex'" "complex" { target *-*-* } .-2 } */
kono
parents:
diff changeset
74 long _Bool x32; /* { dg-error "both 'long' and '_Bool' in declaration specifiers" } */
kono
parents:
diff changeset
75 /* { dg-warning "ISO C90 does not support boolean types" "C90" { target *-*-* } .-1 } */
kono
parents:
diff changeset
76 short _Bool x33; /* { dg-error "both 'short' and '_Bool' in declaration specifiers" } */
kono
parents:
diff changeset
77 /* { dg-warning "ISO C90 does not support boolean types" "C90" { target *-*-* } .-1 } */
kono
parents:
diff changeset
78 signed _Bool x34; /* { dg-error "both 'signed' and '_Bool' in declaration specifiers" } */
kono
parents:
diff changeset
79 /* { dg-warning "ISO C90 does not support boolean types" "C90" { target *-*-* } .-1 } */
kono
parents:
diff changeset
80 unsigned _Bool x35; /* { dg-error "both 'unsigned' and '_Bool' in declaration specifiers" } */
kono
parents:
diff changeset
81 /* { dg-warning "ISO C90 does not support boolean types" "C90" { target *-*-* } .-1 } */
kono
parents:
diff changeset
82 _Complex _Bool x36; /* { dg-error "both 'complex' and '_Bool' in declaration specifiers" } */
kono
parents:
diff changeset
83 /* { dg-warning "ISO C90 does not support complex types" "C90" { target *-*-* } .-1 } */
kono
parents:
diff changeset
84 /* { dg-warning "ISO C90 does not support boolean types" "C90" { target *-*-* } .-2 } */
kono
parents:
diff changeset
85 /* { dg-warning "ISO C does not support plain 'complex' meaning 'double complex'" "complex" { target *-*-* } .-3 } */
kono
parents:
diff changeset
86 long char x37; /* { dg-error "both 'long' and 'char' in declaration specifiers" } */
kono
parents:
diff changeset
87 short char x38; /* { dg-error "both 'short' and 'char' in declaration specifiers" } */
kono
parents:
diff changeset
88 long float x39; /* { dg-error "both 'long' and 'float' in declaration specifiers" } */
kono
parents:
diff changeset
89 short float x40; /* { dg-error "both 'short' and 'float' in declaration specifiers" } */
kono
parents:
diff changeset
90 signed float x41; /* { dg-error "both 'signed' and 'float' in declaration specifiers" } */
kono
parents:
diff changeset
91 unsigned float x42; /* { dg-error "both 'unsigned' and 'float' in declaration specifiers" } */
kono
parents:
diff changeset
92 long long double x43; /* { dg-error "both 'long long' and 'double' in declaration specifiers" } */
kono
parents:
diff changeset
93 /* { dg-warning "ISO C90 does not support 'long long'" "C90" { target *-*-* } .-1 } */
kono
parents:
diff changeset
94 short double x44; /* { dg-error "both 'short' and 'double' in declaration specifiers" } */
kono
parents:
diff changeset
95 signed double x45; /* { dg-error "both 'signed' and 'double' in declaration specifiers" } */
kono
parents:
diff changeset
96 unsigned double x46; /* { dg-error "both 'unsigned' and 'double' in declaration specifiers" } */