blob: 39d38c1d8f0f95d843bc0582e0d4b804753f09eb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
/* { dg-do compile } */
/* { dg-options "-Wall" } */
/* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma.
C99 6.4.4.2a (New).
Pragma STDC FLOAT_CONST_DECIMAL64 "shall occur either outside external
declarations or preceding all explicit declarations and statements
inside a compound statement." */
#pragma STDC FLOAT_CONST_DECIMAL64 OFF
#define MAX 200
#pragma STDC FLOAT_CONST_DECIMAL64 ON
double a;
#pragma STDC FLOAT_CONST_DECIMAL64 OFF
struct S1 {
#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
int i;
int j;
};
struct S2 {
int i;
#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
int j;
};
struct S3 {
int i;
int j;
#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
};
enum E1 {
#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-error "#pragma" } */
one,
two
};
enum E2 {
red,
#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-error "#pragma" } */
blue
};
enum E3 {
cat,
dog
#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-error "#pragma" } */
};
double
#pragma STDC FLOAT_CONST_DECIMAL64 OFF /* { dg-error "#pragma" } */
b;
double
f1 (void)
{
#pragma STDC FLOAT_CONST_DECIMAL64 ON
return a;
}
double
f2 (void)
{
double b;
#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
b = 0.5;
return a + b;
}
#pragma STDC FLOAT_CONST_DECIMAL64 OFF
double
f3 (void)
{
typedef double b32;
#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
b32 b = 0.5;
return b;
}
double
f4 (int i)
{
top:
#pragma STDC FLOAT_CONST_DECIMAL64 OFF /* { dg-warning "invalid location" } */
if (i == 0)
return a;
a *= 2.;
i = 0;
goto top;
}
double
f5 (int i)
{
a = a * i;
#pragma STDC FLOAT_CONST_DECIMAL64 OFF /* { dg-warning "invalid location" } */
return a * 2.;
}
double
#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-error "#pragma" } */
f6 (void)
{
return a;
}
double
f7
#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-error "#pragma" } */
(void) /* { dg-error "before" } */
{
return a;
}
double
f8 (void)
{
{
#pragma STDC FLOAT_CONST_DECIMAL64 OFF
}
#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
return a;
}
extern void foo9 (void *);
double
f9 (void)
{
__label__ here;
#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
foo9 (&&here);
here:
return a;
}
double
f10 (void)
{
void foo10 (void)
{
a = 1.0;
}
#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
return a;
}
double
f11 (void)
{
__extension__
struct A {
struct { char a; };
char b;
};
#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
return a;
}
double
f12 (void)
{
__extension__ ({ a = 0.5; });
#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
return a;
}
|