2018-02-09 Sebastian Perta <sebastian.perta@renesas.com>
[official-gcc.git] / gcc / testsuite / gcc.target / arm / pr70278.c
blob97034166f46ee7d19b7c6819a67c58d7ab580b1a
1 /* { dg-do compile } */
2 /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv4t" } } */
3 /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */
4 /* { dg-require-effective-target arm_arch_v4t_ok } */
5 /* { dg-require-effective-target arm_thumb1_ok } */
6 /* { dg-options "-mthumb" } */
7 /* { dg-add-options arm_arch_v4t } */
8 /*
9 * ====================================================
10 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
12 * Developed at SunPro, a Sun Microsystems, Inc. business.
13 * Permission to use, copy, modify, and distribute this
14 * software is freely granted, provided that this notice
15 * is preserved.
16 * ====================================================
18 typedef union
20 double value;
21 struct
23 unsigned int msw;
24 } parts;
25 } ieee_double_shape_type;
26 double __ieee754_hypot(double x, double y)
28 double a=x,b=y,t1,t2,y1,y2,w;
29 int j,k,ha,hb;
30 do { ieee_double_shape_type gh_u; gh_u.value = (x); (ha) = gh_u.parts.msw; } while (0);;
31 if(hb > ha) {a=y;b=x;j=ha; ha=hb;hb=j;} else {a=x;b=y;}
32 if(ha > 0x5f300000) {
33 do { ieee_double_shape_type sh_u; sh_u.value = (a); sh_u.parts.msw = (ha); (a) = sh_u.value; } while (0);;
35 w = a-b;
36 if (w <= b)
38 t2 = a - t1;
39 w = t1*y1-(w*(-w)-(t1*y2+t2*b));
41 if(k!=0) {
42 } else return w;