Changeset b8b64c34 for tests/raii
- Timestamp:
- Feb 27, 2025, 3:17:20 PM (5 weeks ago)
- Branches:
- master
- Children:
- 3483185
- Parents:
- 9506c70
- Location:
- tests/raii
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified tests/raii/ctor-autogen.cfa ¶
r9506c70 rb8b64c34 1 1 // TODO: add error cases (e.g., use of field constructors for managed types, etc.) 2 2 3 enum Colo r { R, G, B };3 enum Colour { R, G, B }; 4 4 5 5 // empty struct/union should have generated ctor/dtors … … 21 21 // struct/union with members with generated ctor/dtors should themselves have generated ctor/dtors 22 22 union PopulatedUnion { 23 Colo r c;23 Colour c; 24 24 U u; 25 25 S s; … … 27 27 28 28 struct PopulatedStruct { 29 Colo r c;29 Colour c; 30 30 U u; 31 31 S s; … … 109 109 S s; 110 110 U u; 111 Colo r e;111 Colour e = R; 112 112 113 // identity(R); Colo r constant should be Color which is otype114 identity(e); // Colo r should be an otype113 // identity(R); Colour constant should be Colour which is otype 114 identity(e); // Colour should be an otype 115 115 identity(u); // U should be an otype 116 116 identity(s); // S should be an otype … … 139 139 identity(dsi); 140 140 identity(dsd); 141 // identity(dui); // xxx - codegen errors in generated thunk _temp3 (Box-pass-generated assignment return-temporary)142 //identity(dud);141 identity(dui); 142 identity(dud); 143 143 identity(dssi); 144 144 identity(dssf); -
TabularUnified tests/raii/dtor-early-exit.cfa ¶
r9506c70 rb8b64c34 23 23 }; 24 24 25 // don't want these called26 void ?{}(A & a) { assert( false ); }27 25 void ?{}(A & a, const char * name) { a.name = name; sout | "construct " | name; a.x = (int*)malloc(); } 28 void ?{}(A & a, const char * name, int * ptr) { assert( false ); } 26 // Don't want these called: 27 void ?{}(A &) { assert( false ); } 28 void ?{}(A &, const char *, int *) { assert( false ); } 29 29 30 30 A ?=?(A & a, A b) { sout | "assign " | a.name | " " | b.name; return a; } … … 110 110 if (j == 0) { 111 111 sout | "continue L2"; 112 continue ;// destruct y - missing because object that needs to be destructed is not a part of this block, it's a part of the for's block112 continue L2; // destruct y - missing because object that needs to be destructed is not a part of this block, it's a part of the for's block 113 113 } else if (j == 1) { 114 114 sout | "break L2"; 115 break ; // destruct y115 break L2; // destruct y 116 116 } else if (i == 1) { 117 117 sout | "continue L1"; … … 222 222 if(true) continue; 223 223 int t = 0; 224 (void)t; 224 225 } 225 226 } -
TabularUnified tests/raii/init_once.cfa ¶
r9506c70 rb8b64c34 75 75 } 76 76 77 void ?{}(init_once & x, init_once other) {77 void ?{}(init_once & x, init_once) { 78 78 x{}; // reuse default ctor 79 79 } … … 131 131 init_once x; 132 132 init_once y = x; 133 } // fall through 133 } 134 fallthrough; 134 135 default: { 135 136 init_once x;
Note: See TracChangeset
for help on using the changeset viewer.