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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [opt/] [tmp1.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do run }
2
 
3
 
4
// Copyright (C) 2003 Free Software Foundation, Inc.
5
// Contributed by Nathan Sidwell 30 Jul 2003 
6
 
7
// compound exprs were causing additional temporaries.
8
 
9
extern "C" int printf (char const *, ...);
10
extern "C" void abort ();
11
 
12
 
13
static unsigned order[] =
14
{
15
  1, 2, 502, 102, 101,
16
 
17
};
18
 
19
static unsigned point;
20
 
21
static void Check (unsigned t, unsigned i, void const *ptr, char const *name)
22
{
23
  printf ("%d %d %p %s\n", t, i, ptr, name);
24
 
25
  if (order[point++] != i + t)
26
    abort ();
27
 
28
}
29
 
30
template  struct A
31
{
32
  A () { Check (0, I, this, __PRETTY_FUNCTION__); }
33
  ~A () { Check (100, I, this, __PRETTY_FUNCTION__); }
34
  A (A const &) { Check (200, I, this, __PRETTY_FUNCTION__); }
35
  A &operator= (A const &) { Check (300, I, this, __PRETTY_FUNCTION__); }
36
  void Foo () const { Check (400, I, this, __PRETTY_FUNCTION__); }
37
};
38
 
39
template  void Foo (A a)
40
{
41
  Check (500, I, &a, __PRETTY_FUNCTION__);
42
}
43
 
44
int main ()
45
{
46
  Foo ((A<1> (), A<2> ()));
47
  Check (0, 0, 0, "end");
48
}

powered by: WebSVN 2.1.0

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