From: Uros Bizjak Date: Wed, 22 Aug 2007 12:12:10 +0000 (+0200) Subject: 20000724-1.c, [...]: Move to gcc.target/i386 directory. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bda0d962bea41b40c9c59a8c95f2712157a04540;p=gcc.git 20000724-1.c, [...]: Move to gcc.target/i386 directory. * gcc.dg/20000724-1.c, gcc.dg/980312-1.c, gcc.dg/980313-1.c, gcc.dg/attr-returns_twice-1.c, gcc.dg/inline-mcpy.c, gcc.dg/pr25196.c, gcc.dg/pr25993.c, gcc.dg/pr26449.c, gcc.dg/pr28839.c, gcc.dg/pr32191.c: Move to gcc.target/i386 directory. * gcc.target/i386/pr31854.c, gcc.target/i386/pr32065-1.c, gcc.target/i386/pr32065-2.c: Use dg-require-effective-target dfp. From-SVN: r127702 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 189097d0a58..02cc97c3e15 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2007-08-22 Uros Bizjak + + * gcc.dg/20000724-1.c, gcc.dg/980312-1.c, gcc.dg/980313-1.c, + gcc.dg/attr-returns_twice-1.c, gcc.dg/inline-mcpy.c, gcc.dg/pr25196.c, + gcc.dg/pr25993.c, gcc.dg/pr26449.c, gcc.dg/pr28839.c, + gcc.dg/pr32191.c: Move to gcc.target/i386 directory. + * gcc.target/i386/pr31854.c, gcc.target/i386/pr32065-1.c, + gcc.target/i386/pr32065-2.c: Use dg-require-effective-target dfp. + 2007-08-22 Richard Guenther PR middle-end/33007 diff --git a/gcc/testsuite/gcc.dg/20000724-1.c b/gcc/testsuite/gcc.dg/20000724-1.c deleted file mode 100644 index 0516ae46116..00000000000 --- a/gcc/testsuite/gcc.dg/20000724-1.c +++ /dev/null @@ -1,72 +0,0 @@ -/* { dg-do run { target i?86-*-linux* x86_64-*-linux* } } */ -/* { dg-options "-O2 -fomit-frame-pointer" } */ -/* { dg-require-effective-target ilp32 } */ - -extern void abort (void); -extern void exit (int); - -struct s { - struct { int a; } a; - int b; - struct { struct { int a; } a; struct t { struct t *a, *b; } b; } c; -}; - -int bar(int (*fn)(void *), void *arg, unsigned long flags) -{ - return 0; -} - -int baz(void *x) -{ - return 0; -} - -void do_check (struct s *) asm ("do_check") __attribute__((regparm(1))); - -void __attribute__((regparm(1))) do_check(struct s *x) -{ - if (x->a.a || x->b || x->c.a.a) - abort(); - if (x->c.b.a != &x->c.b || x->c.b.b != &x->c.b) - abort(); -} - -#define NT "\n\t" - -asm ("\n" -"___checkme:" -NT "pushl %eax; pushl %ebx; pushl %ecx; pushl %edx; pushl %esi; pushl %edi" - -NT "pushl $0; pushl $0; pushl $0; pushl $0; pushl $0" -NT "pushl $0; pushl $0; pushl $0; pushl $0; pushl $0" - -NT "movl %ecx, %eax" -NT "call do_check" - -NT "popl %eax; popl %eax; popl %eax; popl %eax; popl %eax" -NT "popl %eax; popl %eax; popl %eax; popl %eax; popl %eax" - -NT "popl %edi; popl %esi; popl %edx; popl %ecx; popl %ebx; popl %eax" -NT "ret" -); - -extern inline void do_asm(struct s * x) -{ - asm volatile("call ___checkme" : : "c" (x) : "memory"); -} - -int foo(void) -{ - struct s x = { { 0 }, 0, { { 0 }, { &x.c.b, &x.c.b } } }; - bar(baz, &x, 1); - do_asm(&x); - bar(baz, &x, 1); - do_asm(&x); - return 0; -} - -int main() -{ - foo(); - exit(0); -} diff --git a/gcc/testsuite/gcc.dg/980312-1.c b/gcc/testsuite/gcc.dg/980312-1.c deleted file mode 100644 index edf3cf5d79d..00000000000 --- a/gcc/testsuite/gcc.dg/980312-1.c +++ /dev/null @@ -1,25 +0,0 @@ -/* { dg-do link { target i?86-*-* x86_64-*-* } } */ -/* { dg-require-effective-target ilp32 } */ -/* { dg-options "-O2 -march=pentiumpro" } */ - -extern __inline double -__expm1 (double __x) -{ - double __temp; - __temp = 1.0; - return __temp; -} -extern __inline double -__sgn1 (double __x) -{ - return __x >= 0.0 ? 1.0 : -1.0; -} -double -tanh (double __x) -{ - return __expm1 (__x) * __sgn1 (-__x); -} -main () -{ - return tanh (3.45) != 0; -} diff --git a/gcc/testsuite/gcc.dg/980313-1.c b/gcc/testsuite/gcc.dg/980313-1.c deleted file mode 100644 index 889654fc792..00000000000 --- a/gcc/testsuite/gcc.dg/980313-1.c +++ /dev/null @@ -1,26 +0,0 @@ -/* { dg-do link { target i?86-*-* x86_64-*-* } } */ -/* { dg-require-effective-target ilp32 } */ -/* { dg-options "-O2 -march=pentiumpro" } */ - -extern __inline double -__expm1 (double __x) -{ - double __temp; - __temp -= 1.0; - return __temp; -} -extern __inline double -__sgn1 (double __x) -{ - return __x >= 0.0 ? 1.0 : -1.0; -} -double -tanh (double __x) -{ - register double __exm1 = __expm1 (__x); - return __exm1 / (__exm1 + 2.0) * __sgn1 (-__x); -} -main () -{ - return tanh (3.45) != 0; -} diff --git a/gcc/testsuite/gcc.dg/attr-returns_twice-1.c b/gcc/testsuite/gcc.dg/attr-returns_twice-1.c deleted file mode 100644 index e2e725e3634..00000000000 --- a/gcc/testsuite/gcc.dg/attr-returns_twice-1.c +++ /dev/null @@ -1,23 +0,0 @@ -/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ -/* { dg-options "-Wclobbered" } */ - -int newsetjmp(void) __attribute__((returns_twice)); -void g(int); - -int -main (void) -{ - register int reg asm ("esi") = 1; /* { dg-warning "might be clobbered" "" } */ - - if (!newsetjmp ()) - { - reg = 2; - g (reg); - } - else - { - g (reg); - } - - return 0; -} diff --git a/gcc/testsuite/gcc.dg/inline-mcpy.c b/gcc/testsuite/gcc.dg/inline-mcpy.c deleted file mode 100644 index 4917394246a..00000000000 --- a/gcc/testsuite/gcc.dg/inline-mcpy.c +++ /dev/null @@ -1,11 +0,0 @@ -/* Test if we inline memcpy even with -Os, when the user requested it. */ -/* Don't name this test with memcpy in its name, otherwise the scan-assembler - would be confused. */ -/* { dg-do compile { target i?86-*-linux* x86_64-*-linux* } } */ -/* { dg-options "-Os -minline-all-stringops" } */ -/* { dg-final { scan-assembler-not "memcpy" } } */ -char f(int i) -{ - char *ram_split[] = { "5:3", "3:1", "1:1", "3:5" }; - return ram_split[i][0]; -} diff --git a/gcc/testsuite/gcc.dg/pr25196.c b/gcc/testsuite/gcc.dg/pr25196.c deleted file mode 100644 index e73faffe721..00000000000 --- a/gcc/testsuite/gcc.dg/pr25196.c +++ /dev/null @@ -1,34 +0,0 @@ -/* { dg-do run { target i?86-*-* x86_64-*-* } } */ -/* { dg-require-effective-target ilp32 } */ -/* { dg-options "-march=i386 -O3 -fomit-frame-pointer" } */ - -/* For this test case, we used to do an invalid load motion after - reload, because we missed autoincrements of the stack pointer. */ - -extern void abort (void); - -static int j; - -static void __attribute__((noinline)) -f1 (int a, int b, int c, int d, int e) -{ - j = a; -} - -int __attribute__((noinline)) -f2 (int a, int b, int c, int d, int e) -{ - if ((b & 0x1111) != 1) - f1 (a, b, c, d, e); - return 0; -} - -int -main (void) -{ - f2 (123, 0, 0, 0, 0); - if (j != 123) - abort (); - return 0; -} - diff --git a/gcc/testsuite/gcc.dg/pr25993.c b/gcc/testsuite/gcc.dg/pr25993.c deleted file mode 100644 index c77196651c3..00000000000 --- a/gcc/testsuite/gcc.dg/pr25993.c +++ /dev/null @@ -1,14 +0,0 @@ -/* { dg-do assemble { target i?86-*-* x86_64-*-* } } */ -/* { dg-skip-if "" { "*-*-darwin*" } { "*" } { "" } } */ -/* { dg-options "-std=c99 -x assembler-with-cpp" } */ - -#ifndef __ASSEMBLER__ -extern int func(void); -#else -.global func -.type func,%function -.align 4 -func: - ret -.size func,.-func -#endif diff --git a/gcc/testsuite/gcc.dg/pr26449.c b/gcc/testsuite/gcc.dg/pr26449.c deleted file mode 100644 index dc622fadce2..00000000000 --- a/gcc/testsuite/gcc.dg/pr26449.c +++ /dev/null @@ -1,15 +0,0 @@ -/* { dg-do compile { target i?86-*-* } } */ -/* { dg-require-effective-target ilp32 } */ -/* { dg-options "-O1 -ftree-vectorize -march=pentium4 -std=c99" } */ - -void matmul_i4 (int bbase_yn, int xcount) -{ - int x; - int * restrict dest_y; - const int * abase_n; - - for (x = 0; x < xcount; x++) - { - dest_y[x] += abase_n[x] * bbase_yn; - } -} diff --git a/gcc/testsuite/gcc.dg/pr28839.c b/gcc/testsuite/gcc.dg/pr28839.c deleted file mode 100644 index 56a42a37b6e..00000000000 --- a/gcc/testsuite/gcc.dg/pr28839.c +++ /dev/null @@ -1,18 +0,0 @@ -/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ -/* { dg-options "-O2 -msse2 -ftree-vectorize -funswitch-loops" } */ - -static int ready[10]; -void abort (void); -void test_once (int t,int t1) -{ - int i, repeat; - for (i = 0; i < 10; i++) - { - ready[i] = 0; - if (t1) - if (b()) - abort (); - } - if (t) - abort (); -} diff --git a/gcc/testsuite/gcc.dg/pr32191.c b/gcc/testsuite/gcc.dg/pr32191.c deleted file mode 100644 index b76b5886d36..00000000000 --- a/gcc/testsuite/gcc.dg/pr32191.c +++ /dev/null @@ -1,9 +0,0 @@ -/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && lp64 } } } */ -/* { dg-options "-std=c99" } */ - -typedef _Complex float __attribute__((mode(TC))) _Complex128; - -_Complex128 foo (_Complex128 x, _Complex128 y) -{ - return x * y; -} diff --git a/gcc/testsuite/gcc.target/i386/20000724-1.c b/gcc/testsuite/gcc.target/i386/20000724-1.c new file mode 100644 index 00000000000..b3be437b511 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/20000724-1.c @@ -0,0 +1,72 @@ +/* { dg-do run { target *-*-linux* } } */ +/* { dg-require-effective-target ilp32 } */ +/* { dg-options "-O2 -fomit-frame-pointer" } */ + +extern void abort (void); +extern void exit (int); + +struct s { + struct { int a; } a; + int b; + struct { struct { int a; } a; struct t { struct t *a, *b; } b; } c; +}; + +int bar(int (*fn)(void *), void *arg, unsigned long flags) +{ + return 0; +} + +int baz(void *x) +{ + return 0; +} + +void do_check (struct s *) asm ("do_check") __attribute__((regparm(1))); + +void __attribute__((regparm(1))) do_check(struct s *x) +{ + if (x->a.a || x->b || x->c.a.a) + abort(); + if (x->c.b.a != &x->c.b || x->c.b.b != &x->c.b) + abort(); +} + +#define NT "\n\t" + +asm ("\n" +"___checkme:" +NT "pushl %eax; pushl %ebx; pushl %ecx; pushl %edx; pushl %esi; pushl %edi" + +NT "pushl $0; pushl $0; pushl $0; pushl $0; pushl $0" +NT "pushl $0; pushl $0; pushl $0; pushl $0; pushl $0" + +NT "movl %ecx, %eax" +NT "call do_check" + +NT "popl %eax; popl %eax; popl %eax; popl %eax; popl %eax" +NT "popl %eax; popl %eax; popl %eax; popl %eax; popl %eax" + +NT "popl %edi; popl %esi; popl %edx; popl %ecx; popl %ebx; popl %eax" +NT "ret" +); + +extern inline void do_asm(struct s * x) +{ + asm volatile("call ___checkme" : : "c" (x) : "memory"); +} + +int foo(void) +{ + struct s x = { { 0 }, 0, { { 0 }, { &x.c.b, &x.c.b } } }; + bar(baz, &x, 1); + do_asm(&x); + bar(baz, &x, 1); + do_asm(&x); + return 0; +} + +int main() +{ + foo(); + exit(0); +} diff --git a/gcc/testsuite/gcc.target/i386/980312-1.c b/gcc/testsuite/gcc.target/i386/980312-1.c new file mode 100644 index 00000000000..72cdd5e3f36 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/980312-1.c @@ -0,0 +1,25 @@ +/* { dg-do link } */ +/* { dg-require-effective-target ilp32 } */ +/* { dg-options "-O2 -march=pentiumpro" } */ + +extern __inline double +__expm1 (double __x) +{ + double __temp; + __temp = 1.0; + return __temp; +} +extern __inline double +__sgn1 (double __x) +{ + return __x >= 0.0 ? 1.0 : -1.0; +} +double +tanh (double __x) +{ + return __expm1 (__x) * __sgn1 (-__x); +} +main () +{ + return tanh (3.45) != 0; +} diff --git a/gcc/testsuite/gcc.target/i386/980313-1.c b/gcc/testsuite/gcc.target/i386/980313-1.c new file mode 100644 index 00000000000..3b5263cd57e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/980313-1.c @@ -0,0 +1,26 @@ +/* { dg-do link } */ +/* { dg-require-effective-target ilp32 } */ +/* { dg-options "-O2 -march=pentiumpro" } */ + +extern __inline double +__expm1 (double __x) +{ + double __temp; + __temp -= 1.0; + return __temp; +} +extern __inline double +__sgn1 (double __x) +{ + return __x >= 0.0 ? 1.0 : -1.0; +} +double +tanh (double __x) +{ + register double __exm1 = __expm1 (__x); + return __exm1 / (__exm1 + 2.0) * __sgn1 (-__x); +} +main () +{ + return tanh (3.45) != 0; +} diff --git a/gcc/testsuite/gcc.target/i386/attr-returns_twice-1.c b/gcc/testsuite/gcc.target/i386/attr-returns_twice-1.c new file mode 100644 index 00000000000..cd820d27674 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/attr-returns_twice-1.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-Wclobbered" } */ + +int newsetjmp(void) __attribute__((returns_twice)); +void g(int); + +int +main (void) +{ + register int reg asm ("esi") = 1; /* { dg-warning "might be clobbered" "" } */ + + if (!newsetjmp ()) + { + reg = 2; + g (reg); + } + else + { + g (reg); + } + + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/inline-mcpy.c b/gcc/testsuite/gcc.target/i386/inline-mcpy.c new file mode 100644 index 00000000000..7eacb5f9825 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/inline-mcpy.c @@ -0,0 +1,11 @@ +/* Test if we inline memcpy even with -Os, when the user requested it. */ +/* Don't name this test with memcpy in its name, otherwise the scan-assembler + would be confused. */ +/* { dg-do compile { target *-*-linux* } } */ +/* { dg-options "-Os -minline-all-stringops" } */ +/* { dg-final { scan-assembler-not "memcpy" } } */ +char f(int i) +{ + char *ram_split[] = { "5:3", "3:1", "1:1", "3:5" }; + return ram_split[i][0]; +} diff --git a/gcc/testsuite/gcc.target/i386/pr25196.c b/gcc/testsuite/gcc.target/i386/pr25196.c new file mode 100644 index 00000000000..c3b69b87aa2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr25196.c @@ -0,0 +1,34 @@ +/* { dg-do run } */ +/* { dg-require-effective-target ilp32 } */ +/* { dg-options "-march=i386 -O3 -fomit-frame-pointer" } */ + +/* For this test case, we used to do an invalid load motion after + reload, because we missed autoincrements of the stack pointer. */ + +extern void abort (void); + +static int j; + +static void __attribute__((noinline)) +f1 (int a, int b, int c, int d, int e) +{ + j = a; +} + +int __attribute__((noinline)) +f2 (int a, int b, int c, int d, int e) +{ + if ((b & 0x1111) != 1) + f1 (a, b, c, d, e); + return 0; +} + +int +main (void) +{ + f2 (123, 0, 0, 0, 0); + if (j != 123) + abort (); + return 0; +} + diff --git a/gcc/testsuite/gcc.target/i386/pr25993.c b/gcc/testsuite/gcc.target/i386/pr25993.c new file mode 100644 index 00000000000..ebdc903f87d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr25993.c @@ -0,0 +1,14 @@ +/* { dg-do assemble } */ +/* { dg-skip-if "" { "*-*-darwin*" } { "*" } { "" } } */ +/* { dg-options "-std=c99 -x assembler-with-cpp" } */ + +#ifndef __ASSEMBLER__ +extern int func(void); +#else +.global func +.type func,%function +.align 4 +func: + ret +.size func,.-func +#endif diff --git a/gcc/testsuite/gcc.target/i386/pr26449.c b/gcc/testsuite/gcc.target/i386/pr26449.c new file mode 100644 index 00000000000..7a612968444 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr26449.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target ilp32 } */ +/* { dg-options "-O1 -ftree-vectorize -march=pentium4 -std=c99" } */ + +void matmul_i4 (int bbase_yn, int xcount) +{ + int x; + int * restrict dest_y; + const int * abase_n; + + for (x = 0; x < xcount; x++) + { + dest_y[x] += abase_n[x] * bbase_yn; + } +} diff --git a/gcc/testsuite/gcc.target/i386/pr28839.c b/gcc/testsuite/gcc.target/i386/pr28839.c new file mode 100644 index 00000000000..6a215164c58 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr28839.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -msse2 -ftree-vectorize -funswitch-loops" } */ + +static int ready[10]; +void abort (void); +void test_once (int t,int t1) +{ + int i, repeat; + for (i = 0; i < 10; i++) + { + ready[i] = 0; + if (t1) + if (b()) + abort (); + } + if (t) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/pr31854.c b/gcc/testsuite/gcc.target/i386/pr31854.c index d5dca57ea63..6fcd20ef047 100644 --- a/gcc/testsuite/gcc.target/i386/pr31854.c +++ b/gcc/testsuite/gcc.target/i386/pr31854.c @@ -1,4 +1,5 @@ -/* { dg-do compile { target dfp } } */ +/* { dg-do compile } */ +/* { dg-require-effective-target dfp } */ /* { dg-options "-O -std=gnu99" } */ _Decimal128 d128; diff --git a/gcc/testsuite/gcc.target/i386/pr32065-1.c b/gcc/testsuite/gcc.target/i386/pr32065-1.c index 9c8b03e8558..eefea27f16a 100644 --- a/gcc/testsuite/gcc.target/i386/pr32065-1.c +++ b/gcc/testsuite/gcc.target/i386/pr32065-1.c @@ -1,4 +1,5 @@ -/* { dg-do compile { target dfp } } */ +/* { dg-do compile } */ +/* { dg-require-effective-target dfp } */ /* { dg-options "-msse -std=gnu99" } */ _Decimal128 test (void) diff --git a/gcc/testsuite/gcc.target/i386/pr32065-2.c b/gcc/testsuite/gcc.target/i386/pr32065-2.c index 185163b3bcc..61ecfe9e3b6 100644 --- a/gcc/testsuite/gcc.target/i386/pr32065-2.c +++ b/gcc/testsuite/gcc.target/i386/pr32065-2.c @@ -1,4 +1,5 @@ -/* { dg-do run { target dfp } } */ +/* { dg-do run } */ +/* { dg-require-effective-target dfp } */ /* { dg-options "-Os -msse -std=gnu99" } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.target/i386/pr32191.c b/gcc/testsuite/gcc.target/i386/pr32191.c new file mode 100644 index 00000000000..0da5d5c5aae --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr32191.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-std=c99" } */ + +typedef _Complex float __attribute__((mode(TC))) _Complex128; + +_Complex128 foo (_Complex128 x, _Complex128 y) +{ + return x * y; +}