From: H.J. Lu Date: Sat, 6 Aug 2011 14:36:52 +0000 (+0000) Subject: Add testcases for PRs 47449/47446. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7ac1b8a01eb777ddc4e7985a7b68523a6fb5d824;p=gcc.git Add testcases for PRs 47449/47446. 2011-08-06 H.J. Lu PR middle-end/47449 * gcc.target/i386/pr47449.c: New. PR target/47446 * gcc.dg/pr47446-1.c: New. * gcc.dg/pr47446-2.c: Likewise. From-SVN: r177512 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 68d470adcbc..ecdd2d2d3f2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2011-08-06 H.J. Lu + + PR middle-end/47449 + * gcc.target/i386/pr47449.c: New. + + PR target/47446 + * gcc.dg/pr47446-1.c: New. + * gcc.dg/pr47446-2.c: Likewise. + 2011-08-06 H.J. Lu PR target/47766 diff --git a/gcc/testsuite/gcc.dg/pr47446-1.c b/gcc/testsuite/gcc.dg/pr47446-1.c new file mode 100644 index 00000000000..38c9594a69a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr47446-1.c @@ -0,0 +1,40 @@ +/* { dg-do assemble } */ +/* { dg-options "-O2" } */ + +extern void abort (void); +enum +{ + __GCONV_OK = 0, + __GCONV_NOCONV, + __GCONV_NODB, + __GCONV_NOMEM, + __GCONV_EMPTY_INPUT, + __GCONV_FULL_OUTPUT, + __GCONV_ILLEGAL_INPUT, + __GCONV_INCOMPLETE_INPUT, + __GCONV_ILLEGAL_DESCRIPTOR, + __GCONV_INTERNAL_ERROR +}; +int +foo (int result) +{ + int irreversible = 0; + switch (result) + { + case __GCONV_ILLEGAL_INPUT: + irreversible = -1L; + break; + case __GCONV_FULL_OUTPUT: + irreversible = -2L; + break; + case __GCONV_INCOMPLETE_INPUT: + irreversible = -3L; + break; + case __GCONV_EMPTY_INPUT: + case __GCONV_OK: + break; + default: + abort (); + } + return irreversible; +} diff --git a/gcc/testsuite/gcc.dg/pr47446-2.c b/gcc/testsuite/gcc.dg/pr47446-2.c new file mode 100644 index 00000000000..5410c7f38dd --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr47446-2.c @@ -0,0 +1,41 @@ +/* { dg-do assemble } */ +/* { dg-require-effective-target fpic } */ +/* { dg-options "-O2 -fpic" } */ + +extern void abort (void); +enum +{ + __GCONV_OK = 0, + __GCONV_NOCONV, + __GCONV_NODB, + __GCONV_NOMEM, + __GCONV_EMPTY_INPUT, + __GCONV_FULL_OUTPUT, + __GCONV_ILLEGAL_INPUT, + __GCONV_INCOMPLETE_INPUT, + __GCONV_ILLEGAL_DESCRIPTOR, + __GCONV_INTERNAL_ERROR +}; +int +foo (int result) +{ + int irreversible = 0; + switch (result) + { + case __GCONV_ILLEGAL_INPUT: + irreversible = -1L; + break; + case __GCONV_FULL_OUTPUT: + irreversible = -2L; + break; + case __GCONV_INCOMPLETE_INPUT: + irreversible = -3L; + break; + case __GCONV_EMPTY_INPUT: + case __GCONV_OK: + break; + default: + abort (); + } + return irreversible; +} diff --git a/gcc/testsuite/gcc.target/i386/pr47449.c b/gcc/testsuite/gcc.target/i386/pr47449.c new file mode 100644 index 00000000000..99ef32f2610 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr47449.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +void bar (void *, void *); +int +foo (void *p1, void *p2) +{ + int ret1, ret2; + __asm ("" : "=D" (ret1), "=S" (ret2)); + bar (p1, p2); + return ret1 + ret2; +}