1 // Test permitted and invalid uses of __fpreg, for C++.
2 // Origin: Joseph Myers <joseph@codesourcery.com>
3 // { dg-do compile { target ia64-*-* } }
8 // Default initialized __fpreg is OK.
10 // But explicitly zero-initialized is an invalid conversion.
11 __fpreg fi = 0; // { dg-error "error: invalid conversion to '__fpreg'" }
16 // __fpreg in a structure is OK.
28 fpreg2 = (__fpreg) fpreg;
34 fpreg2 = (struct s) { 0 }.a;
35 fpreg = (d ? fpreg : fpreg2);
38 // Invalid operations.
39 ++fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
40 --fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
41 fpreg++; // { dg-error "error: invalid operation on '__fpreg'" }
42 fpreg--; // { dg-error "error: invalid operation on '__fpreg'" }
43 fpreg = -fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
44 fpreg = ~fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
45 d = !fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
46 d = *fpreg; // { dg-error "error: invalid type argument" }
47 if (fpreg) // { dg-error "error: invalid conversion from '__fpreg'" }
49 d = fpreg; // { dg-error "error: invalid conversion from '__fpreg'" }
50 d = (double) fpreg; // { dg-error "error: invalid conversion from '__fpreg'" }
51 fpreg = (__fpreg) d; // { dg-error "error: invalid conversion to '__fpreg'" }
52 fpreg = fpreg * fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
53 fpreg = fpreg / fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
54 fpreg = fpreg % fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
55 fpreg = fpreg + fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
56 fpreg = fpreg - fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
57 fpreg = fpreg << fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
58 fpreg = fpreg >> fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
59 d = fpreg < fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
60 d = fpreg > fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
61 d = fpreg <= fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
62 d = fpreg >= fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
63 d = fpreg == fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
64 d = fpreg != fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
65 d = fpreg & fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
66 d = fpreg ^ fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
67 d = fpreg | fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
68 d = fpreg && fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
69 d = fpreg || fpreg; // { dg-error "error: invalid operation on '__fpreg'" }
70 d = (fpreg ? 1 : 2); // { dg-error "error: invalid conversion from '__fpreg'" }
71 fpreg = (d ? fpreg : d); // { dg-error "error: invalid conversion to '__fpreg'" }
72 fpreg *= fpreg; // { dg-error "error: invalid operation on '__fpreg'|in evaluation" }
73 fpreg /= fpreg; // { dg-error "error: invalid operation on '__fpreg'|in evaluation" }
74 fpreg %= fpreg; // { dg-error "error: invalid operation on '__fpreg'|in evaluation" }
75 fpreg += fpreg; // { dg-error "error: invalid operation on '__fpreg'|in evaluation" }
76 fpreg -= fpreg; // { dg-error "error: invalid operation on '__fpreg'|in evaluation" }
77 fpreg <<= fpreg; // { dg-error "error: invalid operation on '__fpreg'|in evaluation" }
78 fpreg >>= fpreg; // { dg-error "error: invalid operation on '__fpreg'|in evaluation" }
79 fpreg &= fpreg; // { dg-error "error: invalid operation on '__fpreg'|in evaluation" }
80 fpreg ^= fpreg; // { dg-error "error: invalid operation on '__fpreg'|in evaluation" }
81 fpreg |= fpreg; // { dg-error "error: invalid operation on '__fpreg'|in evaluation" }