diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-15 19:36:56 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-15 19:36:56 +0000 |
commit | e5d52a0a1a77d134e9af62b9fab8ef0b6595f63d (patch) | |
tree | 2a7369200e79a7b90b133e7dfaa5b3b18d2d7b09 /gcc/testsuite | |
parent | 1d09b2f39aa5a5a2442d3a1dfb7a06ff7583a634 (diff) | |
download | gcc-e5d52a0a1a77d134e9af62b9fab8ef0b6595f63d.tar.gz |
2010-12-15 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 167866
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@167868 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
22 files changed, 628 insertions, 7 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1057858549d..a8cb5584894 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,78 @@ +2010-12-15 Jakub Jelinek <jakub@redhat.com> + + PR debug/46815 + * g++.dg/guality/pr46815.C: New test. + +2010-12-15 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/42083 + * g++.dg/cpp0x/lambda/lambda-ice2.C: New. + +2010-12-15 H.J. Lu <hongjiu.lu@intel.com> + + * gfortran.dg/debug/pr46756.f: Correct PR number. + +2010-12-15 Martin Jambor <mjambor@suse.cz> + + PR tree-optimization/46053 + PR middle-end/46287 + PR middle-end/46242 + * g++.dg/ipa/pr46053.C: New test. + * g++.dg/ipa/pr46287-1.C: Likewise. + * g++.dg/ipa/pr46287-2.C: Likewise. + * g++.dg/ipa/pr46287-3.C: Likewise. + * g++.dg/torture/covariant-1.C: Likewise. + * g++.dg/torture/pr46287.C: Likewise. + +2010-12-15 Alexander Monakov <amonakov@ispras.ru> + + PR rtl-optimization/46649 + * g++.dg/opt/pr46649.C: New. + +2010-12-15 Dave Korn <dave.korn.cygwin@gmail.com> + + PR testsuite/46938 + * gcc.dg/pr43157.c: Add dg-require-linker-plugin directive. + +2010-12-14 Sebastian Pop <sebastian.pop@amd.com> + + PR tree-optimization/46845 + * gcc.dg/graphite/id-pr46845.c: New. + +2010-12-14 Sebastian Pop <sebastian.pop@amd.com> + + PR tree-optimization/46928 + * gcc.dg/tree-ssa/ldist-17.c: New. + +2010-12-14 Sebastian Pop <sebastian.pop@amd.com> + + PR tree-optimization/45948 + * gcc.dg/tree-ssa/ldist-pr45948.c: New. + +2010-12-14 Jason Merrill <jason@redhat.com> + + PR c++/46930 + * g++.dg/cpp0x/constexpr-decl.C: New. + * g++.dg/cpp0x/constexpr-ex1.C: Fix. + * g++.dg/cpp0x/constexpr-static5.C: Fix. + +2010-12-14 Jan Hubicka <jh@suse.cz> + + PR lto/46940 + PR lto/44463 + * gcc.dg/lto/pr46940_0.c: New testcase. + * gcc.dg/lto/pr46940_1.c: New testcase. + +2010-12-14 Nathan Froyd <froydnj@codesourcery.com> + + PR c++/45330 + * g++.dg/lookup/suggestions1.C: New test. + +2010-12-14 Tobias Burnus <burnus@net-b.de> + + PR fortran/46937 + * gfortran.dg/pointer_intent_4.f90: New. + 2010-12-14 Jakub Jelinek <jakub@redhat.com> PR debug/46885 @@ -65,8 +140,8 @@ 2010-12-13 Alexandre Oliva <aoliva@redhat.com> - PR debug/46576 - * gfortran.dg/debug/pr46576.f: New. + PR debug/46756 + * gfortran.dg/debug/pr46756.f: New. 2010-12-13 Alexandre Oliva <aoliva@redhat.com> diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-decl.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-decl.C new file mode 100644 index 00000000000..0a3fcb65623 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-decl.C @@ -0,0 +1,10 @@ +// PR c++/46930 +// { dg-options -std=c++0x } + +struct S { + static constexpr int size; // { dg-error "must have an initializer" } + // { dg-error "previous declaration" "" { target *-*-* } 5 } +}; + +const int limit = 2 * S::size; +constexpr int S::size = 256; // { dg-error "" } diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ex1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ex1.C index c7757f47598..6b090a03f0f 100644 --- a/gcc/testsuite/g++.dg/cpp0x/constexpr-ex1.C +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-ex1.C @@ -16,9 +16,9 @@ struct S { constexpr int twice(); constexpr int t(); // { dg-message "used but never defined" } private: - static constexpr int val; // constexpr variable + static constexpr int val = 7; // constexpr variable }; -constexpr int S::val = 7; + constexpr int S::twice() { return val + val; } constexpr S s = { }; int x1 = s.twice(); // ok diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-static5.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-static5.C index cb553a25fe8..a401cc0b890 100644 --- a/gcc/testsuite/g++.dg/cpp0x/constexpr-static5.C +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-static5.C @@ -3,10 +3,10 @@ template <class T> struct A { - constexpr static T t; + constexpr static T t = T(); // { dg-error "literal" } }; template <class T> -constexpr T A<T>::t = T(); // { dg-error "not literal" } +constexpr T A<T>::t; struct B { diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice2.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice2.C new file mode 100644 index 00000000000..352137aad24 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice2.C @@ -0,0 +1,16 @@ +// PR c++/42083 +// { dg-options "-std=c++0x" } + +template<typename F> +decltype(F()) run(F f) // { dg-message "note" } +{ + return f(); +} + +int main() +{ + auto l = []() { return 5; }; + + run(l); // { dg-error "no match" } + // { dg-message "candidate" "candidate note" { target *-*-* } 14 } +} diff --git a/gcc/testsuite/g++.dg/guality/pr46815.C b/gcc/testsuite/g++.dg/guality/pr46815.C new file mode 100644 index 00000000000..41b9219955d --- /dev/null +++ b/gcc/testsuite/g++.dg/guality/pr46815.C @@ -0,0 +1,25 @@ +// PR debug/46815 +// { dg-do run } +// { dg-options "-g" } +// { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } + +struct S +{ + int i; + S () { i = 42; } + virtual void foo (void) {} +}; + +S +bar () +{ + S s; + return s; // { dg-final { gdb-test 17 "s.i" "42" } } +} + +int +main () +{ + S s = bar (); + return s.i - 42; +} diff --git a/gcc/testsuite/g++.dg/ipa/pr46053.C b/gcc/testsuite/g++.dg/ipa/pr46053.C new file mode 100644 index 00000000000..7be6fc3a0a6 --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr46053.C @@ -0,0 +1,41 @@ +/* { dg-do run } */ +/* { dg-options "-O -fipa-cp -fno-early-inlining" } */ + +extern "C" void abort (); + +struct A +{ + virtual void foo () = 0; +}; + +struct B : A +{ + virtual void foo () = 0; +}; + +struct C : A +{ +}; + +struct D : C, B +{ + int i; + D () : i(0xaaaa) {} + virtual void foo () + { + if (i != 0xaaaa) + abort(); + } +}; + +static inline void bar (B &b) +{ + b.foo (); +} + +int main() +{ + D d; + bar (d); + return 0; +} diff --git a/gcc/testsuite/g++.dg/ipa/pr46287-1.C b/gcc/testsuite/g++.dg/ipa/pr46287-1.C new file mode 100644 index 00000000000..0755529bdb0 --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr46287-1.C @@ -0,0 +1,67 @@ +// Check that indirect calls to thunks do not lead to errors. +// { dg-do run } +// { dg-options "-O" } + +extern "C" void abort (); + +class A +{ +public: + virtual void foo () {abort();} +}; + +class B : public A +{ +public: + int z; + virtual void foo () {abort();} +}; + +class C : public A +{ +public: + void *a[32]; + unsigned long b; + long c[32]; + + virtual void foo () {abort();} +}; + +class D : public C, public B +{ +public: + D () : C(), B() + { + int i; + for (i = 0; i < 32; i++) + { + a[i] = (void *) 0; + c[i] = 0; + } + b = 0xaaaa; + } + + virtual void foo (); +}; + +inline void D::foo() +{ + if (b != 0xaaaa) + abort(); +} + +static inline void bar (B &b) +{ + + b.foo (); +} + +int main() +{ + int i; + D d; + + for (i = 0; i < 5000; i++) + bar (d); + return 0; +} diff --git a/gcc/testsuite/g++.dg/ipa/pr46287-2.C b/gcc/testsuite/g++.dg/ipa/pr46287-2.C new file mode 100644 index 00000000000..272852bad7f --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr46287-2.C @@ -0,0 +1,68 @@ +// Check that indirect calls to thunks do not lead to errors. +// { dg-do run } +// { dg-options "-O -finline -finline-small-functions -finline-functions" } + + +extern "C" void abort (); + +class A +{ +public: + virtual void foo () {abort();} +}; + +class B : public A +{ +public: + int z; + virtual void foo () {abort();} +}; + +class C : public A +{ +public: + void *a[32]; + unsigned long b; + long c[32]; + + virtual void foo () {abort();} +}; + +class D : public C, public B +{ +public: + D () : C(), B() + { + int i; + for (i = 0; i < 32; i++) + { + a[i] = (void *) 0; + c[i] = 0; + } + b = 0xaaaa; + } + + virtual void foo (); +}; + +void D::foo() +{ + if (b != 0xaaaa) + abort(); +} + +static inline void bar (B &b) +{ + + b.foo (); +} + +int main() +{ + int i; + D d; + + for (i = 0; i < 5000; i++) + bar (d); + return 0; +} diff --git a/gcc/testsuite/g++.dg/ipa/pr46287-3.C b/gcc/testsuite/g++.dg/ipa/pr46287-3.C new file mode 100644 index 00000000000..5f291ce1f63 --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr46287-3.C @@ -0,0 +1,67 @@ +// Check that indirect calls to thunks do not lead to errors. +// { dg-do run } +// { dg-options "-O -fipa-cp" } + +extern "C" void abort (); + +class A +{ +public: + virtual void foo () {abort();} +}; + +class B : public A +{ +public: + int z; + virtual void foo () {abort();} +}; + +class C : public A +{ +public: + void *a[32]; + unsigned long b; + long c[32]; + + virtual void foo () {abort();} +}; + +class D : public C, public B +{ +public: + D () : C(), B() + { + int i; + for (i = 0; i < 32; i++) + { + a[i] = (void *) 0; + c[i] = 0; + } + b = 0xaaaa; + } + + virtual void foo (); +}; + +void D::foo() +{ + if (b != 0xaaaa) + abort(); +} + +static void bar (B &b) +{ + + b.foo (); +} + +int main() +{ + int i; + D d; + + for (i = 0; i < 5000; i++) + bar (d); + return 0; +} diff --git a/gcc/testsuite/g++.dg/lookup/suggestions1.C b/gcc/testsuite/g++.dg/lookup/suggestions1.C new file mode 100644 index 00000000000..1185d58416a --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/suggestions1.C @@ -0,0 +1,8 @@ +// { dg-do compile } + +namespace N { namespace M { int foo; } } // { dg-message "N::M::foo" } +int f (void) { return N::foo; } // { dg-error "not a member" } +// { dg-message "suggested alternative" "missing namespace" { target *-*-* } 4 } + +int g (void) { return ::foo; } // { dg-error "not been declared" } +// { dg-message "suggested alternative" "omitted namespace" { target *-*-* } 7 } diff --git a/gcc/testsuite/g++.dg/opt/pr46649.C b/gcc/testsuite/g++.dg/opt/pr46649.C new file mode 100644 index 00000000000..1428e8bddbe --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr46649.C @@ -0,0 +1,9 @@ +// { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } +// { dg-options "-fschedule-insns -fselective-scheduling" } + +void foo () +{ + for (;;) + for (;;({break;})) + ; +} diff --git a/gcc/testsuite/g++.dg/torture/covariant-1.C b/gcc/testsuite/g++.dg/torture/covariant-1.C new file mode 100644 index 00000000000..9f1fd0a52ca --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/covariant-1.C @@ -0,0 +1,33 @@ +// { dg-do run } + +extern "C" void abort (); + +class A { +public: + virtual A* getThis() { return this; } +}; + +class B { +int a; +public: + virtual B* getThis() { return this; } +}; + +class AB : public A, public B { +public: + virtual AB* getThis() { return this; } +}; + +int main () +{ + AB ab; + + A* a = &ab; + B* b = &ab; + + if (a->getThis() != a + || b->getThis() != b) + abort (); + + return 0; +} diff --git a/gcc/testsuite/g++.dg/torture/pr46287.C b/gcc/testsuite/g++.dg/torture/pr46287.C new file mode 100644 index 00000000000..fd201c48da8 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr46287.C @@ -0,0 +1,66 @@ +// Check that indirect calls to thunks do not lead to errors. +// { dg-do run } + +extern "C" void abort (); + +class A +{ +public: + virtual void foo () {abort();} +}; + +class B : public A +{ +public: + int z; + virtual void foo () {abort();} +}; + +class C : public A +{ +public: + void *a[32]; + unsigned long b; + long c[32]; + + virtual void foo () {abort();} +}; + +class D : public C, public B +{ +public: + D () : C(), B() + { + int i; + for (i = 0; i < 32; i++) + { + a[i] = (void *) 0; + c[i] = 0; + } + b = 0xaaaa; + } + + virtual void foo (); +}; + +void D::foo() +{ + if (b != 0xaaaa) + abort(); +} + +static inline void bar (B &b) +{ + + b.foo (); +} + +int main() +{ + int i; + D d; + + for (i = 0; i < 5000; i++) + bar (d); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/graphite/id-pr46845.c b/gcc/testsuite/gcc.dg/graphite/id-pr46845.c new file mode 100644 index 00000000000..f4da78eda35 --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/id-pr46845.c @@ -0,0 +1,17 @@ +/* { dg-options "-O2 -ffast-math -fgraphite-identity -w -Wno-psabi" { target { i?86-*-* x86_64-*-* } } } */ + +typedef float V2SF __attribute__ ((vector_size (128))); + +V2SF +foo (int x, V2SF a) +{ + V2SF b; + if (x & 42) + b = a; + else + b = a + (V2SF) {1.0f/0.0f - 1.0f/0.0f, 1.0f/0.0f - 1.0f/0.0f}; + while (x--) + a += b; + + return a; +} diff --git a/gcc/testsuite/gcc.dg/lto/pr46940_0.c b/gcc/testsuite/gcc.dg/lto/pr46940_0.c new file mode 100644 index 00000000000..e9f6dc87f5e --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr46940_0.c @@ -0,0 +1,10 @@ +* { dg-require-linker-plugin "" } */ +* { dg-extra-ld-options "-fuse-linker-plugin" } */ + +extern __attribute__((visibility("hidden"))) void _moz_foo (void); +extern __typeof (_moz_foo) _moz_foo __asm__ ("" "INT__foo") __attribute__((__visibility__("hidden"))) ; +void _moz_foo(void) +{ + printf ("blah\n"); +} +extern __typeof (_moz_foo) EXT__foo __asm__("" "_moz_foo") __attribute__((__alias__("" "INT__foo"))); diff --git a/gcc/testsuite/gcc.dg/lto/pr46940_1.c b/gcc/testsuite/gcc.dg/lto/pr46940_1.c new file mode 100644 index 00000000000..0a8dab54b5b --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr46940_1.c @@ -0,0 +1,5 @@ +extern void _moz_foo (void); +main() +{ + _moz_foo (); +} diff --git a/gcc/testsuite/gcc.dg/pr43157.c b/gcc/testsuite/gcc.dg/pr43157.c index aef357f69d7..c06f98ac02e 100644 --- a/gcc/testsuite/gcc.dg/pr43157.c +++ b/gcc/testsuite/gcc.dg/pr43157.c @@ -1,5 +1,6 @@ /* { dg-do link } */ /* { dg-require-effective-target lto } */ +/* { dg-require-linker-plugin "" } */ /* { dg-options "-O1 -flto -fuse-linker-plugin" } */ #define LABEL3(pfx, x) # pfx x diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-17.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-17.c new file mode 100644 index 00000000000..a831d3c1b89 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-17.c @@ -0,0 +1,50 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-loop-distribution -fdump-tree-ldist-details" } */ + +typedef int mad_fixed_t; +struct mad_pcm +{ + unsigned int samplerate; + unsigned short channels; + unsigned short length; + mad_fixed_t samples[2][1152]; +}; +struct mad_synth +{ + mad_fixed_t filter[2][2][2][16][8]; + unsigned int phase; + struct mad_pcm pcm; +}; +void mad_synth_mute (struct mad_synth *synth); +void +mad_synth_mute (struct mad_synth *synth) +{ + unsigned int ch; + unsigned int s; + unsigned int v; + + ch = 0U; + while (ch < 2U) + { + s = 0U; + while (s < 16U) + { + v = 0U; + while (v < 8U) + { + synth->filter[ch][1][1][s][v] = 0; + synth->filter[ch][1][0][s][v] = 0; + synth->filter[ch][0][1][s][v] = 0; + synth->filter[ch][0][0][s][v] = 0; + v++; + } + s++; + } + ch++; + } + return; +} + +/* { dg-final { scan-tree-dump "distributed: split to 4" "ldist" } } */ +/* { dg-final { scan-tree-dump-times "__builtin_memset" 8 "ldist" } } */ +/* { dg-final { cleanup-tree-dump "ldist" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-pr45948.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-pr45948.c new file mode 100644 index 00000000000..3e467bdb05d --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-pr45948.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-loop-distribution -fdump-tree-ldist-details" } */ + +extern void bar(int); + +void +foo (int i, int n) +{ + int a[30]; + int b[30]; + for (; i < n; i++) + a[i] = b[i] = 0; + + while (1) + if (b[0]) + bar (a[i - 1]); +} + +/* We should apply loop distribution and generate 2 memset (0). */ + +/* { dg-final { scan-tree-dump "distributed: split to 3" "ldist" } } */ +/* { dg-final { scan-tree-dump-times "__builtin_memset" 4 "ldist" } } */ +/* { dg-final { cleanup-tree-dump "ldist" } } */ diff --git a/gcc/testsuite/gfortran.dg/debug/pr46576.f b/gcc/testsuite/gfortran.dg/debug/pr46756.f index 58fb3011edb..fab06e3949d 100644 --- a/gcc/testsuite/gfortran.dg/debug/pr46576.f +++ b/gcc/testsuite/gfortran.dg/debug/pr46756.f @@ -1,4 +1,4 @@ -C PR debug/46576, reduced from ../20010519-1.f +C PR debug/46756, reduced from ../20010519-1.f C { dg-do compile } C { dg-options "-O -fcompare-debug" } LOGICAL QDISK,QDW,QCMPCT diff --git a/gcc/testsuite/gfortran.dg/pointer_intent_4.f90 b/gcc/testsuite/gfortran.dg/pointer_intent_4.f90 new file mode 100644 index 00000000000..862edff4a58 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pointer_intent_4.f90 @@ -0,0 +1,30 @@ +! { dg-do run } +! { dg-options "-fno-inline" } +! +! PR fortran/46937 +! +! Check that a non-pointer INTENT(IN) dummy +! with pointer component is properly treated +! +program test + type myT + integer, pointer :: point + end type myT + type(myT) :: t2 + allocate(t2%point) + t2%point = 42 + call nonpointer(t2) + if(t2%point /= 7) call abort() + t2%point = 42 + call nonpointer2(t2) + if(t2%point /= 66) call abort() +contains + subroutine nonpointer(t) + type(myT), intent(in) :: t + t%point = 7 + end subroutine nonpointer + subroutine nonpointer2(t) + class(myT), intent(in) :: t + t%point = 66 + end subroutine nonpointer2 +end program |