source: src/examples/control_structures.c @ 30651b0

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newstringwith_gc
Last change on this file since 30651b0 was 86bd7c1f, checked in by Peter A. Buhr <pabuhr@…>, 9 years ago

licencing: eighth groups of files

  • Property mode set to 100644
File size: 1.3 KB
Line 
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 : Wed May 27 18:07:42 2015
13// Update Count     : 1
14//
15
16int main() {
17        L1: {
18                L2: switch ( 3_333_333 ) {                                              // underscores in constant
19                        case 1,2,3:                                                                     // 4~8, 4...8 not working
20                                L3: for ( ;; ) {
21                                        L4: for ( ;; ) {
22                                                break L1;                                               // labelled break
23                                                break L2;
24                                                break L3;
25                                                break L4;
26
27                                                //continue L1;                                  // labelled continue - should be an error
28                                                //continue L2;                                  // should be an error
29                                                continue L3;
30                                                continue L4;
31                                        } // for
32                                } // for
33                                break;
34                        default:
35                                break L1;
36                } // switch
37                3;
38                int i, j;
39                choose ( 7 ) {
40                        case 1,2,3:
41                                i = 3;
42                                fallthru;
43                        case 4,5,6:
44                                j = 3;
45                        default: ;
46                } // choose
47        } // block
48
49#if 0
50        try {
51                int i = 3;
52        } catch( int ) {
53        } catch( double ) {
54        } catch( ... ) {
55        } finally {
56        } // try
57#endif
58
59} // main
60
61// Local Variables: //
62// tab-width: 4 //
63// compile-command: "cfa control_structures.c" //
64// End: //
Note: See TracBrowser for help on using the repository browser.