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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [rv1p.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// I, Howard Hinnant, hereby place this code in the public domain.
2
 
3
// Test overload resolution among reference types
4
 
5
// { dg-do compile }
6
// { dg-options "-std=c++0x" }
7
 
8
template  struct sa;
9
template <> struct sa {};
10
 
11
struct one   {char x[1];};
12
struct two   {char x[2];};
13
struct three {char x[3];};
14
struct four  {char x[4];};
15
struct five  {char x[5];};
16
struct six   {char x[6];};
17
struct seven {char x[7];};
18
struct eight {char x[8];};
19
 
20
struct A
21
{
22
    A();
23
    A(const volatile A&&);
24
};
25
 
26
               A    source();
27
const          A  c_source();
28
      volatile A  v_source();
29
const volatile A cv_source();
30
 
31
// 1 at a time
32
 
33
one   sink_1_1(               A&);
34
 
35
int test1_1()
36
{
37
                   A a;
38
    const          A ca = a;
39
          volatile A va;
40
    const volatile A cva = a;
41
    sa t1;
42
    return 0;
43
}
44
 
45
two   sink_1_2(const          A&);
46
 
47
int test1_2()
48
{
49
                   A a;
50
    const          A ca = a;
51
          volatile A va;
52
    const volatile A cva = a;
53
    sa t1;
54
    sa t2;
55
    sa t5;
56
    sa t6;
57
    return 0;
58
}
59
 
60
three sink_1_3(volatile       A&);
61
 
62
int test1_3()
63
{
64
                   A a;
65
    const          A ca = a;
66
          volatile A va;
67
    const volatile A cva = a;
68
    sa t1;
69
    sa t3;
70
    return 0;
71
}
72
 
73
four  sink_1_4(const volatile A&);
74
 
75
int test1_4()
76
{
77
                   A a;
78
    const          A ca = a;
79
          volatile A va;
80
    const volatile A cva = a;
81
    sa t1;
82
    sa t2;
83
    sa t3;
84
    sa t4;
85
    return 0;
86
}
87
 
88
five  sink_1_5(               A&&);
89
 
90
int test1_5()
91
{
92
                   A a;
93
    const          A ca = a;
94
          volatile A va;
95
    const volatile A cva = a;
96
    sa t5;
97
    return 0;
98
}
99
 
100
six   sink_1_6(const          A&&);
101
 
102
int test1_6()
103
{
104
                   A a;
105
    const          A ca = a;
106
          volatile A va;
107
    const volatile A cva = a;
108
    sa t5;
109
    sa t6;
110
    return 0;
111
}
112
 
113
seven sink_1_7(volatile       A&&);
114
 
115
int test1_7()
116
{
117
                   A a;
118
    const          A ca = a;
119
          volatile A va;
120
    const volatile A cva = a;
121
    sa t5;
122
    sa t7;
123
    return 0;
124
}
125
 
126
eight sink_1_8(const volatile A&&);
127
 
128
int test1_8()
129
{
130
                   A a;
131
    const          A ca = a;
132
          volatile A va;
133
    const volatile A cva = a;
134
    sa t5;
135
    sa t6;
136
    sa t7;
137
    sa t8;
138
    return 0;
139
}
140
 
141
int main()
142
{
143
    return test1_1() + test1_2() + test1_3() + test1_4() +
144
           test1_5() + test1_6() + test1_7() + test1_8();
145
}

powered by: WebSVN 2.1.0

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