1 /* $NetBSD: opt_cli.c,v 1.6 2023/06/06 04:37:27 rillig Exp $ */ 2 3 /* 4 * Tests for the option '-cli' ("case label indentation"), which sets the 5 * amount of indentation of a 'case' relative to the surrounding 'switch', 6 * measured in indentation levels. 7 * 8 * See also: 9 * lsym_case_label.c 10 */ 11 12 //indent input 13 void 14 classify(int n) 15 { 16 switch (n) { 17 case 0: print("zero"); break; 18 case 1: print("one"); break; 19 case 2: case 3: print("prime"); break; 20 case 4: print("square"); break; 21 default: print("large"); break; 22 } 23 } 24 //indent end 25 26 //indent run -cli0.5 27 void 28 classify(int n) 29 { 30 switch (n) { 31 case 0: 32 print("zero"); 33 break; 34 case 1: 35 print("one"); 36 break; 37 case 2: 38 case 3: 39 print("prime"); 40 break; 41 case 4: 42 print("square"); 43 break; 44 default: 45 print("large"); 46 break; 47 } 48 } 49 //indent end 50 51 //indent run -cli1.5 52 void 53 classify(int n) 54 { 55 switch (n) { 56 case 0: 57 print("zero"); 58 break; 59 case 1: 60 print("one"); 61 break; 62 case 2: 63 case 3: 64 print("prime"); 65 break; 66 case 4: 67 print("square"); 68 break; 69 default: 70 print("large"); 71 break; 72 } 73 } 74 //indent end 75 76 //indent run -cli3.25 77 void 78 classify(int n) 79 { 80 switch (n) { 81 case 0: 82 print("zero"); 83 break; 84 case 1: 85 print("one"); 86 break; 87 case 2: 88 case 3: 89 print("prime"); 90 break; 91 case 4: 92 print("square"); 93 break; 94 default: 95 print("large"); 96 break; 97 } 98 } 99 //indent end 100