Changeset 13f5a70 for src/tests/fallthrough.c
- Timestamp:
- Mar 14, 2018, 11:29:40 PM (5 years ago)
- Branches:
- aaron-thesis, arm-eh, 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:
- 5f61546, 759f05f
- Parents:
- 692afbb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/fallthrough.c
r692afbb r13f5a70 9 9 // Author : Rob Schluntz 10 10 // Created On : Wed Mar 14 10:06:25 2018 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Wed Mar 14 10:32:12201813 // Update Count : 211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 14 22:45:13 2018 13 // Update Count : 13 14 14 // 15 15 … … 31 31 common1: 32 32 printf("common1\n"); 33 / * break */33 // break 34 34 case 4: 35 35 printf("case 4\n"); … … 44 44 common2: 45 45 printf("common2\n"); 46 / * break */46 // break 47 47 default: 48 48 printf("default\n"); 49 49 fallthru; 50 50 } 51 52 printf("\n"); 53 54 switch ( choice ) { 55 case 1: 56 printf("case 1\n"); 57 switch ( choice ) { 58 case 1: 59 printf("case 1\n"); 60 for ( int i = 0; i < 4; i += 1 ) { 61 printf("%d\n", i); 62 if ( i == 2 ) fallthru common; 63 } // for 64 } // switch 65 break; 66 case 5: 67 printf("case 5\n"); 68 if ( choice == 5 ) { 69 if ( choice != 5 ) { 70 printf("error\n"); 71 } else { 72 printf("check\n"); 73 fallthru common; 74 } // if 75 } // if 76 common: 77 printf( "common\n" ); 78 fallthru; 79 break; 80 default: 81 printf( "default\n" ); 82 fallthru; 83 } // switch 51 84 52 85 #if ERR1 … … 82 115 int main() { 83 116 test(1); 117 printf("\n"); 84 118 test(5); 85 119 } … … 87 121 // Local Variables: // 88 122 // tab-width: 4 // 89 // compile-command: "cfa dtor-early-exit" //123 // compile-command: "cfa fallthrough.c" // 90 124 // End: //
Note: See TracChangeset
for help on using the changeset viewer.