Changeset 200fcb3 for tests/fallthrough.cfa
- Timestamp:
- Dec 12, 2018, 9:16:12 AM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- 5ebb1368
- Parents:
- 3d99498
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/fallthrough.cfa
r3d99498 r200fcb3 10 10 // Created On : Wed Mar 14 10:06:25 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Nov 8 09:09:09201813 // Update Count : 1 612 // Last Modified On : Tue Dec 4 21:36:14 2018 13 // Update Count : 17 14 14 // 15 15 … … 19 19 choose ( choice ) { 20 20 case 1: 21 sout | "case 1" | endl;21 sout | "case 1"; 22 22 fallthru; 23 23 case 2: 24 sout | "case 2" | endl;24 sout | "case 2"; 25 25 fallthru; 26 sout | "did not fallthru" | endl;26 sout | "did not fallthru"; 27 27 if ( 7 ) fallthru common2; 28 28 fallthru common1; 29 29 case 3: 30 sout | "case 3" | endl;30 sout | "case 3"; 31 31 fallthru default; 32 32 fallthru common1; 33 33 common1: 34 sout | "common1" | endl;34 sout | "common1"; 35 35 // break 36 36 case 4: 37 sout | "case 4" | endl;37 sout | "case 4"; 38 38 fallthru common2; 39 39 case 5: 40 sout | "case 5" | endl;40 sout | "case 5"; 41 41 fallthru common2; 42 42 fallthru default; 43 43 case 6: 44 sout | "case 6" | endl;44 sout | "case 6"; 45 45 fallthru common2; 46 46 common2: 47 sout | "common2" | endl;47 sout | "common2"; 48 48 // break 49 49 default: 50 sout | "default" | endl;50 sout | "default"; 51 51 fallthru; 52 52 } 53 53 54 sout | endl;54 sout | nl; 55 55 56 56 switch ( choice ) { 57 57 case 1: 58 sout | "case 1" | endl;58 sout | "case 1"; 59 59 switch ( choice ) { 60 60 case 1: 61 sout | "case 1" | endl;61 sout | "case 1"; 62 62 for ( int i = 0; i < 4; i += 1 ) { 63 63 printf("%d\n", i); … … 67 67 break; 68 68 case 5: 69 sout | "case 5" | endl;69 sout | "case 5"; 70 70 if ( choice == 5 ) { 71 71 if ( choice != 5 ) { 72 sout | "error" | endl;72 sout | "error"; 73 73 } else { 74 sout | "check" | endl;74 sout | "check"; 75 75 fallthru common; 76 76 } // if … … 117 117 int main() { 118 118 test( 1 ); 119 sout | endl;119 sout | nl; 120 120 test( 5 ); 121 121 }
Note: See TracChangeset
for help on using the changeset viewer.