lsym_do.c revision 1.5
1/* $NetBSD: lsym_do.c,v 1.5 2023/05/11 10:39:26 rillig Exp $ */ 2 3/* 4 * Tests for the token lsym_do, which represents the keyword 'do' that starts 5 * a 'do-while' loop. 6 * 7 * See also: 8 * psym_do.c 9 * psym_do_stmt.c 10 * C11 6.8.5 "Iteration statements" 11 * C11 6.8.5.2 "The 'do' statement" 12 */ 13 14//indent input 15void 16function(void) 17{ 18 do stmt();while(cond); 19} 20//indent end 21 22//indent run 23void 24function(void) 25{ 26 do 27 stmt(); 28 while (cond); 29} 30//indent end 31 32 33//indent input 34void 35else_do(int i) 36{ 37 if (i > 0) return; else do {} while (0); 38} 39//indent end 40 41//indent run 42void 43else_do(int i) 44{ 45 if (i > 0) 46 return; 47 else 48 do { 49 } while (0); 50} 51//indent end 52