Changeset 9d5fb67
- Timestamp:
- Apr 23, 2018, 3:56:52 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:
- 1cdfa82, 5527759, 842c3d3, bc82fac
- Parents:
- 57acae0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/references.c
r57acae0 r9d5fb67 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.