Changeset be5aa1b for src/examples
- Timestamp:
- May 27, 2015, 4:40:05 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 46cbfe1, 52ac3b4
- Parents:
- 6aa5ec0f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/examples/control_structures.c
r6aa5ec0f rbe5aa1b 1 1 int main() { 2 L1: { 3 L2: switch ( 3_333_333 ) { // underscores in constant 4 case 1,2,3: // 4~8, 4...8 not working 5 L3: for ( ;; ) { 6 L4: for ( ;; ) { 7 break L1; // labelled break 8 break L2; 9 break L3; 10 break L4; 11 #if 0 12 continue L1; // labelled continue 13 continue L2; 14 continue L3; 15 continue L4; 16 #endif 17 } // for 18 } // for 19 break; 20 default: 21 break L1; 22 } // switch 23 3; 24 int i, j; 25 choose ( 7 ) { 26 case 1,2,3: 27 i = 3; 28 fallthru; 29 case 4,5,6: 30 j = 3; 31 default: ; 32 } // choose 33 } // block 2 L1: { 3 L2: switch ( 3_333_333 ) { // underscores in constant 4 case 1,2,3: // 4~8, 4...8 not working 5 L3: for ( ;; ) { 6 L4: for ( ;; ) { 7 break L1; // labelled break 8 break L2; 9 break L3; 10 break L4; 11 12 // continue L1; // labelled continue - should be an error 13 // continue L2; // should be an error 14 continue L3; 15 continue L4; 16 } // for 17 } // for 18 break; 19 default: 20 break L1; 21 } // switch 22 3; 23 int i, j; 24 choose ( 7 ) { 25 case 1,2,3: 26 i = 3; 27 fallthru; 28 case 4,5,6: 29 j = 3; 30 default: ; 31 } // choose 32 } // block 34 33 35 34 #if 0 36 37 int i = 3;38 39 40 41 42 35 try { 36 int i = 3; 37 } catch( int ) { 38 } catch( double ) { 39 } catch( ... ) { 40 } finally { 41 } // try 43 42 #endif 44 43
Note: See TracChangeset
for help on using the changeset viewer.