source: tests/quasiKeyword.cfa @ 7a2972b9

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 7a2972b9 was 07c77ce, checked in by Peter A. Buhr <pabuhr@…>, 4 years ago

add test for quasi-keywords

  • Property mode set to 100644
File size: 1.2 KB
Line 
1//
2// Cforall Version 1.0.0 Copyright (C) 2021 University of Waterloo
3//
4// quasiKeyword.cfa -- test that quasi-keywords can be used for variable and functions names, as well as keywords in
5//                                         control structures.
6//
7// Author           : Peter A. Buhr
8// Created On       : Wed Feb 17 10:33:49 2021
9// Last Modified By : Peter A. Buhr
10// Last Modified On : Sun Feb 21 15:52:04 2021
11// Update Count     : 7
12//
13
14#include <exception.hfa>
15
16TRIVIAL_EXCEPTION( E );
17
18void catch( int i ) {}
19void recover( int i ) {}
20void catchResume( int i ) {}
21void fixup( int i ) {}
22void finally( int i ) {}
23
24int main(int argc, char const *argv[]) {
25        int catch, recover, catchResume, fixup, finally;
26        try {
27                catch = 3;
28                catch( catch );
29                recover = 3;
30                recover( recover );
31                catchResume = 3;
32                catchResume( catchResume );
33                fixup = 3;
34                fixup( fixup );
35                finally = 3;
36                finally( finally );
37                throw (E){};
38                report (E){};
39                throwResume (E){};
40        } catch ( E * ) {
41        } recover ( E * ) {                                                                     // same as catch
42        } catchResume ( E * ) {
43        } fixup ( E * ) {                                                                       // same as catchResume
44        } finally {
45        }
46
47        if ( 3 )
48                try {
49                } fixup ( E * ) {
50                } finally {
51                }
52        else catch = 3;
53
54        #pragma message( "Compiled" )                                           // force non-empty .expect file
55}
Note: See TracBrowser for help on using the repository browser.