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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [template/] [stdarg1.C] - Blame information for rev 801

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

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/47022
2
// { dg-do compile }
3
// Suppress a warning that is irrelevant to the purpose of this test.
4
// { dg-options "-Wno-abi" { target arm_eabi } }
5
 
6
#include 
7
 
8
template 
9
void
10
f1 (T *p, va_list ap)
11
{
12
  *p = va_arg (ap, long double);
13
  *p += va_arg (ap, double);
14
}
15
 
16
template 
17
void
18
f2 (T *p, va_list ap)
19
{
20
  *p = __real__ va_arg (ap, _Complex int);
21
  *p += __imag__ va_arg (ap, _Complex double);
22
  *p += __imag__ va_arg (ap, _Complex long double);
23
}
24
 
25
template 
26
void
27
f3 (T *p, va_list ap)
28
{
29
  *p = va_arg (ap, T);
30
}
31
 
32
void
33
foo (int x, va_list ap)
34
{
35
  if (x == 0)
36
    {
37
      long double ld;
38
      f1 (&ld, ap);
39
    }
40
  else if (x == 1)
41
    {
42
      int i;
43
      f2 (&i, ap);
44
    }
45
  else if (x == 2)
46
    {
47
      long double ld;
48
      f3 (&ld, ap);
49
    }
50
  else if (x == 3)
51
    {
52
      _Complex double cd;
53
      f3 (&cd, ap);
54
    }
55
}

powered by: WebSVN 2.1.0

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