Changeset 091ccdb for tests/loopctrl.cfa
- Timestamp:
- Aug 8, 2022, 5:38:22 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- 52be5948
- Parents:
- 5c98a25
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/loopctrl.cfa
r5c98a25 r091ccdb 10 10 // Created On : Wed Aug 8 18:32:59 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Aug 8 1 6:00:39202213 // Update Count : 11 312 // Last Modified On : Mon Aug 8 17:36:57 2022 13 // Update Count : 116 14 14 // 15 15 16 16 #include <fstream.hfa> 17 18 void fred() { 19 // Test all possible loop syntax. 20 21 int s, c, i; 22 23 for ( c ) {} // start 0 24 for ( ~= c ) {} // start 0 25 for ( -~ c ) {} // start c 26 for ( -~= c ) {} // start c 27 28 for ( @ ~ c ) {} // start 0 29 for ( @ ~= c ) {} // start 0 30 for ( @ -~ c ) {} // start c 31 for ( @ -~= c ) {} // start c 32 33 for ( @ ~ c ~ i ) {} // start 0 34 for ( @ ~= c ~ i ) {} // start 0 35 for ( @ -~ c ~ i ) {} // start c 36 for ( @ -~= c ~ i ) {} // start c 37 38 for ( s ~ c ) {} // start s 39 for ( s ~= c ) {} // start s 40 for ( s -~ c ) {} // start c 41 for ( s -~= c ) {} // start c 42 43 for ( s ~ c ~ i ) {} // start s 44 for ( s ~= c ~ i ) {} // start s 45 for ( s -~ c ~ i ) {} // start c 46 for ( s -~= c ~ i ) {} // start c 47 48 for ( j; c ) {} // start 0 49 for ( j; ~= c ) {} // start 0 50 for ( j; -~ c ) {} // start c 51 for ( j; -~= c ) {} // start c 52 53 for ( j; @ ~ c ) {} // start 0 54 for ( j; @ ~= c ) {} // start 0 55 for ( j; @ -~ c ) {} // start c 56 for ( j; @ -~= c ) {} // start c 57 58 for ( j; @ ~ c ~ i ) {} // start 0 59 for ( j; @ ~= c ~ i ) {} // start 0 60 for ( j; @ -~ c ~ i ) {} // start c 61 for ( j; @ -~= c ~ i ) {} // start c 62 63 for ( j; s ~ c ) {} // start s 64 for ( j; s ~= c ) {} // start s 65 for ( j; s -~ c ) {} // start c 66 for ( j; s -~= c ) {} // start c 67 68 for ( j; s ~ c ~ i ) {} // start s 69 for ( j; s ~= c ~ i ) {} // start s 70 for ( j; s -~ c ~ i ) {} // start c 71 for ( j; s -~= c ~ i ) {} // start c 72 73 // CANNOT DIRECTLY INITIALIZE INDEX VARIABLE, ONLY SINGLE LOOP INDEX VARIABLE IN DECLARATION 74 75 for ( j; c ) {} // start 0 76 for ( int j; c ) {} // start 0 77 for ( int j; ~= c ) {} // start 0 78 for ( int j; -~ c ) {} // start c 79 for ( int j; -~= c ) {} // start c 80 81 for ( int j; @ ~ c ) {} // start 0 82 for ( int j; @ ~= c ) {} // start 0 83 for ( int j; @ -~ c ) {} // start c 84 for ( int j; @ -~= c ) {} // start c 85 86 for ( int j; @ ~ c ~ i ) {} // start 0 87 for ( int j; @ ~= c ~ i ) {} // start 0 88 for ( int j; @ -~ c ~ i ) {} // start c 89 for ( int j; @ -~= c ~ i ) {} // start c 90 91 for ( int j; s ~ c ) {} // start s 92 for ( int j; s ~= c ) {} // start s 93 for ( int j; s -~ c ) {} // start c 94 for ( int j; s -~= c ) {} // start c 95 96 for ( int j; s ~ c ~ i ) {} // start s 97 for ( int j; s ~= c ~ i ) {} // start s 98 for ( int j; s -~ c ~ i ) {} // start c 99 for ( int j; s -~= c ~ i ) {} // start c 100 101 for ( s ~ @ ) {} // start s 102 for ( s -~ @ ) {} // start s 103 for ( s ~ @ ~ i ) {} // start s 104 for ( s -~ @ ~ i ) {} // start s 105 for ( s ~ @ ~ @ ) {} // start s 106 107 for ( j; s ~ @ ) {} // start s 108 for ( j; s -~ @ ) {} // start s 109 for ( j; s ~ @ ~ i ) {} // start s 110 for ( j; s -~ @ ~ i ) {} // start s 111 for ( j; s ~ @ ~ @ ) {} // start s 112 113 for ( int j; s ~ @ ) {} // start s 114 for ( int j; s -~ @ ) {} // start s 115 for ( int j; s ~ @ ~ i ) {} // start s 116 for ( int j; s -~ @ ~ i ) {} // start s 117 for ( int j; s ~ @ ~ @ ) {} // start s 118 119 // enum E { A, B, C, D }; 120 // for ( e; A ~= C ) {} 121 // for ( e; A ~= D ) {} 122 // for ( e; A -~= D ~ 2 ) {} 123 // for ( e; E ) {} 124 // for ( e; -~ E ) {} 125 } 17 126 18 127 struct S { int i, j; }; … … 35 144 36 145 int main() { 146 // Test some loop options. 147 37 148 sout | nlOff; // turn off auto newline 38 149 while () { sout | "empty"; break; } sout | nl;
Note: See TracChangeset
for help on using the changeset viewer.