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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [rvo.C] - Blame information for rev 774

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

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do run }
2
// { dg-options "-std=c++0x" }
3
// Contributed by Sylvain Pion
4
static int rvalue_constructions = 0;
5
 
6
struct A {
7
  A ()         { }
8
  A (const A&) { }
9
  A (A&&)      { ++rvalue_constructions; }
10
  ~A ()        { }
11
};
12
 
13
A f() {  return A(); }
14
 
15
extern "C" {
16
  void abort(void);
17
}
18
 
19
int main()
20
{
21
  A c = f();
22
 
23
  if (rvalue_constructions != 0)
24
    abort();
25
}

powered by: WebSVN 2.1.0

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