xref: /netbsd-src/regress/lib/libc/ieeefp/testfloat/fail.c (revision ce099b40997c43048fb78bd578195f81d2456523)
1*ce099b40Smartin /*	$NetBSD: fail.c,v 1.5 2008/04/28 20:23:04 martin Exp $	*/
289f51f80Sross 
389f51f80Sross /* This is a derivative work. */
489f51f80Sross 
589f51f80Sross /*-
689f51f80Sross  * Copyright (c) 2001 The NetBSD Foundation, Inc.
789f51f80Sross  * All rights reserved.
889f51f80Sross  *
989f51f80Sross  * This code is derived from software contributed to The NetBSD Foundation
1089f51f80Sross  * by Ross Harvey.
1189f51f80Sross  *
1289f51f80Sross  * Redistribution and use in source and binary forms, with or without
1389f51f80Sross  * modification, are permitted provided that the following conditions
1489f51f80Sross  * are met:
1589f51f80Sross  * 1. Redistributions of source code must retain the above copyright
1689f51f80Sross  *    notice, this list of conditions and the following disclaimer.
1789f51f80Sross  * 2. Redistributions in binary form must reproduce the above copyright
1889f51f80Sross  *    notice, this list of conditions and the following disclaimer in the
1989f51f80Sross  *    documentation and/or other materials provided with the distribution.
2089f51f80Sross  *
2189f51f80Sross  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
2289f51f80Sross  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2389f51f80Sross  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2489f51f80Sross  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2589f51f80Sross  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2689f51f80Sross  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2789f51f80Sross  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2889f51f80Sross  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2989f51f80Sross  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3089f51f80Sross  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3189f51f80Sross  * POSSIBILITY OF SUCH DAMAGE.
3289f51f80Sross  */
33122b058aSross 
34122b058aSross /*
35122b058aSross ===============================================================================
36122b058aSross 
37122b058aSross This C source file is part of TestFloat, Release 2a, a package of programs
38122b058aSross for testing the correctness of floating-point arithmetic complying to the
39122b058aSross IEC/IEEE Standard for Floating-Point.
40122b058aSross 
41122b058aSross Written by John R. Hauser.  More information is available through the Web
42122b058aSross page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
43122b058aSross 
44122b058aSross THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
45122b058aSross has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
46122b058aSross TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
47122b058aSross PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
48122b058aSross AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
49122b058aSross 
50122b058aSross Derivative works are acceptable, even for commercial purposes, so long as
51122b058aSross (1) they include prominent notice that the work is derivative, and (2) they
52122b058aSross include prominent notice akin to these four paragraphs for those parts of
53122b058aSross this code that are retained.
54122b058aSross 
55122b058aSross ===============================================================================
56122b058aSross */
57122b058aSross 
58122b058aSross #include <stdlib.h>
59122b058aSross #include <stdarg.h>
60122b058aSross #include <stdio.h>
61122b058aSross #include "milieu.h"
62122b058aSross #include "fail.h"
63122b058aSross 
64a9cb2700Sross const char *fail_programName = "";
65122b058aSross 
fail(const char * message,...)66122b058aSross void fail( const char *message, ... )
67122b058aSross {
68122b058aSross     va_list varArgs;
69122b058aSross 
70122b058aSross     fprintf( stderr, "%s: ", fail_programName );
71122b058aSross     va_start( varArgs, message );
72122b058aSross     vfprintf( stderr, message, varArgs );
73122b058aSross     va_end( varArgs );
74122b058aSross     fputs( ".\n", stderr );
75122b058aSross     exit( EXIT_FAILURE );
76122b058aSross 
77122b058aSross }
78122b058aSross 
79