opt_dj.c revision 1.2
1/* $NetBSD: opt_dj.c,v 1.2 2021/10/16 21:32:10 rillig Exp $ */ 2/* $FreeBSD$ */ 3 4/* 5 * Tests for the options '-dj' and '-ndj'. 6 * 7 * The option '-dj' left-justifies declarations. 8 * 9 * The option '-ndj' indents declarations the same as code. 10 */ 11 12/* For top-level declarations, '-dj' and '-ndj' produce the same output. */ 13#indent input 14int i; 15int *ip; 16const char *ccp; 17const void *****vppppp; 18const void ******vpppppp; 19const void ********vpppppppp; 20#indent end 21 22#indent run -dj 23int i; 24int *ip; 25const char *ccp; 26const void *****vppppp; 27const void ******vpppppp; 28const void ********vpppppppp; 29#indent end 30 31#indent run -ndj 32int i; 33int *ip; 34const char *ccp; 35const void *****vppppp; 36const void ******vpppppp; 37const void ********vpppppppp; 38#indent end 39 40#indent input 41void example(void) { 42 int decl; 43 code(); 44} 45#indent end 46 47#indent run -dj 48void 49example(void) 50{ 51int decl; 52 code(); 53} 54#indent end 55 56#indent run -ndj 57void 58example(void) 59{ 60 int decl; 61 code(); 62} 63#indent end 64