2 /* { dg-options "-std=gnu99" } */
4 /* C99 6.5.3 Unary operators.
6 Check unary operators ++ -- + - !. */
8 extern void abort (void);
10 #define INCDEC(TYPE,POSTFIX) \
11 { TYPE a = 0.0 ## POSTFIX; \
12 if (a++ != 0.0 ## POSTFIX) \
14 if (a != 1.0 ## POSTFIX) \
16 if (a-- != 1.0 ## POSTFIX) \
18 if (a != 0.0 ## POSTFIX) \
20 if (++a != 1.0 ## POSTFIX) \
22 if (a != 1.0 ## POSTFIX) \
24 if (--a != 0.0 ## POSTFIX) \
26 if (a != 0.0 ## POSTFIX) \
30 #define FRACT_INCDEC(TYPE,POSTFIX) \
31 { TYPE a = -0.5 ## POSTFIX; \
32 if (a++ != -0.5 ## POSTFIX) \
34 if (a != 0.5 ## POSTFIX) \
36 if (a-- != 0.5 ## POSTFIX) \
38 if (a != -0.5 ## POSTFIX) \
40 if (++a != 0.5 ## POSTFIX) \
42 if (a != 0.5 ## POSTFIX) \
44 if (--a != -0.5 ## POSTFIX) \
46 if (a != -0.5 ## POSTFIX) \
50 #define FRACT_SAT_INCDEC(TYPE,POSTFIX) \
51 { TYPE a = 0.9 ## POSTFIX; \
52 if (++a != 1.0 ## POSTFIX) \
54 a = -0.1 ## POSTFIX; \
55 if (--a != -0.5 ## POSTFIX - 0.5 ## POSTFIX) \
59 #define FRACT_SAT_UNS_INCDEC(TYPE,POSTFIX) \
60 { TYPE a = 0.9 ## POSTFIX; \
61 if (++a != 1.0 ## POSTFIX) \
64 if (--a != 0.0 ## POSTFIX) \
68 #define PLUS(TYPE,POSTFIX) \
69 { TYPE a = 0.1 ## POSTFIX; \
70 if (+a != 0.1 ## POSTFIX) \
74 #define NEG(TYPE,POSTFIX) \
75 { TYPE a = -0.1 ## POSTFIX; \
76 if (-a != 0.1 ## POSTFIX) \
80 #define FRACT_SAT_NEG(TYPE,POSTFIX) \
81 { TYPE a = -0.5 ## POSTFIX - 0.5 ## POSTFIX; \
82 if (-a != 1.0 ## POSTFIX) \
86 #define UNS_NEG(TYPE,POSTFIX) \
87 { TYPE a = 0.0 ## POSTFIX; \
88 if (-a != 0.0 ## POSTFIX) \
92 #define FRACT_SAT_UNS_NEG(TYPE,POSTFIX) \
93 { TYPE a = 0.5 ## POSTFIX; \
94 if (-a != 0.0 ## POSTFIX) \
98 #define LOGNEG(TYPE,POSTFIX) \
99 { TYPE a = 0.0 ## POSTFIX; \
100 TYPE b = 0.1 ## POSTFIX; \
109 FRACT_INCDEC(short _Fract
, hr
);
110 FRACT_INCDEC(_Fract
, r
);
111 FRACT_INCDEC(long _Fract
, lr
);
112 FRACT_INCDEC(long long _Fract
, llr
);
113 FRACT_INCDEC(_Sat
short _Fract
, hr
);
114 FRACT_INCDEC(_Sat _Fract
, r
);
115 FRACT_INCDEC(_Sat
long _Fract
, lr
);
116 FRACT_INCDEC(_Sat
long long _Fract
, llr
);
118 INCDEC(short _Accum
, hk
);
120 INCDEC(long _Accum
, lk
);
121 INCDEC(long long _Accum
, llk
);
122 INCDEC(unsigned short _Accum
, uhk
);
123 INCDEC(unsigned _Accum
, uk
);
124 INCDEC(unsigned long _Accum
, ulk
);
125 INCDEC(unsigned long long _Accum
, ullk
);
126 INCDEC(_Sat
short _Accum
, hk
);
127 INCDEC(_Sat _Accum
, k
);
128 INCDEC(_Sat
long _Accum
, lk
);
129 INCDEC(_Sat
long long _Accum
, llk
);
130 INCDEC(_Sat
unsigned short _Accum
, uhk
);
131 INCDEC(_Sat
unsigned _Accum
, uk
);
132 INCDEC(_Sat
unsigned long _Accum
, ulk
);
133 INCDEC(_Sat
unsigned long long _Accum
, ullk
);
135 FRACT_SAT_INCDEC(_Sat
short _Fract
, hr
);
136 FRACT_SAT_INCDEC(_Sat _Fract
, r
);
137 FRACT_SAT_INCDEC(_Sat
long _Fract
, lr
);
138 FRACT_SAT_INCDEC(_Sat
long long _Fract
, llr
);
140 FRACT_SAT_UNS_INCDEC(_Sat
unsigned short _Fract
, uhr
);
141 FRACT_SAT_UNS_INCDEC(_Sat
unsigned _Fract
, ur
);
142 FRACT_SAT_UNS_INCDEC(_Sat
unsigned long _Fract
, ulr
);
143 FRACT_SAT_UNS_INCDEC(_Sat
unsigned long long _Fract
, ullr
);
145 PLUS(short _Fract
, hr
);
147 PLUS(long _Fract
, lr
);
148 PLUS(long long _Fract
, llr
);
149 PLUS(unsigned short _Fract
, uhr
);
150 PLUS(unsigned _Fract
, ur
);
151 PLUS(unsigned long _Fract
, ulr
);
152 PLUS(unsigned long long _Fract
, ullr
);
153 PLUS(_Sat
short _Fract
, hr
);
154 PLUS(_Sat _Fract
, r
);
155 PLUS(_Sat
long _Fract
, lr
);
156 PLUS(_Sat
long long _Fract
, llr
);
157 PLUS(_Sat
unsigned short _Fract
, uhr
);
158 PLUS(_Sat
unsigned _Fract
, ur
);
159 PLUS(_Sat
unsigned long _Fract
, ulr
);
160 PLUS(_Sat
unsigned long long _Fract
, ullr
);
161 PLUS(short _Accum
, hk
);
163 PLUS(long _Accum
, lk
);
164 PLUS(long long _Accum
, llk
);
165 PLUS(unsigned short _Accum
, uhk
);
166 PLUS(unsigned _Accum
, uk
);
167 PLUS(unsigned long _Accum
, ulk
);
168 PLUS(unsigned long long _Accum
, ullk
);
169 PLUS(_Sat
short _Accum
, hk
);
170 PLUS(_Sat _Accum
, k
);
171 PLUS(_Sat
long _Accum
, lk
);
172 PLUS(_Sat
long long _Accum
, llk
);
173 PLUS(_Sat
unsigned short _Accum
, uhk
);
174 PLUS(_Sat
unsigned _Accum
, uk
);
175 PLUS(_Sat
unsigned long _Accum
, ulk
);
176 PLUS(_Sat
unsigned long long _Accum
, ullk
);
178 NEG(short _Fract
, hr
);
180 NEG(long _Fract
, lr
);
181 NEG(long long _Fract
, llr
);
182 NEG(_Sat
short _Fract
, hr
);
184 NEG(_Sat
long _Fract
, lr
);
185 NEG(_Sat
long long _Fract
, llr
);
186 NEG(short _Accum
, hk
);
188 NEG(long _Accum
, lk
);
189 NEG(long long _Accum
, llk
);
190 NEG(_Sat
short _Accum
, hk
);
192 NEG(_Sat
long _Accum
, lk
);
193 NEG(_Sat
long long _Accum
, llk
);
195 FRACT_SAT_NEG(_Sat
short _Fract
, hr
);
196 FRACT_SAT_NEG(_Sat _Fract
, r
);
197 FRACT_SAT_NEG(_Sat
long _Fract
, lr
);
198 FRACT_SAT_NEG(_Sat
long long _Fract
, llr
);
200 UNS_NEG(short _Fract
, hr
);
202 UNS_NEG(long _Fract
, lr
);
203 UNS_NEG(long long _Fract
, llr
);
204 UNS_NEG(_Sat
short _Fract
, hr
);
205 UNS_NEG(_Sat _Fract
, r
);
206 UNS_NEG(_Sat
long _Fract
, lr
);
207 UNS_NEG(_Sat
long long _Fract
, llr
);
208 UNS_NEG(short _Accum
, hk
);
210 UNS_NEG(long _Accum
, lk
);
211 UNS_NEG(long long _Accum
, llk
);
212 UNS_NEG(_Sat
short _Accum
, hk
);
213 UNS_NEG(_Sat _Accum
, k
);
214 UNS_NEG(_Sat
long _Accum
, lk
);
215 UNS_NEG(_Sat
long long _Accum
, llk
);
217 FRACT_SAT_UNS_NEG(_Sat
unsigned short _Fract
, uhr
);
218 FRACT_SAT_UNS_NEG(_Sat
unsigned _Fract
, ur
);
219 FRACT_SAT_UNS_NEG(_Sat
unsigned long _Fract
, ulr
);
220 FRACT_SAT_UNS_NEG(_Sat
unsigned long long _Fract
, ullr
);
222 LOGNEG(short _Fract
, hr
);
224 LOGNEG(long _Fract
, lr
);
225 LOGNEG(long long _Fract
, llr
);
226 LOGNEG(unsigned short _Fract
, uhr
);
227 LOGNEG(unsigned _Fract
, ur
);
228 LOGNEG(unsigned long _Fract
, ulr
);
229 LOGNEG(unsigned long long _Fract
, ullr
);
230 LOGNEG(_Sat
short _Fract
, hr
);
231 LOGNEG(_Sat _Fract
, r
);
232 LOGNEG(_Sat
long _Fract
, lr
);
233 LOGNEG(_Sat
long long _Fract
, llr
);
234 LOGNEG(_Sat
unsigned short _Fract
, uhr
);
235 LOGNEG(_Sat
unsigned _Fract
, ur
);
236 LOGNEG(_Sat
unsigned long _Fract
, ulr
);
237 LOGNEG(_Sat
unsigned long long _Fract
, ullr
);
238 LOGNEG(short _Accum
, hk
);
240 LOGNEG(long _Accum
, lk
);
241 LOGNEG(long long _Accum
, llk
);
242 LOGNEG(unsigned short _Accum
, uhk
);
243 LOGNEG(unsigned _Accum
, uk
);
244 LOGNEG(unsigned long _Accum
, ulk
);
245 LOGNEG(unsigned long long _Accum
, ullk
);
246 LOGNEG(_Sat
short _Accum
, hk
);
247 LOGNEG(_Sat _Accum
, k
);
248 LOGNEG(_Sat
long _Accum
, lk
);
249 LOGNEG(_Sat
long long _Accum
, llk
);
250 LOGNEG(_Sat
unsigned short _Accum
, uhk
);
251 LOGNEG(_Sat
unsigned _Accum
, uk
);
252 LOGNEG(_Sat
unsigned long _Accum
, ulk
);
253 LOGNEG(_Sat
unsigned long long _Accum
, ullk
);