From 8f2b8cdefe723ec391bdcd8ce4e1931bd71418b6 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sat, 6 Aug 2011 14:50:05 +0000 Subject: [PATCH] Add testcases for PRs 47727/47372/47715. 2011-08-06 H.J. Lu PR middle-end/47727 * gcc.dg/pr47727.c: New. PR target/47372 * gcc.dg/pr47372-1.c: New. * gcc.dg/pr47372-2.c: Likewise. PR target/47715 * gcc.dg/tls/pr47715-5.c: New. From-SVN: r177513 --- gcc/testsuite/ChangeLog | 10 ++++++++++ gcc/testsuite/gcc.dg/pr47372-1.c | 12 ++++++++++++ gcc/testsuite/gcc.dg/pr47372-2.c | 17 +++++++++++++++++ gcc/testsuite/gcc.dg/pr47727.c | 12 ++++++++++++ gcc/testsuite/gcc.dg/tls/pr47715-5.c | 11 +++++++++++ 5 files changed, 62 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr47372-1.c create mode 100644 gcc/testsuite/gcc.dg/pr47372-2.c create mode 100644 gcc/testsuite/gcc.dg/pr47727.c create mode 100644 gcc/testsuite/gcc.dg/tls/pr47715-5.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ecdd2d2d3f2..94f6f081b0c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2011-08-06 H.J. Lu + + PR middle-end/47727 + * gcc.dg/pr47727.c: New. + + PR target/47372 + * gcc.dg/pr47372-1.c: New. + * gcc.dg/pr47372-2.c: Likewise. + 2011-08-06 H.J. Lu PR middle-end/47449 @@ -17,6 +26,7 @@ * gcc.dg/tls/pr47715-2.c: Likewise. * gcc.dg/tls/pr47715-3.c: Likewise. * gcc.dg/tls/pr47715-4.c: Likewise. + * gcc.dg/tls/pr47715-5.c: Likewise. 2011-08-06 Nicola Pero diff --git a/gcc/testsuite/gcc.dg/pr47372-1.c b/gcc/testsuite/gcc.dg/pr47372-1.c new file mode 100644 index 00000000000..a2e5c5b4141 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr47372-1.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target fpic } */ +/* { dg-options "-O2 -fPIC -g" } */ + +typedef struct FILE FILE; +int _fwalk(int (*)(FILE *)); +int __sflush(FILE *); +int +fflush(FILE *fp) +{ + return (_fwalk(__sflush)); +} diff --git a/gcc/testsuite/gcc.dg/pr47372-2.c b/gcc/testsuite/gcc.dg/pr47372-2.c new file mode 100644 index 00000000000..8addcdc5ee3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr47372-2.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target fpic } */ +/* { dg-options "-O2 -fPIC -g" } */ + +typedef unsigned short ush; +typedef ush Pos; +extern ush prev[]; +void fill_window( unsigned more, unsigned m) +{ + unsigned n; + for (n = 0; n < (unsigned)(1<<15); n++) { + (prev+0x8000)[n] = (Pos)(m >= 0x8000 ? m-0x8000 : 0); + } + for (n = 0; n < 0x8000; n++) { + prev[n] = (Pos)(m >= 0x8000 ? m-0x8000 : 0); + } +} diff --git a/gcc/testsuite/gcc.dg/pr47727.c b/gcc/testsuite/gcc.dg/pr47727.c new file mode 100644 index 00000000000..1ce7c360117 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr47727.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +typedef void (*func_ptr) (void); +static func_ptr __CTOR_END__[1] = { (func_ptr) 0 }; +static void __attribute__((used)) +__do_global_ctors_aux (void) +{ + func_ptr *p; + for (p = __CTOR_END__ - 1; *p != (func_ptr) -1; p--) + (*p) (); +} diff --git a/gcc/testsuite/gcc.dg/tls/pr47715-5.c b/gcc/testsuite/gcc.dg/tls/pr47715-5.c new file mode 100644 index 00000000000..ca3410df739 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tls/pr47715-5.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-require-effective-target tls } */ + +extern __thread int __libc_errno __attribute__ ((tls_model ("initial-exec"))); +; +int * +__errno_location (void) +{ + return &__libc_errno; +} -- 2.30.2