|
|
1.1 ! root 1: /* The Plum Hall Validation Suite for C ! 2: * Unpublished copyright (c) 1986-1991, Chiron Systems Inc and Plum Hall Inc. ! 3: * VERSION: 4 ! 4: * DATE: 1993-01-01 ! 5: * The "ANSI" mode of this suite corresponds to official ANSI C, X3.159-1989. ! 6: * As per your license agreement, your distribution is not to be moved or copied outside the Designated Site ! 7: * without specific permission from Plum Hall Inc. ! 8: */ ! 9: ! 10: ! 11: #include "flags.h" ! 12: #ifndef SKIP48 ! 13: #define LIB_TEST 1 ! 14: #include "defs.h" ! 15: ! 16: /* ! 17: * 4.8 - Variable arguments <stdarg.h> ! 18: * This file is not relevant for pre ANSI C compilers. ! 19: */ ! 20: ! 21: #if !ANSI ! 22: void d4_8() ! 23: { ! 24: } ! 25: #else ! 26: ! 27: #include <stdarg.h> ! 28: int d4_8_1(int, ...); ! 29: ! 30: void d4_8() ! 31: { ! 32: Filename = "d48.c"; ! 33: ! 34: /* make sure that va_start and va_arg are macros */ ! 35: #if !defined(va_start) || !defined(va_end) ! 36: complain(__LINE__); ! 37: #endif ! 38: iequals(__LINE__, 1, d4_8_1(1, 1, 2, 3)); ! 39: iequals(__LINE__, 2, d4_8_1(2, 1., 2., 3.)); ! 40: } ! 41: ! 42: ! 43: ! 44: ! 45: ! 46: ! 47: ! 48: ! 49: ! 50: ! 51: ! 52: #if NEW_STYLE_FN_DEF ! 53: int d4_8_1(int i, ...) ! 54: #else ! 55: int d4_8_1(i) ! 56: int i; ! 57: #endif ! 58: { ! 59: va_list p; ! 60: int j; ! 61: ! 62: va_start(p, i); ! 63: for (j = 1; j <= 3; ++j) ! 64: { ! 65: if (i == 1) ! 66: iequals(__LINE__, j, va_arg(p, int)); ! 67: else ! 68: dequals(__LINE__, (double)j, va_arg(p, double)); ! 69: } ! 70: va_end(p); ! 71: return (i); ! 72: } ! 73: #endif ! 74: ! 75: #else /* if SKIP48 */ ! 76: void d4_8() { pr_skip("d4_8: SKIPPED ENTIRELY\n"); } ! 77: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.