Welcome to mirror list, hosted at ThFree Co, Russian Federation.

varargs2.c « libgloss.all « testsuite « libgloss - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9e590fcde016e45f10db190fbaa79e158d3fadeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* Oki bug report [OKI013] 

   Variable argments test failed.

   Execution result.
   val1, val2 = 1, 0
   val1, val2 = 2, 0
   val1, val2 = 3, 0

   Note, this test case for for traditional style C code.

 */

#include <stdio.h>
#include <varargs.h>
int     func();

main()
{
        func(1., 2., 3.);
}

func(va_alist)
     va_dcl
{
        va_list p;
	double val1, val2;
        int j;

        va_start(p);
        for (j = 1; j <= 3; ++j){
                dequals((double)j, va_arg(p, double));
        }
        va_end(p);
        return (p);
}

dequals(double val1, double val2)
{
        iprintf ("val1 is %d, val2 is %d\n", (int)val1, (int)val2);
        if (val1 == val2)
                pass ("varargs2 [OKI013]");
        else
                fail ("varargs2 [OKI013]");

        fflush (stdout);
        return;
}