- Timestamp:
- Apr 27, 2018, 2:35:11 PM (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, with_gc
- Children:
- 399a908, a0c7d5cc
- Parents:
- b9f383f (diff), 9d5fb67 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/references.c
rb9f383f r5527759 75 75 printf("%d %d\n", r1, x); 76 76 77 ((int&)r3) = 6;// change x, ***r377 r3 = 6; // change x, ***r3 78 78 printf("x = %d ; x2 = %d\n", x, x2); // check that x was changed 79 ((int*&)&r3) = &x2;// change r1 to refer to x2, (&*)**r380 ((int&)r3) = 999;// modify x279 &r3 = &x2; // change r1 to refer to x2, (&*)**r3 80 r3 = 999; // modify x2 81 81 printf("x = %d ; x2 = %d\n", x, x2); // check that x2 was changed 82 ((int**&)&&r3) = p2; // change r2, (&(&*)*)*r3 83 ((int&)r3) = 12345;// modify x82 ((int**&)&&r3) = p2; // change r2, (&(&*)*)*r3, ensure explicit cast to reference works 83 r3 = 12345; // modify x 84 84 printf("x = %d ; x2 = %d\n", x, x2); // check that x was changed 85 ((int***&)&&&r3) = p3;// change r3 to p3, (&(&(&*)*)*)r386 ((int&)r3) = 22222; // modify x 85 &&&r3 = p3; // change r3 to p3, (&(&(&*)*)*)r3 86 ((int&)r3) = 22222; // modify x, ensure explicit cast to reference works 87 87 printf("x = %d ; x2 = %d\n", x, x2); // check that x was changed 88 88
Note: See TracChangeset
for help on using the changeset viewer.