1 |
691 |
jeremybenn |
/* Test permitted and invalid uses of __fpreg. */
|
2 |
|
|
/* Origin: Joseph Myers <joseph@codesourcery.com> */
|
3 |
|
|
/* { dg-do compile } */
|
4 |
|
|
/* { dg-options "" } */
|
5 |
|
|
|
6 |
|
|
__float80 f80;
|
7 |
|
|
double d;
|
8 |
|
|
/* Default initialized __fpreg is OK. */
|
9 |
|
|
__fpreg fpreg, fpreg2;
|
10 |
|
|
/* But explicitly zero-initialized is an invalid conversion. */
|
11 |
|
|
__fpreg fi = 0; /* { dg-error "invalid conversion to '__fpreg'" } */
|
12 |
|
|
|
13 |
|
|
__fpreg f0 (__fpreg);
|
14 |
|
|
int f1 (__float80);
|
15 |
|
|
|
16 |
|
|
/* __fpreg in a structure is OK. */
|
17 |
|
|
struct s {
|
18 |
|
|
__float80 b;
|
19 |
|
|
__fpreg a;
|
20 |
|
|
} x;
|
21 |
|
|
|
22 |
|
|
void
|
23 |
|
|
f (void)
|
24 |
|
|
{
|
25 |
|
|
__fpreg *p;
|
26 |
|
|
/* Valid operations. */
|
27 |
|
|
fpreg = fpreg2;
|
28 |
|
|
fpreg2 = (__fpreg) fpreg;
|
29 |
|
|
fpreg = f0 (fpreg2);
|
30 |
|
|
fpreg = +fpreg2;
|
31 |
|
|
p = &fpreg;
|
32 |
|
|
(void) fpreg;
|
33 |
|
|
fpreg = x.a;
|
34 |
|
|
fpreg2 = (struct s) { 0 }.a;
|
35 |
|
|
fpreg = (d ? fpreg : fpreg2);
|
36 |
|
|
d = sizeof (fpreg);
|
37 |
|
|
(void)(fpreg, fpreg);
|
38 |
|
|
/* Invalid operations. */
|
39 |
|
|
++fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
40 |
|
|
--fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
41 |
|
|
fpreg++; /* { dg-error "invalid operation on '__fpreg'" } */
|
42 |
|
|
fpreg--; /* { dg-error "invalid operation on '__fpreg'" } */
|
43 |
|
|
fpreg = -fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
44 |
|
|
fpreg = ~fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
45 |
|
|
d = !fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
46 |
|
|
d = *fpreg; /* { dg-error "invalid type argument" } */
|
47 |
|
|
if (fpreg) /* { dg-error "invalid operation on '__fpreg'" } */
|
48 |
|
|
return;
|
49 |
|
|
d = fpreg; /* { dg-error "invalid conversion from '__fpreg'" } */
|
50 |
|
|
d = (double) fpreg; /* { dg-error "invalid conversion from '__fpreg'" } */
|
51 |
|
|
fpreg = (__fpreg) d; /* { dg-error "invalid conversion to '__fpreg'" } */
|
52 |
|
|
fpreg = fpreg * fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
53 |
|
|
fpreg = fpreg / fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
54 |
|
|
fpreg = fpreg % fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
55 |
|
|
fpreg = fpreg + fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
56 |
|
|
fpreg = fpreg - fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
57 |
|
|
fpreg = fpreg << fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
58 |
|
|
fpreg = fpreg >> fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
59 |
|
|
d = fpreg < fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
60 |
|
|
d = fpreg > fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
61 |
|
|
d = fpreg <= fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
62 |
|
|
d = fpreg >= fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
63 |
|
|
d = fpreg == fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
64 |
|
|
d = fpreg != fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
65 |
|
|
d = fpreg & fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
66 |
|
|
d = fpreg ^ fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
67 |
|
|
d = fpreg | fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
68 |
|
|
d = fpreg && fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
69 |
|
|
d = fpreg || fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
70 |
|
|
d = (fpreg ? 1 : 2); /* { dg-error "invalid operation on '__fpreg'" } */
|
71 |
|
|
fpreg = (d ? fpreg : d); /* { dg-error "invalid conversion to '__fpreg'" } */
|
72 |
|
|
fpreg *= fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
73 |
|
|
fpreg /= fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
74 |
|
|
fpreg %= fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
75 |
|
|
fpreg += fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
76 |
|
|
fpreg -= fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
77 |
|
|
fpreg <<= fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
78 |
|
|
fpreg >>= fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
79 |
|
|
fpreg &= fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
80 |
|
|
fpreg ^= fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
81 |
|
|
fpreg |= fpreg; /* { dg-error "invalid operation on '__fpreg'" } */
|
82 |
|
|
}
|