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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do run }
2
// { dg-options -std=c++0x }
3
 
4
struct A
5
{
6
  int i = 42;
7
};
8
 
9
struct B
10
{
11
  int i = 42;
12
  B() { }
13
  B(int i): i(i) { }
14
};
15
 
16
template 
17
struct C
18
{
19
  T m = t;
20
};
21
 
22
template 
23
struct D
24
{
25
  T m = t;
26
  D() { }
27
  D(T m):m(m) { }
28
};
29
 
30
int main()
31
{
32
  A a1;
33
  if (a1.i != 42) return 1;
34
  A a2{};
35
  if (a2.i != 42) return 2;
36
  A a3[1];
37
  if (a3[0].i != 42) return 3;
38
 
39
  B b1;
40
  if (b1.i != 42) return 3;
41
  B b2 (24);
42
  if (b2.i != 24) return 4;
43
 
44
  C c1;
45
  if (c1.m != 3) return 5;
46
  C c2 {};
47
  if (c2.m != 5) return 6;
48
 
49
  D d1;
50
  if (d1.m != 3) return 7;
51
  D d2 (5) ;
52
  if (d2.m != 5) return 8;
53
}

powered by: WebSVN 2.1.0

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