diff options
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20050603-1.c | 23 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20050603-2.c | 20 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/20050603-3.c | 15 |
4 files changed, 64 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index aba8829..e2c887a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2005-06-04 Dale Johannesen <dalej@apple.com> + + * gcc.c-torture/execute/20050603-1.c: New. + * gcc.c-torture/execute/20050603-2.c: New. + * gcc.dg/20050603-3.c: New. + 2005-06-04 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/19195 diff --git a/gcc/testsuite/gcc.c-torture/execute/20050603-1.c b/gcc/testsuite/gcc.c-torture/execute/20050603-1.c new file mode 100644 index 0000000..2da1b10 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20050603-1.c @@ -0,0 +1,23 @@ +/* { dg-do run { target powerpc*-*-* } } */ +#include <locale.h> +#include <stdlib.h> +register int *testreg asm ("r29"); + +int x; +int y; +int *ext_func (int *p) { return p; } + +void test_reg_save_restore (int*) __attribute__((noinline)); +void +test_reg_save_restore (int *p) +{ + setlocale (LC_ALL, "C"); + testreg = ext_func(p); +} +main() { + testreg = &x; + test_reg_save_restore (&y); + if (testreg != &y) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/execute/20050603-2.c b/gcc/testsuite/gcc.c-torture/execute/20050603-2.c new file mode 100644 index 0000000..b923c22 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20050603-2.c @@ -0,0 +1,20 @@ +/* { dg-do run } */ +#include <stdlib.h> +struct s { + unsigned short f: 16; + unsigned short y: 8; + unsigned short g: 2; + unsigned int x; +}; + +void set (struct s*, int) __attribute__((noinline)); +void set (struct s* p, int flags) { + p->g = flags << 1; +} +main() { + struct s foo = {0 , 0, 3, 0}; + set (&foo, -1); + if (foo.g != 2) + abort(); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/20050603-3.c b/gcc/testsuite/gcc.dg/20050603-3.c new file mode 100644 index 0000000..35be660 --- /dev/null +++ b/gcc/testsuite/gcc.dg/20050603-3.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target "powerpc-*-*" } } */ +/* { dg-options "-O2" } */ +struct Q +{ + long x:20; + long y:4; + long z:8; +}b; +/* This should generate a single rl[w]imi. */ +void rotins (unsigned int x) +{ + b.y = (x<<12) | (x>>20); +} + +/* { dg-final { scan-assembler-not "inm" } } */ |