URI: 
       cc2/qbe: Emit an initial body label - scc - simple c99 compiler
  HTML git clone git://git.simple-cc.org/scc
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 74119bd8d7b2d8a91b2b2e5bd7984ce5377402ab
   DIR parent 47b81d4c6f906155f23054757a85c829aff80c40
  HTML Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
       Date:   Fri, 29 May 2026 13:16:32 +0200
       
       cc2/qbe: Emit an initial body label
       
       This label is needed because otherwise branching to the label at
       the beginning og the function generates an error in qbe:
       
               invalid jump to the start block
       
       Diffstat:
         M src/cmd/scc-cc/cc2/qbe/code.c       |       4 +++-
         A tests/cc/execute/0274-loop.c        |       8 ++++++++
         M tests/cc/execute/scc-tests.lst      |       1 +
       
       3 files changed, 12 insertions(+), 1 deletion(-)
       ---
   DIR diff --git a/src/cmd/scc-cc/cc2/qbe/code.c b/src/cmd/scc-cc/cc2/qbe/code.c
       @@ -424,7 +424,9 @@ writeout(void)
                               (p->type.flags & AGGRF) ? "" : ".val");
                        sep = ",";
                }
       -        printf("%s)\n{\n", (curfun->type.flags&ELLIPS) ? ", ..." : "");
       +        printf("%s)\n{\n@%s.body\n",
       +               (curfun->type.flags&ELLIPS) ? ", ..." : "",
       +               curfun->name);
        
                /* emit assembler instructions */
                for (pc = prog; pc; pc = pc->next) {
   DIR diff --git a/tests/cc/execute/0274-loop.c b/tests/cc/execute/0274-loop.c
       @@ -0,0 +1,8 @@
       +int
       +main()
       +{
       +        do {
       +        } while (0);
       +
       +        return 0;
       +}
   DIR diff --git a/tests/cc/execute/scc-tests.lst b/tests/cc/execute/scc-tests.lst
       @@ -264,3 +264,4 @@
        0271-struct.c
        0272-div.c
        0273-cpp.c
       +0274-loop.c