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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [opt/] [inline3.C] - Blame information for rev 856

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

Line No. Rev Author Line
1 149 jeremybenn
// PR opt/6793
2
// We failed to supress inlining of a varargs function when it's a template.
3
// { dg-do compile }
4
// { dg-options "-O3" }
5
 
6
#include 
7
 
8
typedef __SIZE_TYPE__ size_t;
9
 
10
template < class Type > class VectorNd
11
{
12
  size_t size;
13
  Type *data;
14
 public:
15
 
16
  VectorNd (size_t _size, size_t count, ...)
17
        : size (_size)
18
  {
19
    data = new Type[size];
20
 
21
    va_list ap;
22
 
23
    va_start (ap, count);
24
 
25
    for (size_t i = 0; i < count; i++)
26
      data[i] = va_arg (ap, Type);
27
 
28
    va_end (ap);
29
  }
30
 
31
  ~VectorNd ()
32
  {
33
    delete [] data;
34
  }
35
};
36
 
37
int main ()
38
{
39
  VectorNd  vector (3, 3, 1.0, 2.0, 3.0);
40
}

powered by: WebSVN 2.1.0

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