1 |
298 |
jeremybenn |
/* { dg-do compile } */
|
2 |
|
|
/* { dg-options "-std=gnu99" } */
|
3 |
|
|
|
4 |
|
|
/* N1169 6.5.7 - Bitwise shift operands.
|
5 |
|
|
C99 6.5.3 Unary operators.
|
6 |
|
|
C99 6.5.5 Multiplicative operators.
|
7 |
|
|
C99 6.5.6 Additive operators.
|
8 |
|
|
C99 6.5.7 Bitwise shift operators.
|
9 |
|
|
C99 6.5.8 Relational operators.
|
10 |
|
|
C99 6.5.9 Equality operators.
|
11 |
|
|
C99 6.5.16 Assignment operators.
|
12 |
|
|
|
13 |
|
|
Check if all operations are ok. */
|
14 |
|
|
|
15 |
|
|
void true();
|
16 |
|
|
void false();
|
17 |
|
|
|
18 |
|
|
#define ALLOP(TYPE,NAME) \
|
19 |
|
|
TYPE test1 ## NAME (TYPE a) { return +a; } \
|
20 |
|
|
TYPE test2 ## NAME (TYPE a) { return -a; } \
|
21 |
|
|
int test3 ## NAME (TYPE a) { return !a; } \
|
22 |
|
|
TYPE test4 ## NAME (TYPE a, TYPE b) { return a + b; } \
|
23 |
|
|
TYPE test5 ## NAME (TYPE a, TYPE b) { return a - b; } \
|
24 |
|
|
TYPE test6 ## NAME (TYPE a, TYPE b) { return a * b; } \
|
25 |
|
|
TYPE test7 ## NAME (TYPE a, TYPE b) { return a / b; } \
|
26 |
|
|
TYPE test8 ## NAME (TYPE a, TYPE b) { a += b; return a; } \
|
27 |
|
|
TYPE test9 ## NAME (TYPE a, TYPE b) { a -= b; return a; } \
|
28 |
|
|
TYPE test10 ## NAME (TYPE a, TYPE b) { a *= b; return a; } \
|
29 |
|
|
TYPE test11 ## NAME (TYPE a, TYPE b) { a /= b; return a; } \
|
30 |
|
|
TYPE test12 ## NAME (TYPE a, int b) { return a << b; } \
|
31 |
|
|
TYPE test13 ## NAME (TYPE a, int b) { return a >> b; } \
|
32 |
|
|
TYPE test14 ## NAME (TYPE a, int b) { a <<= b; return a; } \
|
33 |
|
|
TYPE test15 ## NAME (TYPE a, int b) { a >>= b; return a; } \
|
34 |
|
|
int test16 ## NAME (TYPE a, TYPE b) { return a == b; } \
|
35 |
|
|
int test17 ## NAME (TYPE a, TYPE b) { return a != b; } \
|
36 |
|
|
int test18 ## NAME (TYPE a, TYPE b) { return a < b; } \
|
37 |
|
|
int test19 ## NAME (TYPE a, TYPE b) { return a <= b; } \
|
38 |
|
|
int test20 ## NAME (TYPE a, TYPE b) { return a >= b; } \
|
39 |
|
|
int test21 ## NAME (TYPE a, TYPE b) { return a > b; } \
|
40 |
|
|
void test22 ## NAME (TYPE a, TYPE b) { if(a == b)true(); else false(); } \
|
41 |
|
|
void test23 ## NAME (TYPE a, TYPE b) { if(a != b)true(); else false(); } \
|
42 |
|
|
void test24 ## NAME (TYPE a, TYPE b) { if(a < b)true(); else false(); } \
|
43 |
|
|
void test25 ## NAME (TYPE a, TYPE b) { if(a <= b)true(); else false(); } \
|
44 |
|
|
void test26 ## NAME (TYPE a, TYPE b) { if(a >= b)true(); else false(); } \
|
45 |
|
|
void test27 ## NAME (TYPE a, TYPE b) { if(a > b)true(); else false(); } \
|
46 |
|
|
TYPE test28 ## NAME (TYPE a) { return ++a; } \
|
47 |
|
|
TYPE test29 ## NAME (TYPE a) { return --a; } \
|
48 |
|
|
TYPE test30 ## NAME (TYPE *a) { return ++(*a); } \
|
49 |
|
|
TYPE test31 ## NAME (TYPE *a) { return (*a)++; } \
|
50 |
|
|
TYPE test32 ## NAME (TYPE *a) { return --(*a); } \
|
51 |
|
|
TYPE test33 ## NAME (TYPE *a) { return (*a)--; }
|
52 |
|
|
|
53 |
|
|
ALLOP(short _Fract, sf);
|
54 |
|
|
ALLOP(_Fract, f);
|
55 |
|
|
ALLOP(long _Fract, lf);
|
56 |
|
|
ALLOP(long long _Fract, llf);
|
57 |
|
|
ALLOP(short _Accum, sa);
|
58 |
|
|
ALLOP(_Accum, a);
|
59 |
|
|
ALLOP(long _Accum, la);
|
60 |
|
|
ALLOP(long long _Accum, lla);
|
61 |
|
|
|
62 |
|
|
ALLOP(unsigned short _Fract, usf);
|
63 |
|
|
ALLOP(unsigned _Fract, uf);
|
64 |
|
|
ALLOP(unsigned long _Fract, ulf);
|
65 |
|
|
ALLOP(unsigned long long _Fract, ullf);
|
66 |
|
|
ALLOP(unsigned short _Accum, usa);
|
67 |
|
|
ALLOP(unsigned _Accum, ua);
|
68 |
|
|
ALLOP(unsigned long _Accum, ula);
|
69 |
|
|
ALLOP(unsigned long long _Accum, ulla);
|
70 |
|
|
|
71 |
|
|
ALLOP(_Sat short _Fract, Ssf);
|
72 |
|
|
ALLOP(_Sat _Fract, Sf);
|
73 |
|
|
ALLOP(_Sat long _Fract, Slf);
|
74 |
|
|
ALLOP(_Sat long long _Fract, Sllf);
|
75 |
|
|
ALLOP(_Sat short _Accum, Ssa);
|
76 |
|
|
ALLOP(_Sat _Accum, Sa);
|
77 |
|
|
ALLOP(_Sat long _Accum, Sla);
|
78 |
|
|
ALLOP(_Sat long long _Accum, Slla);
|
79 |
|
|
|
80 |
|
|
ALLOP(_Sat unsigned short _Fract, Susf);
|
81 |
|
|
ALLOP(_Sat unsigned _Fract, Suf);
|
82 |
|
|
ALLOP(_Sat unsigned long _Fract, Sulf);
|
83 |
|
|
ALLOP(_Sat unsigned long long _Fract, Sullf);
|
84 |
|
|
ALLOP(_Sat unsigned short _Accum, Susa);
|
85 |
|
|
ALLOP(_Sat unsigned _Accum, Sua);
|
86 |
|
|
ALLOP(_Sat unsigned long _Accum, Sula);
|
87 |
|
|
ALLOP(_Sat unsigned long long _Accum, Sulla);
|