1 | struct __attribute__((trivial_abi)) S_Trivial { |
---|---|
2 | ~S_Trivial() {} |
3 | int ivar = 10; |
4 | }; |
5 | |
6 | S_Trivial takeTrivial(S_Trivial inVal) |
7 | { |
8 | S_Trivial ret_val = inVal; |
9 | ret_val.ivar = 30; |
10 | return ret_val; // Set a breakpoint here |
11 | } |
12 | |
13 | struct S_NotTrivial { |
14 | ~S_NotTrivial() {} |
15 | int ivar = 10; |
16 | }; |
17 | |
18 | S_NotTrivial takeNotTrivial(S_NotTrivial inVal) |
19 | { |
20 | S_NotTrivial ret_val = inVal; |
21 | ret_val.ivar = 30; |
22 | return ret_val; // Set a breakpoint here |
23 | } |
24 | |
25 | int |
26 | main() |
27 | { |
28 | S_Trivial inVal, outVal; |
29 | outVal = takeTrivial(inVal); |
30 | |
31 | S_NotTrivial inNotVal, outNotVal; |
32 | outNotVal = takeNotTrivial(inVal: inNotVal); |
33 | |
34 | return 0; // Set another for return value |
35 | } |
36 |