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