From: Michael Beck Date: Thu, 13 Mar 2008 16:00:36 +0000 (+0000) Subject: some fixes X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=453b5d00daa1bbd0f94c45f8dca716fce4cc869f;p=cparser some fixes [r18931] --- diff --git a/parsetest/cp_error019.c b/parsetest/cp_error019.c index 4709052..69fde3a 100644 --- a/parsetest/cp_error019.c +++ b/parsetest/cp_error019.c @@ -1,6 +1,6 @@ int main(void) { - enum { FALSE, TRUE } MYBOOL; + enum MYBOOL { FALSE, TRUE }; enum MYBOOL k = FALSE; diff --git a/parsetest/do_tests.sh b/parsetest/do_tests.sh index aac103a..506392e 100755 --- a/parsetest/do_tests.sh +++ b/parsetest/do_tests.sh @@ -3,8 +3,8 @@ rm -f messages.cparser messages.gcc for i in *.c; do echo -n "Compile $i..." - ../cparser $i -O3 -o prog.cparser >> messages.cparser 2>&1 - gcc -std=gnu99 $i -O3 -o prog.gcc >> messages.gcc 2>&1 + cparser $i -O3 -o prog.cparser >> messages.cparser 2>&1 || echo -n " CPARSER COMPILE FAILED" + gcc -m32 -std=gnu99 $i -O3 -o prog.gcc >> messages.gcc 2>&1 || echo -n " GCC COMPILE FAILED" ./prog.cparser > out.cparser || echo -n " FAILED CPARSER RUN" ./prog.gcc > out.gcc || echo -n " FAILED GCC RUN" diff -u out.cparser out.gcc > /dev/null || echo -n " RESULTS MISCOMPARE" @@ -14,6 +14,6 @@ done for i in shouldfail/*.c; do echo -n "Compile $i..." ../cparser $i -O3 -o prog.cparser >> messages.cparser 2>&1 && echo -n " CPARSER COMPILED" - gcc -std=gnu99 $i -O3 -o prog.gcc >> messages.gcc 2>&1 && echo -n " GCC COMPILED" + gcc -m32 -std=gnu99 $i -O3 -o prog.gcc >> messages.gcc 2>&1 && echo -n " GCC COMPILED" echo "" done diff --git a/parsetest/init3.c b/parsetest/init3.c deleted file mode 100644 index 3cfe6ea..0000000 --- a/parsetest/init3.c +++ /dev/null @@ -1,12 +0,0 @@ -typedef struct { - int a, b; -} Stru1; - -typedef struct { - double d; - Stru1 stru; - float c; -} Stru2; - -static const Stru1 k = { 4, 2 }; -static const Stru2 a = { 2.4, k, 0.4f }; diff --git a/parsetest/shouldfail/init1.c b/parsetest/shouldfail/init1.c new file mode 100644 index 0000000..3cfe6ea --- /dev/null +++ b/parsetest/shouldfail/init1.c @@ -0,0 +1,12 @@ +typedef struct { + int a, b; +} Stru1; + +typedef struct { + double d; + Stru1 stru; + float c; +} Stru2; + +static const Stru1 k = { 4, 2 }; +static const Stru2 a = { 2.4, k, 0.4f };