line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#include |
2
|
|
|
|
|
|
|
#include |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
using namespace xs; |
5
|
|
|
|
|
|
|
using namespace panda; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
namespace { |
8
|
2
|
|
|
|
|
|
struct RefOnly { |
9
|
|
|
|
|
|
|
string s; |
10
|
2
|
|
|
|
|
|
RefOnly (string s) : s(s) {} |
11
|
|
|
|
|
|
|
}; |
12
|
|
|
|
|
|
|
|
13
|
4
|
|
|
|
|
|
struct ValOnly { |
14
|
|
|
|
|
|
|
string s; |
15
|
4
|
|
|
|
|
|
ValOnly (string s) : s(s) {} |
16
|
|
|
|
|
|
|
}; |
17
|
|
|
|
|
|
|
|
18
|
4
|
|
|
|
|
|
struct RefAndVal { |
19
|
|
|
|
|
|
|
string s; |
20
|
4
|
|
|
|
|
|
RefAndVal (string s) : s(s) {} |
21
|
|
|
|
|
|
|
}; |
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
|
|
|
struct PtrOnly { |
24
|
|
|
|
|
|
|
string s; |
25
|
2
|
|
|
|
|
|
PtrOnly (string s) : s(s) {} |
26
|
|
|
|
|
|
|
}; |
27
|
|
|
|
|
|
|
|
28
|
4
|
|
|
|
|
|
struct PtrAndVal { |
29
|
|
|
|
|
|
|
string s; |
30
|
4
|
|
|
|
|
|
PtrAndVal (string s) : s(s) {} |
31
|
|
|
|
|
|
|
}; |
32
|
|
|
|
|
|
|
|
33
|
4
|
|
|
|
|
|
struct RefAndPtr { |
34
|
|
|
|
|
|
|
string s; |
35
|
4
|
|
|
|
|
|
RefAndPtr (string s) : s(s) {} |
36
|
|
|
|
|
|
|
}; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
namespace xs { |
40
|
|
|
|
|
|
|
template<> struct Typemap : TypemapBase { |
41
|
1
|
50
|
|
|
|
|
static RefOnly& in (const Simple& arg) { static RefOnly r(""); r.s = arg.as_string() + "iR&"; return r; } |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
42
|
1
|
50
|
|
|
|
|
static Sv out (RefOnly& v, const Sv& = {}) { return Simple(v.s + "oR&"); } |
43
|
|
|
|
|
|
|
}; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
template<> struct Typemap : TypemapBase { |
46
|
2
|
50
|
|
|
|
|
static ValOnly in (const Simple& arg) { return ValOnly(arg.as_string() + "iV"); } |
|
|
50
|
|
|
|
|
|
47
|
2
|
50
|
|
|
|
|
static Sv out (const ValOnly& v, const Sv& = {}) { return Simple(v.s + "oV"); } |
48
|
|
|
|
|
|
|
}; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
template<> struct Typemap : TypemapBase { |
51
|
1
|
50
|
|
|
|
|
static RefAndVal in (const Simple& arg) { return RefAndVal(arg.as_string() + "iRV"); } |
|
|
50
|
|
|
|
|
|
52
|
1
|
50
|
|
|
|
|
static Sv out (const RefAndVal& v, const Sv& = {}) { return Simple(v.s + "oRV"); } |
53
|
|
|
|
|
|
|
}; |
54
|
|
|
|
|
|
|
template<> struct Typemap : TypemapBase { |
55
|
1
|
50
|
|
|
|
|
static RefAndVal& in (const Simple& arg) { static RefAndVal r(""); r.s = arg.as_string() + "iRV&"; return r; } |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
56
|
1
|
50
|
|
|
|
|
static Sv out (RefAndVal& v, const Sv& = {}) { return Simple(v.s + "oRV&"); } |
57
|
|
|
|
|
|
|
}; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
template<> struct Typemap : TypemapBase { |
60
|
2
|
100
|
|
|
|
|
static PtrOnly* in (const Simple& arg) { static PtrOnly r(""); r.s = arg.as_string() + "iP*"; return &r; } |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
61
|
2
|
50
|
|
|
|
|
static Sv out (PtrOnly* v, const Sv& = {}) { return Simple(v->s + "oP*"); } |
62
|
|
|
|
|
|
|
}; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
template<> struct Typemap : TypemapBase { |
65
|
1
|
50
|
|
|
|
|
static PtrAndVal in (const Simple& arg) { return PtrAndVal(arg.as_string() + "iPV"); } |
|
|
50
|
|
|
|
|
|
66
|
1
|
50
|
|
|
|
|
static Sv out (const PtrAndVal& v, const Sv& = {}) { return Simple(v.s + "oPV"); } |
67
|
|
|
|
|
|
|
}; |
68
|
|
|
|
|
|
|
template<> struct Typemap : TypemapBase { |
69
|
2
|
100
|
|
|
|
|
static PtrAndVal* in (const Simple& arg) { static PtrAndVal r(""); r.s = arg.as_string() + "iPV*"; return &r; } |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
70
|
2
|
50
|
|
|
|
|
static Sv out (PtrAndVal* v, const Sv& = {}) { return Simple(v->s + "oPV*"); } |
71
|
|
|
|
|
|
|
}; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
template<> struct Typemap : TypemapBase { |
74
|
1
|
50
|
|
|
|
|
static RefAndPtr& in (const Simple& arg) { static RefAndPtr r(""); r.s = arg.as_string() + "iRP&"; return r; } |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
75
|
1
|
50
|
|
|
|
|
static Sv out (RefAndPtr& v, const Sv& = {}) { return Simple(v.s + "oRP&"); } |
76
|
|
|
|
|
|
|
}; |
77
|
|
|
|
|
|
|
template<> struct Typemap : TypemapBase { |
78
|
1
|
50
|
|
|
|
|
static RefAndPtr* in (const Simple& arg) { static RefAndPtr r(""); r.s = arg.as_string() + "iRP*"; return &r; } |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
79
|
1
|
50
|
|
|
|
|
static Sv out (RefAndPtr* v, const Sv& = {}) { return Simple(v->s + "oRP*"); } |
80
|
|
|
|
|
|
|
}; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
40
|
|
|
|
|
|
TEST_CASE("ref&", "[ref&]") { |
84
|
7
|
50
|
|
|
|
|
SECTION("ref only") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
85
|
2
|
50
|
|
|
|
|
auto ret = out(in(Sv())); |
|
|
50
|
|
|
|
|
|
86
|
1
|
50
|
|
|
|
|
CHECK(Simple(ret) == "iR&oR&"); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
87
|
|
|
|
|
|
|
} |
88
|
7
|
50
|
|
|
|
|
SECTION("val only") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
89
|
2
|
50
|
|
|
|
|
auto ret = out(in(Sv())); |
|
|
50
|
|
|
|
|
|
90
|
1
|
50
|
|
|
|
|
CHECK(Simple(ret) == "iVoV"); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
91
|
1
|
50
|
|
|
|
|
ret = out(in(Sv())); |
|
|
50
|
|
|
|
|
|
92
|
1
|
50
|
|
|
|
|
CHECK(Simple(ret) == "iVoV"); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
93
|
|
|
|
|
|
|
} |
94
|
7
|
50
|
|
|
|
|
SECTION("ref and val") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
95
|
2
|
50
|
|
|
|
|
auto ret = out(in(Sv())); |
|
|
50
|
|
|
|
|
|
96
|
1
|
50
|
|
|
|
|
CHECK(Simple(ret) == "iRVoRV"); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
97
|
1
|
50
|
|
|
|
|
ret = out(in(Sv())); |
|
|
50
|
|
|
|
|
|
98
|
1
|
50
|
|
|
|
|
CHECK(Simple(ret) == "iRV&oRV&"); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
99
|
|
|
|
|
|
|
} |
100
|
7
|
50
|
|
|
|
|
SECTION("ptr only") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
101
|
2
|
50
|
|
|
|
|
auto ret = out(in(Sv())); |
|
|
50
|
|
|
|
|
|
102
|
1
|
50
|
|
|
|
|
CHECK(Simple(ret) == "iP*oP*"); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
103
|
1
|
50
|
|
|
|
|
ret = out(&in(Sv())); |
|
|
50
|
|
|
|
|
|
104
|
1
|
50
|
|
|
|
|
CHECK(Simple(ret) == "iP*oP*"); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
105
|
|
|
|
|
|
|
} |
106
|
7
|
50
|
|
|
|
|
SECTION("ptr and val") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
107
|
2
|
50
|
|
|
|
|
auto ret = out(in(Sv())); |
|
|
50
|
|
|
|
|
|
108
|
1
|
50
|
|
|
|
|
CHECK(Simple(ret) == "iPVoPV"); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
109
|
1
|
50
|
|
|
|
|
ret = out(in(Sv())); |
|
|
50
|
|
|
|
|
|
110
|
1
|
50
|
|
|
|
|
CHECK(Simple(ret) == "iPV*oPV*"); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
111
|
1
|
50
|
|
|
|
|
ret = out(&in(Sv())); |
|
|
50
|
|
|
|
|
|
112
|
1
|
50
|
|
|
|
|
CHECK(Simple(ret) == "iPV*oPV*"); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
113
|
|
|
|
|
|
|
} |
114
|
7
|
50
|
|
|
|
|
SECTION("ref and ptr") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
115
|
2
|
50
|
|
|
|
|
auto ret = out(in(Sv())); |
|
|
50
|
|
|
|
|
|
116
|
1
|
50
|
|
|
|
|
CHECK(Simple(ret) == "iRP*oRP*"); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
117
|
1
|
50
|
|
|
|
|
ret = out(in(Sv())); |
|
|
50
|
|
|
|
|
|
118
|
1
|
50
|
|
|
|
|
CHECK(Simple(ret) == "iRP&oRP&"); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
119
|
|
|
|
|
|
|
} |
120
|
142
|
50
|
|
|
|
|
} |
|
|
50
|
|
|
|
|
|