OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [libgloss/] [testsuite/] [libgloss.all/] [varargs2.c] - Blame information for rev 258

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
/* Oki bug report [OKI013]
2
 
3
   Variable argments test failed.
4
 
5
   Execution result.
6
   val1, val2 = 1, 0
7
   val1, val2 = 2, 0
8
   val1, val2 = 3, 0
9
 
10
   Note, this test case for for traditional style C code.
11
 
12
 */
13
 
14
#include <stdio.h>
15
#include <varargs.h>
16
int     func();
17
 
18
main()
19
{
20
        func(1., 2., 3.);
21
}
22
 
23
func(va_alist)
24
     va_dcl
25
{
26
        va_list p;
27
        double val1, val2;
28
        int j;
29
 
30
        va_start(p);
31
        for (j = 1; j <= 3; ++j){
32
                dequals((double)j, va_arg(p, double));
33
        }
34
        va_end(p);
35
        return (p);
36
}
37
 
38
dequals(double val1, double val2)
39
{
40
        iprintf ("val1 is %d, val2 is %d\n", (int)val1, (int)val2);
41
        if (val1 == val2)
42
                pass ("varargs2 [OKI013]");
43
        else
44
                fail ("varargs2 [OKI013]");
45
 
46
        fflush (stdout);
47
        return;
48
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.