2 /* { dg-options "-std=gnu99" } */
4 /* C99 Logical AND operator.
5 C99 Logical OR operator.
6 Test with fixed-point operands.
7 Based on the test from ../dfp/. */
9 extern void abort (void);
11 #define OPERATE(OPRD1,OPRT,OPRD2,RLT) \
14 if (( (OPRD1) OPRT (OPRD2) )!= RLT) \
18 #define FIXED_POINT_LOGICAL(OPRD) \
22 OPERATE(1,||,OPRD,1); \
23 OPERATE(0,||,OPRD,1); \
24 OPERATE(OPRD,||,1,1); \
25 OPERATE(OPRD,||,0,1); \
27 OPERATE(1,||,OPRD,1); \
28 OPERATE(0,||,OPRD,0); \
29 OPERATE(OPRD,||,1,1); \
30 OPERATE(OPRD,||,0,0); \
32 OPERATE(1,&&,OPRD,1); \
33 OPERATE(0,&&,OPRD,0); \
34 OPERATE(OPRD,&&,1,1); \
35 OPERATE(OPRD,&&,0,0); \
37 OPERATE(1,&&,OPRD,0); \
38 OPERATE(0,&&,OPRD,0); \
39 OPERATE(OPRD,&&,1,0); \
40 OPERATE(OPRD,&&,0,0); \
50 unsigned short _Fract usf;
52 unsigned long _Fract ulf;
53 unsigned long long _Fract ullf;
54 _Sat short _Fract Ssf;
57 _Sat long long _Fract Sllf;
58 _Sat unsigned short _Fract Susf;
59 _Sat unsigned _Fract Suf;
60 _Sat unsigned long _Fract Sulf;
61 _Sat unsigned long long _Fract Sullf;
66 unsigned short _Accum usa;
68 unsigned long _Accum ula;
69 unsigned long long _Accum ulla;
70 _Sat short _Accum Ssa;
73 _Sat long long _Accum Slla;
74 _Sat unsigned short _Accum Susa;
75 _Sat unsigned _Accum Sua;
76 _Sat unsigned long _Accum Sula;
77 _Sat unsigned long long _Accum Sulla;
79 /* C99 Section 6.5.{13,14} Logical operator. Constraints Each of the
80 operands shall have scalar type. Fixed-point types would obey this. */
81 FIXED_POINT_LOGICAL (sf);
82 FIXED_POINT_LOGICAL (f);
83 FIXED_POINT_LOGICAL (lf);
84 FIXED_POINT_LOGICAL (llf);
85 FIXED_POINT_LOGICAL (usf);
86 FIXED_POINT_LOGICAL (uf);
87 FIXED_POINT_LOGICAL (ulf);
88 FIXED_POINT_LOGICAL (ullf);
89 FIXED_POINT_LOGICAL (Ssf);
90 FIXED_POINT_LOGICAL (Sf);
91 FIXED_POINT_LOGICAL (Slf);
92 FIXED_POINT_LOGICAL (Sllf);
93 FIXED_POINT_LOGICAL (Susf);
94 FIXED_POINT_LOGICAL (Suf);
95 FIXED_POINT_LOGICAL (Sulf);
96 FIXED_POINT_LOGICAL (Sullf);
97 FIXED_POINT_LOGICAL (sa);
98 FIXED_POINT_LOGICAL (a);
99 FIXED_POINT_LOGICAL (la);
100 FIXED_POINT_LOGICAL (lla);
101 FIXED_POINT_LOGICAL (usa);
102 FIXED_POINT_LOGICAL (ua);
103 FIXED_POINT_LOGICAL (ula);
104 FIXED_POINT_LOGICAL (ulla);
105 FIXED_POINT_LOGICAL (Ssa);
106 FIXED_POINT_LOGICAL (Sa);
107 FIXED_POINT_LOGICAL (Sla);
108 FIXED_POINT_LOGICAL (Slla);
109 FIXED_POINT_LOGICAL (Susa);
110 FIXED_POINT_LOGICAL (Sua);
111 FIXED_POINT_LOGICAL (Sula);
112 FIXED_POINT_LOGICAL (Sulla);