xref: /minix3/lib/libc/gdtoa/test/xQtest.c (revision f14fb602092e015ff630df58e17c2a9cd57d29b3)
1*f14fb602SLionel Sambuc /****************************************************************
2*f14fb602SLionel Sambuc 
3*f14fb602SLionel Sambuc The author of this software is David M. Gay.
4*f14fb602SLionel Sambuc 
5*f14fb602SLionel Sambuc Copyright (C) 2002 by Lucent Technologies
6*f14fb602SLionel Sambuc All Rights Reserved
7*f14fb602SLionel Sambuc 
8*f14fb602SLionel Sambuc Permission to use, copy, modify, and distribute this software and
9*f14fb602SLionel Sambuc its documentation for any purpose and without fee is hereby
10*f14fb602SLionel Sambuc granted, provided that the above copyright notice appear in all
11*f14fb602SLionel Sambuc copies and that both that the copyright notice and this
12*f14fb602SLionel Sambuc permission notice and warranty disclaimer appear in supporting
13*f14fb602SLionel Sambuc documentation, and that the name of Lucent or any of its entities
14*f14fb602SLionel Sambuc not be used in advertising or publicity pertaining to
15*f14fb602SLionel Sambuc distribution of the software without specific, written prior
16*f14fb602SLionel Sambuc permission.
17*f14fb602SLionel Sambuc 
18*f14fb602SLionel Sambuc LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
19*f14fb602SLionel Sambuc INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
20*f14fb602SLionel Sambuc IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
21*f14fb602SLionel Sambuc SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
22*f14fb602SLionel Sambuc WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
23*f14fb602SLionel Sambuc IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
24*f14fb602SLionel Sambuc ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
25*f14fb602SLionel Sambuc THIS SOFTWARE.
26*f14fb602SLionel Sambuc 
27*f14fb602SLionel Sambuc ****************************************************************/
28*f14fb602SLionel Sambuc 
29*f14fb602SLionel Sambuc #include <stdio.h>
30*f14fb602SLionel Sambuc 
31*f14fb602SLionel Sambuc  int
main(void)32*f14fb602SLionel Sambuc main(void)
33*f14fb602SLionel Sambuc {
34*f14fb602SLionel Sambuc 	union { long double d; unsigned int bits[4]; } u, w;
35*f14fb602SLionel Sambuc 	switch(sizeof(long double)) {
36*f14fb602SLionel Sambuc 	  case 16:
37*f14fb602SLionel Sambuc 		w.bits[0] = w.bits[3] = 0;
38*f14fb602SLionel Sambuc 		w.d = 1.;
39*f14fb602SLionel Sambuc 		u.d = 3.;
40*f14fb602SLionel Sambuc 		w.d = w.d / u.d;
41*f14fb602SLionel Sambuc 		if (w.bits[0] && w.bits[3])
42*f14fb602SLionel Sambuc 			printf("cp x.ou0 x.out; cp xL.ou0 xL.out;"
43*f14fb602SLionel Sambuc 				" cp Q.ou1 Q.out; cp pftestQ.out pftest.out\n");
44*f14fb602SLionel Sambuc 		else
45*f14fb602SLionel Sambuc 			printf("cp x.ou0 x.out; cp xL.ou0 xL.out;"
46*f14fb602SLionel Sambuc 				" cp Q.ou0 Q.out; cp pftestx.out pftest.out\n");
47*f14fb602SLionel Sambuc 		break;
48*f14fb602SLionel Sambuc 	  case 10:
49*f14fb602SLionel Sambuc 	  case 12:
50*f14fb602SLionel Sambuc 		printf("cp x.ou1 x.out; cp xL.ou1 xL.out; cp Q.ou0 Q.out;"
51*f14fb602SLionel Sambuc 			" cp pftestx.out pftest.out\n");
52*f14fb602SLionel Sambuc 		break;
53*f14fb602SLionel Sambuc 	  default:
54*f14fb602SLionel Sambuc 		printf("cp x.ou0 x.out; cp xL.ou0 xL.out; cp Q.ou0 Q.out;"
55*f14fb602SLionel Sambuc 			" cp pftestx.out pftest.out\n");
56*f14fb602SLionel Sambuc 	  }
57*f14fb602SLionel Sambuc 	return 0;
58*f14fb602SLionel Sambuc 	}
59