Changeset 13f5a70
- Timestamp:
- Mar 14, 2018, 11:29:40 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:
- 5f61546, 759f05f
- Parents:
- 692afbb
- Location:
- src/tests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/.expect/fallthrough-ERROR.txt
r692afbb r13f5a70 1 fallthrough.c: 54:1 error: 'fallthrough' must be enclosed in a 'switch' or 'choose'2 fallthrough.c: 56:1 error: 'fallthrough' must be enclosed in a 'switch' or 'choose'3 fallthrough.c: 58:1 error: 'fallthrough' must be enclosed in a 'switch' or 'choose'4 fallthrough.c: 65:1 error: 'fallthrough default' must be enclosed in a 'switch' or 'choose' control structure with a 'default' clause5 fallthrough.c: 67:1 error: 'fallthrough' target must be a later case statement: common36 fallthrough.c: 75:1 error: 'fallthrough' target must be a later case statement: common47 fallthrough.c: 77:1 error: 'fallthrough default' must precede the 'default' clause1 fallthrough.c:87:1 error: 'fallthrough' must be enclosed in a 'switch' or 'choose' 2 fallthrough.c:89:1 error: 'fallthrough' must be enclosed in a 'switch' or 'choose' 3 fallthrough.c:91:1 error: 'fallthrough' must be enclosed in a 'switch' or 'choose' 4 fallthrough.c:98:1 error: 'fallthrough default' must be enclosed in a 'switch' or 'choose' control structure with a 'default' clause 5 fallthrough.c:100:1 error: 'fallthrough' target must be a later case statement: common3 6 fallthrough.c:108:1 error: 'fallthrough' target must be a later case statement: common4 7 fallthrough.c:110:1 error: 'fallthrough default' must precede the 'default' clause -
src/tests/.expect/fallthrough.txt
r692afbb r13f5a70 3 3 case 3 4 4 default 5 6 case 1 7 case 1 8 0 9 1 10 2 11 common 12 default 13 5 14 case 5 6 15 common2 16 17 case 5 18 check 19 common 20 default -
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.