|
Last change
on this file since a595ab7 was 2853d6f, checked in by Michael Brooks <mlbrooks@…>, 10 months ago |
|
Remove uses of warnings to show test success. Eliminate simple causes of other warnings from affected tests and remove the result from WFLAG_OPT_LAX.
Many affected tests also formerly used -fsyntax-only to avoid errors at later compilation stages, or at runtime. Repair such tests to actually work though runtime, and remove them from SYNTAX_ONLY_CODE.
Group tests listed under WFLAGS_OPT according to why they should receive lax treatment. Add reason WFLGAS_OPT_LAX_EXPECT_WARN and give the original list reason WFLGAS_OPT_LAX_TO_INVESTIGATE.
Tests whose purpose is to show a warning are listed as both SYNTAX_ONLY_CODE (so that the warning is the output) and WFLGAS_OPT_LAX_EXPECT_WARN (to document this fact).
|
-
Property mode
set to
100644
|
|
File size:
1.6 KB
|
| Line | |
|---|
| 1 | //
|
|---|
| 2 | // Cforall Version 1.0.0 Copyright (C) 2016 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 | // switch.cfa --
|
|---|
| 8 | //
|
|---|
| 9 | // Author : Peter A. Buhr
|
|---|
| 10 | // Created On : Tue Jul 12 06:50:22 2016
|
|---|
| 11 | // Last Modified By : Peter A. Buhr
|
|---|
| 12 | // Last Modified On : Sat Jun 5 10:08:20 2021
|
|---|
| 13 | // Update Count : 44
|
|---|
| 14 | //
|
|---|
| 15 |
|
|---|
| 16 | int f( int i ) { return i; }
|
|---|
| 17 |
|
|---|
| 18 | int main( void ) {
|
|---|
| 19 | int i = 0;
|
|---|
| 20 | switch ( i ) case 3 : i = 1;
|
|---|
| 21 | switch ( i ) default : f( 3 );
|
|---|
| 22 |
|
|---|
| 23 | switch ( 3 )
|
|---|
| 24 | default:
|
|---|
| 25 | case 2:
|
|---|
| 26 | case 3:
|
|---|
| 27 | f( 3 );
|
|---|
| 28 |
|
|---|
| 29 | switch ( i ) {}
|
|---|
| 30 | switch ( i ) {
|
|---|
| 31 | case 3:
|
|---|
| 32 | f( 3 );
|
|---|
| 33 | } // switch
|
|---|
| 34 |
|
|---|
| 35 | switch ( 3 ) {
|
|---|
| 36 | int j;
|
|---|
| 37 | case 3:
|
|---|
| 38 | break;
|
|---|
| 39 | case 4:
|
|---|
| 40 | j = 0;
|
|---|
| 41 | }
|
|---|
| 42 |
|
|---|
| 43 | switch ( i ) {
|
|---|
| 44 | case 1, 2, 3:
|
|---|
| 45 | switch ( i ) {
|
|---|
| 46 | case 2, 3, 4:
|
|---|
| 47 | 7;
|
|---|
| 48 | }
|
|---|
| 49 | }
|
|---|
| 50 |
|
|---|
| 51 | switch ( i ) {
|
|---|
| 52 | int j = 0;
|
|---|
| 53 | int k = 0;
|
|---|
| 54 | struct S { int i; };
|
|---|
| 55 | S s;
|
|---|
| 56 | case 8~10:
|
|---|
| 57 | default:
|
|---|
| 58 | i = 3;
|
|---|
| 59 | case 19:
|
|---|
| 60 | case 'A' ... 'Z':
|
|---|
| 61 | case 1 ... 6:
|
|---|
| 62 | case 20, 30:
|
|---|
| 63 | j = 3;
|
|---|
| 64 | f( 3 );
|
|---|
| 65 | break;
|
|---|
| 66 | } // switch
|
|---|
| 67 |
|
|---|
| 68 | choose ( i ) case 3 : f( 3 );
|
|---|
| 69 | choose ( i ) default : i = 1;
|
|---|
| 70 |
|
|---|
| 71 | choose ( 3 )
|
|---|
| 72 | case 2:
|
|---|
| 73 | default:
|
|---|
| 74 | case 3:
|
|---|
| 75 | f( 3 );
|
|---|
| 76 |
|
|---|
| 77 | choose ( i ) {}
|
|---|
| 78 | choose ( i ) {
|
|---|
| 79 | case 3:
|
|---|
| 80 | f( 3 );
|
|---|
| 81 | } // choose
|
|---|
| 82 |
|
|---|
| 83 | choose ( i ) {
|
|---|
| 84 | int j = 0;
|
|---|
| 85 | int k = 0;
|
|---|
| 86 | struct S { int i; };
|
|---|
| 87 | S s;
|
|---|
| 88 | case 19:
|
|---|
| 89 | case 'A'...'Z':
|
|---|
| 90 | case 0 ...6: // space required, or lexed as decimal point
|
|---|
| 91 | case 20, 30, 40:
|
|---|
| 92 | i = 3;
|
|---|
| 93 | f( 3 );
|
|---|
| 94 | default:
|
|---|
| 95 | j = 3;
|
|---|
| 96 | case 8~10:
|
|---|
| 97 | f( 3 );
|
|---|
| 98 | fallthru;
|
|---|
| 99 | case 'd':
|
|---|
| 100 | j = 5;
|
|---|
| 101 | } // choose
|
|---|
| 102 |
|
|---|
| 103 | printf("done\n");
|
|---|
| 104 | } // main
|
|---|
| 105 |
|
|---|
| 106 | // Local Variables: //
|
|---|
| 107 | // tab-width: 4 //
|
|---|
| 108 | // compile-command: "cfa switch.cfa" //
|
|---|
| 109 | // End: //
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.