drmortalwombat / oscar64

Optimizing Small memory C Compiler Assembler and Runtime for C64
GNU General Public License v3.0
261 stars 23 forks source link

Compiler hangs #100

Closed AGPX closed 2 days ago

AGPX commented 2 days ago

The following simple code hangs the compiler (with -e):

#include "common.h"
int k = 0;

int main()
{
    int i;
    int j;

    for (i = 0; i < 2; i++)
    {
        if (k)
        {
            if (j != 2)
                abort ();
        }
        else
        {
            j = 2;
            k++;
        }
    }
    exit (0);
}

with common.h:

#include <stdio.h>
#include <string.h>

#define register

#define double float

#define exit return

#define __attribute__(x)

#define __complex__

static void abort()
{
    printf("** TEST FAILED **!\n");
}

static void abort2(const char *msg)
{
    printf("%s\n", msg);
    printf("** TEST FAILED **!\n");
}
AGPX commented 2 days ago

Sorry, was a problem of the test suite, not the compiler. Closed as not applies.