diff options
Diffstat (limited to 'src/tools/pg_bsd_indent/tests/elsecomment.0')
-rw-r--r-- | src/tools/pg_bsd_indent/tests/elsecomment.0 | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/tools/pg_bsd_indent/tests/elsecomment.0 b/src/tools/pg_bsd_indent/tests/elsecomment.0 new file mode 100644 index 0000000000..61066c22b5 --- /dev/null +++ b/src/tools/pg_bsd_indent/tests/elsecomment.0 @@ -0,0 +1,42 @@ +/* $FreeBSD$ */ +/* See r303484 and r309342 */ +void t(void) { + /* The two if statements below excercise two different code paths. */ + + if (1) /* a */ int a; else /* b */ int b; + + if (1) /* a */ + int a; + else /* b */ + int b; + + if (1) { + + } + + + + /* Old indent would remove the 3 blank lines above, awaiting "else". */ + + if (1) { + int a; + } + + + else if (0) { + int b; + } + /* test */ + else + ; + + if (1) + ; + else /* Old indent would get very confused here */ + /* We also mustn't assume that there's only one comment */ + /* before the left brace. */ + { + + + } +} |