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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [libgloss/] [testsuite/] [libgloss.all/] [varargs2.c] - Diff between revs 158 and 816

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 158 Rev 816
/* Oki bug report [OKI013]
/* Oki bug report [OKI013]
 
 
   Variable argments test failed.
   Variable argments test failed.
 
 
   Execution result.
   Execution result.
   val1, val2 = 1, 0
   val1, val2 = 1, 0
   val1, val2 = 2, 0
   val1, val2 = 2, 0
   val1, val2 = 3, 0
   val1, val2 = 3, 0
 
 
   Note, this test case for for traditional style C code.
   Note, this test case for for traditional style C code.
 
 
 */
 */
 
 
#include <stdio.h>
#include <stdio.h>
#include <varargs.h>
#include <varargs.h>
int     func();
int     func();
 
 
main()
main()
{
{
        func(1., 2., 3.);
        func(1., 2., 3.);
}
}
 
 
func(va_alist)
func(va_alist)
     va_dcl
     va_dcl
{
{
        va_list p;
        va_list p;
        double val1, val2;
        double val1, val2;
        int j;
        int j;
 
 
        va_start(p);
        va_start(p);
        for (j = 1; j <= 3; ++j){
        for (j = 1; j <= 3; ++j){
                dequals((double)j, va_arg(p, double));
                dequals((double)j, va_arg(p, double));
        }
        }
        va_end(p);
        va_end(p);
        return (p);
        return (p);
}
}
 
 
dequals(double val1, double val2)
dequals(double val1, double val2)
{
{
        iprintf ("val1 is %d, val2 is %d\n", (int)val1, (int)val2);
        iprintf ("val1 is %d, val2 is %d\n", (int)val1, (int)val2);
        if (val1 == val2)
        if (val1 == val2)
                pass ("varargs2 [OKI013]");
                pass ("varargs2 [OKI013]");
        else
        else
                fail ("varargs2 [OKI013]");
                fail ("varargs2 [OKI013]");
 
 
        fflush (stdout);
        fflush (stdout);
        return;
        return;
}
}
 
 

powered by: WebSVN 2.1.0

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