Last change
on this file since fa5e1aa5 was
c715e5f,
checked in by Andrew Beach <ajbeach@…>, 2 years ago
|
Removed most of the exception macros (EHM_ group). Made changes to the exception declaration pass to do so.
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[07c77ce] | 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. |
---|
[c715e5f] | 6 | // |
---|
[07c77ce] | 7 | // Author : Peter A. Buhr |
---|
| 8 | // Created On : Wed Feb 17 10:33:49 2021 |
---|
| 9 | // Last Modified By : Peter A. Buhr |
---|
[53692b3] | 10 | // Last Modified On : Sat Jun 5 10:07:59 2021 |
---|
| 11 | // Update Count : 8 |
---|
[c715e5f] | 12 | // |
---|
[07c77ce] | 13 | |
---|
[c715e5f] | 14 | exception E {}; |
---|
[07c77ce] | 15 | |
---|
| 16 | void catch( int i ) {} |
---|
| 17 | void recover( int i ) {} |
---|
| 18 | void catchResume( int i ) {} |
---|
| 19 | void fixup( int i ) {} |
---|
| 20 | void finally( int i ) {} |
---|
| 21 | |
---|
| 22 | int main(int argc, char const *argv[]) { |
---|
| 23 | int catch, recover, catchResume, fixup, finally; |
---|
| 24 | try { |
---|
| 25 | catch = 3; |
---|
| 26 | catch( catch ); |
---|
| 27 | recover = 3; |
---|
| 28 | recover( recover ); |
---|
| 29 | catchResume = 3; |
---|
| 30 | catchResume( catchResume ); |
---|
| 31 | fixup = 3; |
---|
| 32 | fixup( fixup ); |
---|
| 33 | finally = 3; |
---|
| 34 | finally( finally ); |
---|
| 35 | throw (E){}; |
---|
| 36 | report (E){}; |
---|
| 37 | throwResume (E){}; |
---|
| 38 | } catch ( E * ) { |
---|
| 39 | } recover ( E * ) { // same as catch |
---|
| 40 | } catchResume ( E * ) { |
---|
| 41 | } fixup ( E * ) { // same as catchResume |
---|
| 42 | } finally { |
---|
| 43 | } |
---|
| 44 | |
---|
| 45 | if ( 3 ) |
---|
| 46 | try { |
---|
| 47 | } fixup ( E * ) { |
---|
| 48 | } finally { |
---|
[c715e5f] | 49 | } |
---|
[07c77ce] | 50 | else catch = 3; |
---|
| 51 | |
---|
[53692b3] | 52 | #pragma GCC warning "Compiled" // force non-empty .expect file, NO TABS!!! |
---|
[07c77ce] | 53 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.