]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
test_cplusplusext: Add C++ pg_fallthrough test case
authorPeter Eisentraut <peter@eisentraut.org>
Mon, 23 Feb 2026 06:37:50 +0000 (07:37 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Mon, 23 Feb 2026 06:40:19 +0000 (07:40 +0100)
Discussion: https://www.postgresql.org/message-id/flat/76a8efcd-925a-4eaf-bdd1-d972cd1a32ff%40eisentraut.org

src/test/modules/test_cplusplusext/test_cplusplusext.cpp

index 8c2eabcca4353b7e452aeac351f975a67c8067c3..eb129dd15d46794de63fb6c460b423291b6f7ccf 100644 (file)
@@ -55,5 +55,15 @@ test_cplusplus_add(PG_FUNCTION_ARGS)
        list_free(list);
        pfree(node);
 
+       switch (a)
+       {
+               case 1:
+                       elog(DEBUG1, "1");
+                       pg_fallthrough;
+               case 2:
+                       elog(DEBUG1, "2");
+                       break;
+       }
+
        PG_RETURN_INT32(a + b);
 }