Add _FloatN, _FloatNx tests for __builtin_fpclassify.
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr70123.c
blob55b60779e96cffa2f95234ab2f7858ab02effeea
1 /* { dg-do run } */
2 /* { dg-options "-fPIC" { target fpic } } */
3 __attribute__ ((noinline, noclone)) int
4 bar (int flag, const char *__restrict format, ...)
6 asm volatile ("" : : "r" (flag), "r" (format) : "memory");
7 return 0;
10 extern inline __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) int
11 baz (const char *__restrict fmt, ...)
13 return bar (1, fmt, __builtin_va_arg_pack ());
16 __attribute__ ((noinline, noclone)) int
17 f1 (void **a, const char *b, int *c)
19 *a = 0;
20 *c = 0;
21 asm volatile ("" : : "r" (&a), "r" (b), "r" (&c) : "memory");
22 return 0;
25 __attribute__ ((noinline, noclone)) int
26 f2 (void *a, int b, int c, long d[], int *e)
28 asm volatile ("" : : "r" (a), "r" (b), "r" (c), "r" (d), "r" (e) : "memory");
29 return 1;
32 __attribute__ ((noinline, noclone)) int
33 f3 (void *a, int *b)
35 asm volatile ("" : : "r" (a), "r" (b) : "memory");
36 return 0;
39 __attribute__ ((noinline, noclone)) int
40 f4 (void *a, const char *b, int c, int d, double *e, int f, char **g, int *h)
42 asm volatile ("" : : "r" (a), "r" (b), "r" (c), "r" (d) : "memory");
43 asm volatile ("" : : "r" (e), "r" (f), "r" (g), "r" (h) : "memory");
44 return 0;
47 __attribute__ ((noinline, noclone)) int
48 f5 (void *a, long long b, int c, char **d, char **e, char **f, const char *g, long long h, int *i)
50 asm volatile ("" : : "r" (a), "r" (b), "r" (c), "r" (d) : "memory");
51 asm volatile ("" : : "r" (e), "r" (f), "r" (g), "r" (h) : "memory");
52 asm volatile ("" : : "r" (i) : "memory");
53 return 0;
56 __attribute__ ((noinline, noclone)) int
57 f6 (void *a, int b, int *c, int *d)
59 asm volatile ("" : : "r" (a), "r" (b), "r" (c), "r" (d) : "memory");
60 return 0;
63 __attribute__ ((noinline, noclone)) int
64 f7 (void *a, int b, long long c, long long d, long long e, double *f, int *g)
66 asm volatile ("" : : "r" (a), "r" (b), "r" (c), "r" (d) : "memory");
67 asm volatile ("" : : "r" (e), "r" (f), "r" (g) : "memory");
68 return 0;
71 __attribute__ ((noinline, noclone)) int
72 f8 (void *a, int b, long long c, long long d, long long e, char *f, const char **g, int *h, int *i)
74 asm volatile ("" : : "r" (a), "r" (b), "r" (c), "r" (d) : "memory");
75 asm volatile ("" : : "r" (e), "r" (f), "r" (g), "r" (h) : "memory");
76 asm volatile ("" : : "r" (i) : "memory");
77 return 0;
80 __attribute__ ((noinline, noclone)) int
81 f9 (void *a, int b, long long c, long long d, long long e, char *f, int *g)
83 asm volatile ("" : : "r" (a), "r" (b), "r" (c), "r" (d) : "memory");
84 asm volatile ("" : : "r" (e), "r" (f), "r" (g) : "memory");
85 return 0;
88 __attribute__ ((noinline, noclone)) int
89 f10 (void *a, int b, long long c, long long d, long long e, unsigned char f, unsigned char *g, int *h, int *i)
91 asm volatile ("" : : "r" (a), "r" (b), "r" (c), "r" (d) : "memory");
92 asm volatile ("" : : "r" (e), "r" (f), "r" (g), "r" (h) : "memory");
93 asm volatile ("" : : "r" (i) : "memory");
94 return 0;
97 __attribute__ ((noinline, noclone)) int
98 f11 (void *a, int b, long long c, long long d, long long e, long f, long *g, int *h, int *i)
100 asm volatile ("" : : "r" (a), "r" (b), "r" (c), "r" (d) : "memory");
101 asm volatile ("" : : "r" (e), "r" (f), "r" (g), "r" (h) : "memory");
102 asm volatile ("" : : "r" (i) : "memory");
103 return 0;
106 __attribute__ ((noinline, noclone)) int
107 f12 (void *a, int b, long long c, long long d, long long e, float f, float *g, int *h, int *i)
109 asm volatile ("" : : "r" (a), "r" (b), "r" (c), "r" (d) : "memory");
110 asm volatile ("" : : "r" (e), "r" (f), "r" (g), "r" (h) : "memory");
111 asm volatile ("" : : "r" (i) : "memory");
112 return 0;
115 __attribute__ ((noinline, noclone)) int
116 f13 (void *a, int b, long long c, long *d, long *e, int *f)
118 asm volatile ("" : : "r" (a), "r" (b), "r" (c), "r" (d) : "memory");
119 asm volatile ("" : : "r" (e), "r" (f) : "memory");
120 return 0;
123 __attribute__ ((noinline, noclone)) int
124 f14 (void *a, int b, int *c, int *d)
126 asm volatile ("" : : "r" (a), "r" (b), "r" (c), "r" (d) : "memory");
127 return 0;
130 volatile int a;
133 main ()
135 int b, c, d = 0, e, f = 0;
136 long g, h;
137 int j = 0;
138 long k, l;
139 int m;
140 unsigned char n[21];
141 long o[21];
142 float p[21];
143 double q[21];
144 long r[3], s = 0;
145 char t[42];
146 char u[21];
147 char *v[3];
148 const char *w[21];
149 double x[3] = { 15.1515151515151515, 16.1616161616161616, 17.1717171717171717 };
150 char y[40], z[81];
151 void *a2;
152 char *b2[10], *c2[10], *d2[10];
153 char e2[] = "abcdefghijklm";
154 for (g = 0; g < 21; g++)
155 w[g] = "";
156 f1 (&a2, y, &b);
157 if (b)
158 goto lab;
159 c = 32;
160 if (f2 (a2, c, d, r, &b) > 0)
161 __builtin_strcpy (z, "12345678901234567890123478901234567");
162 if (f3 (a2, &b) > 0)
163 goto lab;
164 if (f4 (a2, "abcdefg", 1, j, x, 14, v, &b) > 0)
165 goto lab;
166 for (g = 0; g < a; g++)
167 goto lab;
168 f5 (a2, s, f, b2, c2, d2, e2, 0L, &b);
169 if (f6 (a2, -1, &e, &b) > 0)
170 goto lab;
171 if (b > 0)
172 goto lab;
173 if (f6 (a2, 1, &e, &b) > 0)
174 goto lab;
175 f7 (a2, 8, g, 1, g, q, &b);
176 for (g = 1; g <= 20; g++)
178 for (h = 0; h < g; h++)
180 t[h] = 0;
181 q[h] = 0;
183 f8 (a2, 1, g, 1, 1, u, w, &m, &b);
184 for (h = 0; h < g; h++)
185 baz (" %2d", t[h]);
186 baz (" %d\nX", b);
187 f9 (a2, 3, g, 1, g, t, &b);
188 for (h = 0; h < g; h++)
189 baz (" %2d", t[h]);
190 f10 (a2, 4, g, 1, g, 99, n, &m, &b);
191 f11 (a2, 6, g, 1, g, 99, o, &m, &b);
192 f12 (a2, 7, g, 1, g, 99., p, &m, &b);
193 f13 (a2, 8, g, &k, &l, &b);
195 f14 (a2, 1, &e, &b);
196 lab:
197 return 0;