Changeset 937e51d for src/examples/control_structures.c
- Timestamp:
- Jun 26, 2015, 4:00:26 PM (10 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:
- 0df292b, e0ff3e6
- Parents:
- eb50842 (diff), 1869adf (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
src/examples/control_structures.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/examples/control_structures.c
reb50842 r937e51d 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo 3 // 4 // The contents of this file are covered under the licence agreement in the 5 // file "LICENCE" distributed with Cforall. 6 // 7 // control_structures.c -- 8 // 9 // Author : Richard C. Bilson 10 // Created On : Wed May 27 17:56:53 2015 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jun 4 14:02:50 2015 13 // Update Count : 24 14 // 15 1 16 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 17 L1: { 18 L2: switch ( 3_333_333 ) { // underscores in constant 19 case 1,2,3: // CFA 20 case 4~8: // CFA 21 case 9 ... 10: // gcc, must have spaces 22 L3: for ( ;; ) { 23 L4: for ( ;; ) { 24 break L1; // labelled break 25 break L2; 26 break L3; 27 break L4; 28 //continue L1; // labelled continue - should be an error 29 //continue L2; // should be an error 30 continue L3; 31 continue L4; 32 } // for 33 } // for 34 break; 35 default: 36 break L1; 37 } // switch 38 3; 39 int i, j; 40 choose ( 7 ) { 41 case 1,2,3: 42 i = 3; 43 4; 44 fallthru; 45 case 4,5,6: 46 j = 3; 47 default: ; 48 } // choose 49 } // block 34 50 35 51 #if 0 36 try {37 int i = 3;38 } catch( int ) {39 } catch( double ) {40 } catch( ... ) {41 } finally {42 } // try52 try { 53 int i = 3; 54 } catch( int ) { 55 } catch( double ) { 56 } catch( ... ) { 57 } finally { 58 } // try 43 59 #endif 44 60 … … 46 62 47 63 // Local Variables: // 48 // compile-command: "../../bin/cfa control_structures.c" // 64 // tab-width: 4 // 65 // compile-command: "cfa control_structures.c" // 49 66 // End: //
Note:
See TracChangeset
for help on using the changeset viewer.