1 /* Test permitted and invalid uses of __fpreg. */
2 /* Origin: Joseph Myers <joseph@codesourcery.com> */
3 /* { dg-do compile } */
4 /* { dg-options "" } */
8 /* Default initialized __fpreg is OK. */
10 /* But explicitly zero-initialized is an invalid conversion. */
11 __fpreg fi
= 0; /* { dg-error "invalid conversion to '__fpreg'" } */
16 /* __fpreg in a structure is OK. */
26 /* Valid operations. */
28 fpreg2
= (__fpreg
) fpreg
;
34 fpreg2
= (struct s
) { 0 }.a
;
35 fpreg
= (d
? fpreg
: fpreg2
);
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'" } */
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'" } */