- Timestamp:
- Oct 19, 2017, 11:15:36 AM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 1a5ad8c
- Parents:
- a365e0d
- git-author:
- Rob Schluntz <rschlunt@…> (10/18/17 11:42:59)
- git-committer:
- Rob Schluntz <rschlunt@…> (10/19/17 11:15:36)
- Location:
- src/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/.expect/references.txt
ra365e0d r12536d3 10 10 Destructing a Y 11 11 Destructing a Y 12 Default constructing a Y 13 Copy constructing a Y 14 Value constructing a Y 56 15 Value constructing a Y 78 16 Copy constructing a Y 17 Copy constructing a Y 18 Assigning a Y 19 Copy constructing a Y 12 20 Destructing a Y 13 21 Destructing a Y 22 Copy constructing a Y 23 Assigning a Y 24 Copy constructing a Y 25 Destructing a Y 26 Destructing a Y 27 Copy constructing a Y 28 Destructing a Y 29 Destructing a Y 30 Destructing a Y 31 Destructing a Y 32 Destructing a Y 33 Destructing a Y 34 Destructing a Y 35 Destructing a Y -
src/tests/references.c
ra365e0d r12536d3 19 19 void ^?{}(Y & y) { printf("Destructing a Y\n"); } 20 20 Y ?=?(Y & y, Y other) { printf("Assigning a Y\n"); return y; } 21 void ?{}(Y & y, int i) { printf("Value constructing a Y %d\n", i); y.i = i; } 21 22 22 23 struct X { Y & r; Y y; }; … … 31 32 } 32 33 X ?=?(X & x, X other) { return x; } 34 35 // ensure that generated functions do not implicitly operate on references 36 struct Z { Y & r; Y y; }; 33 37 34 38 // test user-defined reference-returning function … … 67 71 X x1, x2 = x1; 68 72 x1 = x2; 73 74 Z z1, z2 = z1; 75 Y z1r = 56, z2r = 78; 76 &z1.r = &z1r; 77 &z2.r = &z2r; 78 z1 = z2; 69 79 } 70 80
Note: See TracChangeset
for help on using the changeset viewer.