summaryrefslogtreecommitdiffstats
path: root/src/tools/pg_bsd_indent/tests/elsecomment.0
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:44:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:44:03 +0000
commit293913568e6a7a86fd1479e1cff8e2ecb58d6568 (patch)
treefc3b469a3ec5ab71b36ea97cc7aaddb838423a0c /src/tools/pg_bsd_indent/tests/elsecomment.0
parentInitial commit. (diff)
downloadpostgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.tar.xz
postgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.zip
Adding upstream version 16.2.upstream/16.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/pg_bsd_indent/tests/elsecomment.0')
-rw-r--r--src/tools/pg_bsd_indent/tests/elsecomment.042
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 0000000..c701f1b
--- /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 exercise 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. */
+ {
+
+
+ }
+}