Debian Codegraph @

gcc/testsuite/gcc.c-torture/compile/930120-1.c

raw
1 /* { dg-require-effective-target untyped_assembly } */
2 /* { dg-additional-options "-std=gnu89" } */
3 union {
4 short I[2];
5 long int L;
6 char C[4];
7 } itolws;
8 char *errflg;
9 long int dot;
10 short dotinc;
11 long int expvf;
12
13 char *
14 f(fcount,ifp,itype,ptype)
15 short fcount;
16 char *ifp;
17 {
18 unsigned w;
19 long int savdot, wx;
20 char *fp;
21 char c, modifier, longpr;
22 union {
23 double dval;
24 struct {
25 int i1;
26 int i2;
27 } ival;
28 } dw;
29 union {
30 float fval;
31 int ival;
32 } fw;
33 int gotdot = 0;
34 while (fcount > 0) {
35 fp = ifp;
36 c = *fp;
37 longpr = ((c >= 'A') & (c <= 'Z') | (c == 'f') | (c == '4') | (c == 'p') | (c == 'i'));
38 if ((itype == 0) || (*fp == 'a')) {
39 wx = dot;
40 w = dot;
41 } else {
42 gotdot = 1;
43 wx = get((int)dot, itype);
44 if (!longpr) {
45 w = (itolws.L=(wx), itolws.I[((dot)&3)>>1]);
46 }
47 }
48 if (c == 'F') {
49 dw.ival.i1 = wx;
50 if (itype == 0) {
51 dw.ival.i2 = expvf;
52 }
53 }
54
55 modifier = *fp++;
56 switch(modifier) {
57 case ' ' :
58 case '\t' :
59 break;
60 case 't':
61 case 'T':
62 printf("%T",fcount);
63 return(fp);
64 case 'r':
65 case 'R':
66 printf("%M",fcount);
67 return(fp);
68 case 'k':
69 printf("%k",w);
70 break;
71 case 'K':
72 printf("%K",wx);
73 break;
74 case 'a':
75 psymoff(dot,ptype,":%16t");
76 dotinc = 0;
77 break;
78 case 'p':
79 psymoff(0,ptype,"%16t");
80 break;
81 case 'u':
82 printf("%-8u",w);
83 break;
84 case 'U':
85 printf("%-16U",wx); break;
86 case 'c':
87 case 'C':
88 if (modifier == 'C') {
89 printesc((int)(itolws.L=(wx), itolws.C[(dot)&3]));
90 } else {
91 printc((char)(itolws.L=(wx), itolws.C[(dot)&3]));
92 }
93 dotinc = 1;
94 break;
95 case 'b':
96 printf("%-8x", (itolws.L=(wx), itolws.C[(dot)&3]));
97 dotinc = 1;
98 break;
99 case 'B':
100 printf("%-8o", (itolws.L=(wx), itolws.C[(dot)&3]));
101 dotinc = 1;
102 break;
103 case 's':
104 case 'S':
105 savdot = dot;
106 dotinc = 1;
107 while ((c = (itolws.L=(wx), itolws.C[(dot)&3])) && (errflg == 0)) {
108 dot = inkdot(1);
109 if (modifier == 'S') {
110 printesc(c);
111 } else {
112 printc(c);
113 }
114 endline();
115 if (!(dot & 3))
116 wx = get((int)dot, itype);
117 }
118 dotinc = dot - savdot + 1;
119 dot = savdot;
120 break;
121 case 'i':
122 if (gotdot) {
123 wx = get((int)(dot & ~3), itype);
124 }
125 iDasm((int)(wx), (unsigned int)0, (unsigned int)(dot&~3));
126 printc('\n');
127 break;
128 case 'f':
129 fw.ival = wx;
130 printf("%-16.9f", fw.fval);
131 dotinc = 4;
132 break;
133 case 'F':
134 printf("%-32.18F", dw.dval);
135 dotinc = 8;
136 break;
137 }
138 }
139 return(fp);
140 }