opt_ip.c revision 1.6
1/* $NetBSD: opt_ip.c,v 1.6 2022/04/22 21:21:20 rillig Exp $ */ 2 3/* 4 * Tests for the options '-ip' and '-nip'. 5 * 6 * The option '-ip' indents parameter declarations from the left margin, for 7 * traditional function definitions. 8 * 9 * The option '-nip' places the parameter declarations in column 1. 10 */ 11 12#indent input 13double 14plus3(a, b, c) 15 double a, b, c; 16{ 17 return a + b + c; 18} 19#indent end 20 21#indent run -ip 22double 23plus3(a, b, c) 24 double a, b, c; 25{ 26 return a + b + c; 27} 28#indent end 29 30#indent run -nip 31double 32plus3(a, b, c) 33double a, b, c; 34{ 35 return a + b + c; 36} 37#indent end 38 39 40#indent input 41int 42first_parameter_in_same_line(int a, 43int b, 44const char *cp); 45 46int 47parameters_in_separate_lines( 48int a, 49int b, 50const char *cp); 51 52int 53multiple_parameters_per_line( 54int a1, int a2, 55int b1, int b2, 56const char *cp); 57#indent end 58 59#indent run -ip 60int 61first_parameter_in_same_line(int a, 62 int b, 63 const char *cp); 64 65int 66parameters_in_separate_lines( 67 int a, 68 int b, 69 const char *cp); 70 71int 72multiple_parameters_per_line( 73 int a1, int a2, 74 int b1, int b2, 75 const char *cp); 76#indent end 77 78#indent run-equals-prev-output -nip 79