Changeset bbbff10
- Timestamp:
- Feb 1, 2025, 8:49:35 AM (5 weeks ago)
- Branches:
- master
- Children:
- 7846f91, 90e683b
- Parents:
- 641707d
- Location:
- tests
- Files:
-
- 1 added
- 2 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified tests/Makefile.am ¶
r641707d rbbbff10 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Thu Dec 19 22:11:14 202414 ## Update Count : 20 013 ## Last Modified On : Sat Feb 1 08:20:27 2025 14 ## Update Count : 201 15 15 ############################################################################### 16 16 … … 57 57 WFLGAS_OPT_LAX_EXPECT_WARN = \ 58 58 attr-priority \ 59 ctrl-flow/loop_else-WRN1 \ 59 60 warnings/self-assignment 60 61 … … 353 354 -cp ${test} ${abspath ${@}} 354 355 356 ctrl-flow/loop_else : ctrl-flow/loop_else.cfa ${CFACCBIN} 357 ${CC} ${AM_CFLAGS} -Wno-superfluous-else $< -o $@ 358 359 ctrl-flow/loop_else-WRN1 : ctrl-flow/loop_else.cfa ${CFACCBIN} 360 ${CFACOMPILE_SYNTAX} -DERR1 361 -cp ${test} ${abspath ${@}} 362 355 363 # Exception Tests 356 364 # Test with libcfathread; it changes how storage works. -
TabularUnified tests/ctrl-flow/.expect/loop_else.txt ¶
r641707d rbbbff10 1 empty 2 empty 3 empty 4 empty 1 5 empty 2 6 empty 3 7 empty 4 8 9 else 10 else 5 11 false else 6 12 -
TabularUnified tests/ctrl-flow/loop_else.cfa ¶
r641707d rbbbff10 20 20 21 21 int main() { 22 sout | nlOff; // turn off auto newline 23 24 // Special cases print warning: else clause never executed for empty loop conditional. 25 26 while () { sout | "empty"; break; } else { sout | "else"; } sout | nl; 27 do { sout | "empty"; break; } while () else { sout | "else"; } sout | nl; 28 for () { sout | "empty"; break; } else { sout | "else"; } sout | nl; 29 22 30 // Test some loop options. 23 31 24 sout | nlOff; // turn off auto newline25 32 while ( true ) { sout | "empty"; break; } else { sout | "else"; } sout | nl; 26 33 do { sout | "empty"; break; } while ( true ) else { sout | "else"; } sout | nl; 34 for ( ;; ) { sout | "empty"; break; } else { sout | "else"; } sout | nl; 27 35 for ( ; true ; ) { sout | "empty"; break; } else { sout | "else"; } sout | nl | nl; 28 36 37 while ( false ) { sout | "false"; break; } else { sout | "else"; } sout | nl; 38 for ( ; false; ) { sout | "false"; break; } else { sout | "else"; } sout | nl; 29 39 do { sout | "false"; } while (false) else { sout | "else"; } sout | nl | nl; 30 40 … … 48 58 49 59 // @ means do nothing 60 50 61 for ( i; 1 ~ @ ) { 51 62 if ( i > 10 ) break; … … 113 124 114 125 // A break (or a continue) in an else clause should target an outer loop. 126 115 127 sout | "before"; 116 128 while ( true ) {
Note: See TracChangeset
for help on using the changeset viewer.