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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [trailing3.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
// More auto/decltype mangling tests.
2
// { dg-options "-std=c++0x -fabi-version=0" }
3
 
4
template 
5
struct B
6
{
7
  static int i;
8
};
9
 
10
int&& x();
11
 
12
template 
13
struct A
14
{
15
  static int i;
16
  static int &ir;
17
  static int &&irr;
18
  template 
19
  auto f(U u) -> decltype (u + i);
20
  template 
21
  auto fr(U u) -> decltype (u + ir);
22
  template 
23
  auto frr(U u) -> decltype (u + irr);
24
  template 
25
  auto g(U u) -> decltype (u + sizeof (i));
26
  template 
27
  auto h(U u) -> decltype (u + B::i);
28
  template 
29
  auto j(U u) -> decltype (u + x());
30
};
31
 
32
template template
33
auto A::f(U u) -> decltype (u + i)
34
{
35
  return u + i;
36
}
37
 
38
template 
39
int f (Args... args);
40
 
41
template 
42
auto g (Args... args) -> decltype (f ((args+1)...))
43
{
44
  return (f ((args+1)...));
45
}
46
 
47
int main()
48
{
49
  // { dg-final { scan-assembler  "_ZN1AIiE1fIiEEDTplfp_L_ZNS0_1iEEET_" } }
50
  A().f(1);
51
  // { dg-final { scan-assembler  "_ZN1AIiE2frIiEEDTplfp_L_ZNS0_2irEEET_" } }
52
  A().fr(1);
53
  // { dg-final { scan-assembler  "_ZN1AIiE3frrIiEEDTplfp_L_ZNS0_3irrEEET_" } }
54
  A().frr(1);
55
  // { dg-final { scan-assembler  "_ZN1AIiE1gIiEEDTplfp_szL_ZNS0_1iEEET_" } }
56
  A().g(1);
57
  // { dg-final { scan-assembler  "_ZN1AIiE1hIiEEDTplfp_sr1BIT_E1iES3_" } }
58
  A().h(1);
59
  // { dg-final { scan-assembler  "_ZN1AIiE1jIiEEDTplfp_clL_Z1xvEEET_" } }
60
  A().j(1);
61
  // { dg-final { scan-assembler  "_Z1gIJidEEDTcl1fspplfp_Li1EEEDpT_" } }
62
  g(42, 1.0);
63
}

powered by: WebSVN 2.1.0

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