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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [arm/] [fp16-variadic-1.c] - Blame information for rev 715

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

Line No. Rev Author Line
1 691 jeremybenn
/* Test promotion of __fp16 to double as arguments to variadic function.  */
2
 
3
/* { dg-do run } */
4
/* { dg-options "-mfp16-format=ieee" } */
5
 
6
#include <stdlib.h>
7
#include <stdarg.h>
8
 
9
extern int f (int n, ...);
10
 
11
int
12
f (int n, ...)
13
{
14
  if (n == 2)
15
    {
16
      double xx, yy;
17
      va_list ap;
18
      va_start (ap, n);
19
      xx = va_arg (ap, double);
20
      yy = va_arg (ap, double);
21
      va_end (ap);
22
      if (xx == 42.0 && yy == -42.0)
23
        return 1;
24
    }
25
  return 0;
26
}
27
 
28
static __fp16 x = 42.0;
29
static __fp16 y = -42.0;
30
 
31
int
32
main (void)
33
{
34
  if (!f (2, x, y))
35
    abort ();
36
  return 0;
37
}

powered by: WebSVN 2.1.0

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