opt_dj.c revision 1.4
1/* $NetBSD: opt_dj.c,v 1.4 2021/11/20 11:13:18 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-equals-prev-output -ndj 32 33 34#indent input 35void example(void) { 36 int decl; 37 code(); 38} 39#indent end 40 41#indent run -dj 42void 43example(void) 44{ 45int decl; 46 code(); 47} 48#indent end 49 50#indent run -ndj 51void 52example(void) 53{ 54 int decl; 55 code(); 56} 57#indent end 58