diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2014-10-30 09:35:42 +0000 |
---|---|---|
committer | <> | 2015-01-09 11:51:27 +0000 |
commit | c27a97d04853380f1e80525391b3f0d156ed4c84 (patch) | |
tree | 68ffaade7c605bc80cffa18360799c98a810976f /gcc/testsuite/g++.dg/other | |
parent | 6af3fdec2262dd94954acc5e426ef71cbd4521d3 (diff) | |
download | gcc-tarball-c27a97d04853380f1e80525391b3f0d156ed4c84.tar.gz |
Imported from /home/lorry/working-area/delta_gcc-tarball/gcc-4.9.2.tar.bz2.gcc-4.9.2
Diffstat (limited to 'gcc/testsuite/g++.dg/other')
52 files changed, 409 insertions, 83 deletions
diff --git a/gcc/testsuite/g++.dg/other/PR23205.C b/gcc/testsuite/g++.dg/other/PR23205.C index a31fc1d773..b05087b542 100644 --- a/gcc/testsuite/g++.dg/other/PR23205.C +++ b/gcc/testsuite/g++.dg/other/PR23205.C @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* tile*-*-* *-*-vxworks } { "*" } { "" } } */ +/* { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* nios2-*-* tile*-*-* *-*-vxworks } { "*" } { "" } } */ /* { dg-options "-gstabs+ -fno-eliminate-unused-debug-types" } */ const int foobar = 4; diff --git a/gcc/testsuite/g++.dg/other/abstract4.C b/gcc/testsuite/g++.dg/other/abstract4.C new file mode 100644 index 0000000000..68b2eb27b8 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/abstract4.C @@ -0,0 +1,18 @@ +// PR c++/51184 + +template<typename T> +struct S { }; + +template<typename T> +void foo(); + +struct Abs +{ + virtual void bar() = 0; +}; + +int main() +{ + S<Abs(int)> s; // { dg-error "abstract" } + foo<Abs(int)>(); // { dg-error "abstract" } +} diff --git a/gcc/testsuite/g++.dg/other/abstract5.C b/gcc/testsuite/g++.dg/other/abstract5.C new file mode 100644 index 0000000000..d13dd9e516 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/abstract5.C @@ -0,0 +1,6 @@ +struct A +{ + virtual void f() = 0; +}; + +typedef A (*fp)(); // { dg-error "abstract" } diff --git a/gcc/testsuite/g++.dg/other/abstract6.C b/gcc/testsuite/g++.dg/other/abstract6.C new file mode 100644 index 0000000000..ceba1a60b6 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/abstract6.C @@ -0,0 +1,10 @@ +// PR c++/60532 + +class A +{ + ~A (); +}; +class B : A +{ + virtual void m () = 0; +}; diff --git a/gcc/testsuite/g++.dg/other/anon-union2.C b/gcc/testsuite/g++.dg/other/anon-union2.C new file mode 100644 index 0000000000..31bb74fa99 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/anon-union2.C @@ -0,0 +1,10 @@ +// PR c++/52915 + +struct S { + int val; + S(int v) : val(v) {} +}; + +void f() { + union { S a; }; // { dg-error "constructor|no match" } +} diff --git a/gcc/testsuite/g++.dg/other/anon-union3.C b/gcc/testsuite/g++.dg/other/anon-union3.C new file mode 100644 index 0000000000..94d0aecaf0 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/anon-union3.C @@ -0,0 +1,25 @@ +// PR c++/32054 + +class C +{ + auto union // { dg-error "storage class" "" { target { ! c++11 } } } + { + int a; + }; // { dg-error "multiple|specified" "" { target c++11 } } + register union // { dg-error "storage class" } + { + int b; + }; + static union // { dg-error "storage class" } + { + int c; + }; + extern union // { dg-error "storage class" } + { + int d; + }; + mutable union // { dg-error "storage class" } + { + int e; + }; +}; diff --git a/gcc/testsuite/g++.dg/other/anon3.C b/gcc/testsuite/g++.dg/other/anon3.C index 707c2d58f9..586a40e5ee 100644 --- a/gcc/testsuite/g++.dg/other/anon3.C +++ b/gcc/testsuite/g++.dg/other/anon3.C @@ -4,4 +4,4 @@ // { dg-do compile } -enum { a = 3 } x; // { dg-warning "anonymous type" "" { target c++98 } } +enum { a = 3 } x; // { dg-warning "anonymous type" "" { target { ! c++11 } } } diff --git a/gcc/testsuite/g++.dg/other/anon4.C b/gcc/testsuite/g++.dg/other/anon4.C index 571f4ae65f..37df228da9 100644 --- a/gcc/testsuite/g++.dg/other/anon4.C +++ b/gcc/testsuite/g++.dg/other/anon4.C @@ -3,6 +3,6 @@ void foo() { - int i; // { dg-error "previously" } + int i; // { dg-message "previously" } union { int i; }; // { dg-error "redeclaration" } } diff --git a/gcc/testsuite/g++.dg/other/anon5.C b/gcc/testsuite/g++.dg/other/anon5.C index e8ebe0cc2b..81e9def537 100644 --- a/gcc/testsuite/g++.dg/other/anon5.C +++ b/gcc/testsuite/g++.dg/other/anon5.C @@ -1,6 +1,8 @@ // PR c++/34094 -// { dg-do link { target { ! { *-*-darwin* *-*-hpux* *-*-solaris2.* alpha*-dec-osf* mips-sgi-irix* } } } } +// { dg-do link { target { ! { *-*-darwin* *-*-hpux* *-*-solaris2.* } } } } // { dg-options "-g" } +// Ignore additional message on powerpc-ibm-aix +// { dg-prune-output "obtain more information" } */ namespace { struct c @@ -11,7 +13,7 @@ namespace { const bool &f() { - return c::t; // { dg-message "undefined" "undefined" { target *-*-* } 0 } + return c::t; // { dg-message "\[Uu\]ndefined" "undefined" { target *-*-* } 0 } // Some targets report the error for the previous line, others // don't give line number inforamtion for it, so use line 0. } diff --git a/gcc/testsuite/g++.dg/other/anon6.C b/gcc/testsuite/g++.dg/other/anon6.C new file mode 100644 index 0000000000..2fd094254a --- /dev/null +++ b/gcc/testsuite/g++.dg/other/anon6.C @@ -0,0 +1,8 @@ +// PR c++/60353 + +struct A { + A(int); +}; +typedef struct { + A format; +} B; diff --git a/gcc/testsuite/g++.dg/other/armv7m-1.C b/gcc/testsuite/g++.dg/other/armv7m-1.C new file mode 100644 index 0000000000..6aa686b10c --- /dev/null +++ b/gcc/testsuite/g++.dg/other/armv7m-1.C @@ -0,0 +1,69 @@ +/* { dg-do run { target arm*-*-* } } */ +/* Test Armv7m interrupt routines. */ +#include <stdlib.h> + +#ifdef __ARM_ARCH_7M__ +void __attribute__((interrupt)) +foo(void) +{ + long long n; + long p; + asm volatile ("" : "=r" (p) : "0" (&n)); + if (p & 4) + abort (); + return; +} + +void __attribute__((interrupt)) +bar(void) +{ + throw 42; +} + +int main() +{ + int a; + int before; + int after; + volatile register int sp asm("sp"); + + asm volatile ("mov %0, sp\n" + "blx %2\n" + "mov %1, sp\n" + : "=&r" (before), "=r" (after) : "r" (foo) + : "memory", "cc", "r0", "r1", "r2", "r3", "ip", "lr"); + if (before != after) + abort(); + asm volatile ("mov %0, sp\n" + "sub sp, sp, #4\n" + "blx %2\n" + "add sp, sp, #4\n" + "mov %1, sp\n" + : "=&r" (before), "=r" (after) : "r" (foo) + : "memory", "cc", "r0", "r1", "r2", "r3", "ip", "lr"); + if (before != after) + abort(); + before = sp; + try + { + bar(); + } + catch (int i) + { + if (i != 42) + abort(); + } + catch (...) + { + abort(); + } + if (before != sp) + abort(); + exit(0); +} +#else +int main() +{ + exit (0); +} +#endif diff --git a/gcc/testsuite/g++.dg/other/crash-6.C b/gcc/testsuite/g++.dg/other/crash-6.C index 2220675dc7..06aea4f589 100644 --- a/gcc/testsuite/g++.dg/other/crash-6.C +++ b/gcc/testsuite/g++.dg/other/crash-6.C @@ -1,6 +1,6 @@ // Origin: PR c++/42634 -// { dg-options "-g -std=c++0x" } -// { dg-do compile } +// { dg-options "-g" } +// { dg-do compile { target c++11 } } template<typename T> T declval(); diff --git a/gcc/testsuite/g++.dg/other/crash-7.C b/gcc/testsuite/g++.dg/other/crash-7.C index d5bc892c07..d96aeead07 100644 --- a/gcc/testsuite/g++.dg/other/crash-7.C +++ b/gcc/testsuite/g++.dg/other/crash-7.C @@ -1,6 +1,6 @@ // Origin: PR c++/42336 -// { dg-options "-std=c++0x -O2 -g" } -// { dg-do compile } +// { dg-options "-O2 -g" } +// { dg-do compile { target c++11 } } struct X { void func() {} diff --git a/gcc/testsuite/g++.dg/other/crash-8.C b/gcc/testsuite/g++.dg/other/crash-8.C index c260431d5e..dcae7da76c 100644 --- a/gcc/testsuite/g++.dg/other/crash-8.C +++ b/gcc/testsuite/g++.dg/other/crash-8.C @@ -1,5 +1,6 @@ // Origin: PR c++/42797 -// { dg-options "-g -O2 -std=c++0x" } +// { dg-do compile { target c++11 } } +// { dg-options "-g -O2" } template<typename _Tp, _Tp __v> struct integral_constant { static const _Tp value = __v; diff --git a/gcc/testsuite/g++.dg/other/cv_func.C b/gcc/testsuite/g++.dg/other/cv_func.C index 941cb8d53d..2eb9f039a5 100644 --- a/gcc/testsuite/g++.dg/other/cv_func.C +++ b/gcc/testsuite/g++.dg/other/cv_func.C @@ -3,7 +3,7 @@ typedef int FIC(int) const; typedef int FI(int); -FIC f; // { dg-error "qualified" } +FIC f; // { dg-error "cv-qualifier" } struct S { FIC f; // OK diff --git a/gcc/testsuite/g++.dg/other/cv_func3.C b/gcc/testsuite/g++.dg/other/cv_func3.C new file mode 100644 index 0000000000..0fd47882f2 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/cv_func3.C @@ -0,0 +1,10 @@ +// PR c++/58810 + +typedef int F() const; + +F f; // { dg-error "cv-qualifier" } + +struct A +{ + friend F f; // { dg-error "cv-qualifier" } +}; diff --git a/gcc/testsuite/g++.dg/other/darwin-cfstring1.C b/gcc/testsuite/g++.dg/other/darwin-cfstring1.C index b30ba9bef9..b2def1e858 100644 --- a/gcc/testsuite/g++.dg/other/darwin-cfstring1.C +++ b/gcc/testsuite/g++.dg/other/darwin-cfstring1.C @@ -4,7 +4,7 @@ /* Developed by Ziemowit Laski <zlaski@apple.com>. */ /* { dg-do compile { target *-*-darwin* } } */ -/* { dg-options "-mconstant-cfstrings" } */ +/* { dg-options "-ftrack-macro-expansion=0 -mconstant-cfstrings" } */ #include <CoreFoundation/CFString.h> diff --git a/gcc/testsuite/g++.dg/other/default5.C b/gcc/testsuite/g++.dg/other/default5.C index d5bae344c4..87acb765e6 100644 --- a/gcc/testsuite/g++.dg/other/default5.C +++ b/gcc/testsuite/g++.dg/other/default5.C @@ -43,5 +43,5 @@ template<int> struct B void F2(int, int, int = 0); }; -template<int N> void B<N>::F1(int, int = 0, int) {} -template<int N> void B<N>::F2(int = 0, int, int) {} // { dg-error "default" } +template<int N> void B<N>::F1(int, int = 0, int) {} // { dg-error "default arguments" } +template<int N> void B<N>::F2(int = 0, int, int) {} // { dg-error "default arguments|parameter 2" } diff --git a/gcc/testsuite/g++.dg/other/default8.C b/gcc/testsuite/g++.dg/other/default8.C new file mode 100644 index 0000000000..255a661356 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/default8.C @@ -0,0 +1,43 @@ +// PR c++54485 + +template<typename T> +class K1 +{ + int fn(int, int); + int gn(int, int); +}; + +template<typename T> +int K1<T>::fn (int a, int b = 3) // { dg-error "default arguments" } +{ + return a - b; +} + +template<typename T> +int K1<T>::gn (int a = 1, int b = 3) // { dg-error "default arguments" } +{ + return a - b; +} + +template<typename T> +class K2 +{ + template<typename U> + int fn(int, int); + template<typename U> + int gn(int, int); +}; + +template<typename T> +template<typename U> +int K2<T>::fn (int a, int b = 3) // { dg-error "default arguments" } +{ + return a - b; +} + +template<typename T> +template<typename U> +int K2<T>::gn (int a = 1, int b = 3) // { dg-error "default arguments" } +{ + return a - b; +} diff --git a/gcc/testsuite/g++.dg/other/dump-ada-spec-1.C b/gcc/testsuite/g++.dg/other/dump-ada-spec-1.C new file mode 100644 index 0000000000..eb249e7985 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/dump-ada-spec-1.C @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-fdump-ada-spec" } */ + +struct S +{ + int i; +}; + +/* { dg-final { scan-ada-spec "type S is record" } } */ +/* { dg-final { cleanup-ada-spec } } */ diff --git a/gcc/testsuite/g++.dg/other/dump-ada-spec-2.C b/gcc/testsuite/g++.dg/other/dump-ada-spec-2.C new file mode 100644 index 0000000000..87c183aab6 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/dump-ada-spec-2.C @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-fdump-ada-spec" } */ + +struct S +{ + int it; + __extension__ unsigned char data[]; +}; + +/* { dg-final { scan-ada-spec "array \\(0 .. -1\\)" } } */ +/* { dg-final { cleanup-ada-spec } } */ diff --git a/gcc/testsuite/g++.dg/other/enum3.C b/gcc/testsuite/g++.dg/other/enum3.C new file mode 100644 index 0000000000..23d6c83576 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/enum3.C @@ -0,0 +1,10 @@ +// PR c++/53848 + +extern "C" +{ + struct s { + enum { + e = 0 + } f; + }; +} diff --git a/gcc/testsuite/g++.dg/other/error10.C b/gcc/testsuite/g++.dg/other/error10.C index 5c17277abb..546a4d65c4 100644 --- a/gcc/testsuite/g++.dg/other/error10.C +++ b/gcc/testsuite/g++.dg/other/error10.C @@ -6,10 +6,9 @@ template<int> struct A {}; template<int N> void foo(const A<N> &a) -{ -A<N>(a); } // { dg-error "\\(\\* & a\\)" "" } +{ -A<N>(a); } // { dg-error "operand type is 'A<0>'" } void bar() { foo(A<0>()); // { dg-message "required from here" "" } } - diff --git a/gcc/testsuite/g++.dg/other/error15.C b/gcc/testsuite/g++.dg/other/error15.C index 3601852322..d218c13bbb 100644 --- a/gcc/testsuite/g++.dg/other/error15.C +++ b/gcc/testsuite/g++.dg/other/error15.C @@ -3,39 +3,39 @@ extern void g0 (int a, int b); extern void g1 (int a, float b); -extern void f0 (int a, // { dg-error "previous" } +extern void f0 (int a, // { dg-message "previous" } int a); // { dg-error "redefinition" } -extern void f1 (int a, // { dg-error "previous" } +extern void f1 (int a, // { dg-message "previous" } float a); // { dg-error "conflicting" } -extern void f3 (int a, int b, int c, // { dg-error "previous" } +extern void f3 (int a, int b, int c, // { dg-message "previous" } int a); // { dg-error "redefinition" } -extern void f4 (int a, int b, int c, // { dg-error "previous" } +extern void f4 (int a, int b, int c, // { dg-message "previous" } int a, // { dg-error "redefinition" } int a); // { dg-error "redefinition" } -extern void f5 (int a, int b, int c, int d, int e, int f, int g, int h, // { dg-error "previous" } +extern void f5 (int a, int b, int c, int d, int e, int f, int g, int h, // { dg-message "previous" } int a, // { dg-error "redefinition" } int i, int j, int k, int l, int m, int n, int o, int p, int q, int r, int s, int t, int u, int v, int w, int x, int y, int z); -extern void f6 (int a, int, int, int, int, int, int, int, int, int, int, // { dg-error "previous" } +extern void f6 (int a, int, int, int, int, int, int, int, int, int, int, // { dg-message "previous" } int a, // { dg-error "redefinition" } int, int, int, int, int, int, int, int, int, int, int, float, float, float, float, float, float, float, float, int); -extern void f7 (void (*a)(int), // { dg-error "previous" } +extern void f7 (void (*a)(int), // { dg-message "previous" } void (*a)(int)); // { dg-error "redefinition" } -extern void f8 (float (*a)(int), // { dg-error "previous" } +extern void f8 (float (*a)(int), // { dg-message "previous" } int (*a)(float)); // { dg-error "conflicting" } -extern void f9 (int a, // { dg-error "previous" } +extern void f9 (int a, // { dg-message "previous" } int a, // { dg-error "redefinition" } int a); // { dg-error "redefinition" } -extern void f10 (int a, // { dg-error "previous" } - int b, // { dg-error "previous" } - int c, // { dg-error "previous" } +extern void f10 (int a, // { dg-message "previous" } + int b, // { dg-message "previous" } + int c, // { dg-message "previous" } int c, // { dg-error "redefinition" } int b, // { dg-error "redefinition" } int a); // { dg-error "redefinition" } @@ -43,7 +43,7 @@ extern void f10 (int a, // { dg-error "previous" } class C1 { public: void C1_g0 (int a, int b); - void C1_f0 (int a, // { dg-error "previous" } + void C1_f0 (int a, // { dg-message "previous" } int a); // { dg-error "redefinition" } }; @@ -51,6 +51,6 @@ template <class T> class C2 { public: void C2_g0 (T a, T b); - void C2_f0 (T a, // { dg-error "previous" } + void C2_f0 (T a, // { dg-message "previous" } T a); // { dg-error "redefinition" } }; diff --git a/gcc/testsuite/g++.dg/other/error16.C b/gcc/testsuite/g++.dg/other/error16.C index 1e34647145..38c0fd63fd 100644 --- a/gcc/testsuite/g++.dg/other/error16.C +++ b/gcc/testsuite/g++.dg/other/error16.C @@ -10,5 +10,5 @@ typedef Outer<X> XOuter; int main() { Outer<int> ab; - ab.foo() == 1; // { dg-error "ab.Outer" } + ab.foo() == 1; // { dg-error "operand types are 'Outer<int>::Inner' and 'int'" } } diff --git a/gcc/testsuite/g++.dg/other/error20.C b/gcc/testsuite/g++.dg/other/error20.C index f3b17aa196..bb7d7b3b07 100644 --- a/gcc/testsuite/g++.dg/other/error20.C +++ b/gcc/testsuite/g++.dg/other/error20.C @@ -8,6 +8,6 @@ struct A // { dg-message "operator=|no known conversion" } void bar (A& a) { - a.foo () = 0; // { dg-error "A::foo\\(\\) = 0" } + a.foo () = 0; // { dg-error "operand types are 'A' and 'int'" } // { dg-message "candidate" "candidate note" { target *-*-* } 11 } } diff --git a/gcc/testsuite/g++.dg/other/error4.C b/gcc/testsuite/g++.dg/other/error4.C index bd740d92a3..a5d5e3c7e5 100644 --- a/gcc/testsuite/g++.dg/other/error4.C +++ b/gcc/testsuite/g++.dg/other/error4.C @@ -7,7 +7,7 @@ struct Wrapper {}; -void Foo(int const &); // { dg-error "in passing" "" } +void Foo(int const &); // { dg-message "in passing" "" } void Baz () { diff --git a/gcc/testsuite/g++.dg/other/error8.C b/gcc/testsuite/g++.dg/other/error8.C index 9246c2afa5..116a6846c7 100644 --- a/gcc/testsuite/g++.dg/other/error8.C +++ b/gcc/testsuite/g++.dg/other/error8.C @@ -5,7 +5,7 @@ void foo(void) { - union { int alpha; int beta; }; // { dg-error "previous declaration" } + union { int alpha; int beta; }; // { dg-message "previous declaration" } double alpha; // { dg-error "conflicting declaration" } } diff --git a/gcc/testsuite/g++.dg/other/final1.C b/gcc/testsuite/g++.dg/other/final1.C index 3e02c25216..db513629b6 100644 --- a/gcc/testsuite/g++.dg/other/final1.C +++ b/gcc/testsuite/g++.dg/other/final1.C @@ -1,6 +1,6 @@ /* Verify that final methods are devirtualized */ -/* { dg-do compile } */ -/* { dg-options "-fdump-tree-original -std=c++0x" } */ +/* { dg-do compile { target c++11 } } */ +/* { dg-options "-fdump-tree-original" } */ struct A final { diff --git a/gcc/testsuite/g++.dg/other/final2.C b/gcc/testsuite/g++.dg/other/final2.C index a07562299d..92e7537964 100644 --- a/gcc/testsuite/g++.dg/other/final2.C +++ b/gcc/testsuite/g++.dg/other/final2.C @@ -1,5 +1,6 @@ // PR c++/53186 -// { dg-options "-fdump-tree-original -std=c++11" } +// { dg-do compile { target c++11 } } +// { dg-options "-fdump-tree-original" } struct F1 { diff --git a/gcc/testsuite/g++.dg/other/gc5.C b/gcc/testsuite/g++.dg/other/gc5.C index a369084e00..00184fc0e0 100644 --- a/gcc/testsuite/g++.dg/other/gc5.C +++ b/gcc/testsuite/g++.dg/other/gc5.C @@ -1,6 +1,6 @@ // PR c++/51852 -// { dg-do compile } -// { dg-options "-std=gnu++11 --param ggc-min-heapsize=0 --param ggc-min-expand=0" } +// { dg-do compile { target c++11 } } +// { dg-options "--param ggc-min-heapsize=0 --param ggc-min-expand=0" } template <typename, typename> class transformed {}; diff --git a/gcc/testsuite/g++.dg/other/i386-2.C b/gcc/testsuite/g++.dg/other/i386-2.C index e8237a45b7..2f8650a66b 100644 --- a/gcc/testsuite/g++.dg/other/i386-2.C +++ b/gcc/testsuite/g++.dg/other/i386-2.C @@ -1,5 +1,5 @@ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ -/* { dg-options "-O -pedantic-errors -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma" } */ +/* { dg-options "-O -pedantic-errors -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1" } */ /* Test that {,x,e,p,t,s,w,a,b,i}mmintrin.h, mm3dnow.h, fma4intrin.h, xopintrin.h, abmintrin.h, bmiintrin.h, tbmintrin.h, lwpintrin.h, diff --git a/gcc/testsuite/g++.dg/other/i386-3.C b/gcc/testsuite/g++.dg/other/i386-3.C index 9dd587a5e7..df0bd27979 100644 --- a/gcc/testsuite/g++.dg/other/i386-3.C +++ b/gcc/testsuite/g++.dg/other/i386-3.C @@ -1,5 +1,5 @@ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ -/* { dg-options "-O -fkeep-inline-functions -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma" } */ +/* { dg-options "-O -fkeep-inline-functions -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1" } */ /* Test that {,x,e,p,t,s,w,a,b,i}mmintrin.h, mm3dnow.h, fma4intrin.h, xopintrin.h, abmintrin.h, bmiintrin.h, tbmintrin.h, lwpintrin.h, diff --git a/gcc/testsuite/g++.dg/other/isnan.C b/gcc/testsuite/g++.dg/other/isnan.C new file mode 100644 index 0000000000..f80523dc80 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/isnan.C @@ -0,0 +1,8 @@ +// PR c++/48369 + +extern "C" int isnan (double); + +void f(double d) +{ + bool b = isnan(d); +} diff --git a/gcc/testsuite/g++.dg/other/java3.C b/gcc/testsuite/g++.dg/other/java3.C new file mode 100644 index 0000000000..1bc0a8874f --- /dev/null +++ b/gcc/testsuite/g++.dg/other/java3.C @@ -0,0 +1,7 @@ +// PR c++/11006 + +typedef int* jclass; + +void foo () { + new __java_boolean; // { dg-error "valid" } +} diff --git a/gcc/testsuite/g++.dg/other/packed1.C b/gcc/testsuite/g++.dg/other/packed1.C index ac586c6c00..74e4962a47 100644 --- a/gcc/testsuite/g++.dg/other/packed1.C +++ b/gcc/testsuite/g++.dg/other/packed1.C @@ -1,4 +1,4 @@ -// { dg-do run { xfail sh-*-* lm32-*-* } } +// { dg-do run { xfail lm32-*-* } } // NMS:2003-04-21 this fails on strict aligned architectures again, // the patch was reverted because it broke something more important. diff --git a/gcc/testsuite/g++.dg/other/pr23205-2.C b/gcc/testsuite/g++.dg/other/pr23205-2.C index fbd16dfab5..c7eefaa58c 100644 --- a/gcc/testsuite/g++.dg/other/pr23205-2.C +++ b/gcc/testsuite/g++.dg/other/pr23205-2.C @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* tile*-*-* } { "*" } { "" } } */ +/* { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* tile*-*-* nios2-*-* } { "*" } { "" } } */ /* { dg-options "-gstabs+ -fno-eliminate-unused-debug-types -ftoplevel-reorder" } */ const int foobar = 4; diff --git a/gcc/testsuite/g++.dg/other/pr39496.C b/gcc/testsuite/g++.dg/other/pr39496.C index e535ee0d69..c9e55df436 100644 --- a/gcc/testsuite/g++.dg/other/pr39496.C +++ b/gcc/testsuite/g++.dg/other/pr39496.C @@ -1,5 +1,5 @@ // PR target/39496 -// { dg-do compile { target { { i?86-*-linux* x86_64-*-linux* } && ia32 } } } +// { dg-do compile { target { { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } && ia32 } } } // { dg-options "-O0 -fverbose-asm -fno-omit-frame-pointer -mtune=i686 -msse2 -mfpmath=sse" } // Verify that {foo,bar}{,2}param are all passed on the stack, using diff --git a/gcc/testsuite/g++.dg/other/pr42685.C b/gcc/testsuite/g++.dg/other/pr42685.C index b8b1ad63b1..3c55955acc 100644 --- a/gcc/testsuite/g++.dg/other/pr42685.C +++ b/gcc/testsuite/g++.dg/other/pr42685.C @@ -1,5 +1,6 @@ // { dg-do compile } // { dg-options "-O -funroll-loops -fcompare-debug" } +// { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } void Remap(int n, int *src, int *dst, int *map) { diff --git a/gcc/testsuite/g++.dg/other/pr43631.C b/gcc/testsuite/g++.dg/other/pr43631.C new file mode 100644 index 0000000000..eb4f578618 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/pr43631.C @@ -0,0 +1,15 @@ +// PR middle-end/43631 +// { dg-do compile } +// { dg-options "-g -O2" } +// { dg-additional-options "-mtune=atom" { target i?86-*-* x86_64-*-* } } + +typedef void (*T) (); +struct S { T t; }; +void bar (T) __attribute__ ((__noreturn__)); +S *p; + +void +foo () +{ + try { bar (p->t); } catch (...) { throw 1; } +} diff --git a/gcc/testsuite/g++.dg/other/pr55650.C b/gcc/testsuite/g++.dg/other/pr55650.C new file mode 100644 index 0000000000..c565b06ef4 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/pr55650.C @@ -0,0 +1,22 @@ +// PR gcov-profile/55650 +// { dg-do link } +// { dg-require-profiling "-fprofile-generate" } +// { dg-options "-O2 -fprofile-generate" } +// { dg-additional-sources "pr55650.cc" } + +struct A +{ + virtual void foo (); +}; + +struct B : public A +{ + B (); + void foo () {} +}; + +inline A * +bar () +{ + return new B; +} diff --git a/gcc/testsuite/g++.dg/other/pr55650.cc b/gcc/testsuite/g++.dg/other/pr55650.cc new file mode 100644 index 0000000000..70b41462b5 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/pr55650.cc @@ -0,0 +1,4 @@ +int +main () +{ +} diff --git a/gcc/testsuite/g++.dg/other/pr59492.C b/gcc/testsuite/g++.dg/other/pr59492.C new file mode 100644 index 0000000000..84bd25554f --- /dev/null +++ b/gcc/testsuite/g++.dg/other/pr59492.C @@ -0,0 +1,18 @@ +// { dg-do assemble { target { { i?86-*-* x86_64-*-* } && fpic } } } +// { dg-options "-mx32 -fPIC" } +// { dg-require-ifunc "" } +// { dg-require-effective-target maybe_x32 } + +void +__throw_runtime_error(const char*) __attribute__((__noreturn__)); +unsigned int +__attribute__ ((target("rdrnd"))) +__x86_rdrand(void) +{ + unsigned int retries = 100; + unsigned int val; + while (__builtin_ia32_rdrand32_step(&val) == 0) + if (--retries == 0) + __throw_runtime_error(("random_device::__x86_rdrand(void)")); + return val; +} diff --git a/gcc/testsuite/g++.dg/other/pragma-ep-1.C b/gcc/testsuite/g++.dg/other/pragma-ep-1.C deleted file mode 100644 index 9362943a52..0000000000 --- a/gcc/testsuite/g++.dg/other/pragma-ep-1.C +++ /dev/null @@ -1,27 +0,0 @@ -/* { dg-do compile { target *-*-osf5* } } */ -/* { dg-final { scan-assembler "xyzzy_one" } } */ -/* { dg-final { scan-assembler "xyzzy_two" } } */ -/* { dg-final { scan-assembler "xyzzz_three" } } */ -/* { dg-final { scan-assembler "four" } } */ -/* { dg-final { scan-assembler-not "_four" } } */ - -#ifndef __PRAGMA_EXTERN_PREFIX -#error -#endif - -#pragma extern_prefix "xyzzy_" - -extern "C" int one(void); -extern "C" int two(void); - -#pragma extern_prefix "xyzzz_" - -extern "C" int three(void); - -#pragma extern_prefix "" - -extern "C" int four(void); - -int (*p[])(void) = { - one, two, three, four -}; diff --git a/gcc/testsuite/g++.dg/other/ptrmem10.C b/gcc/testsuite/g++.dg/other/ptrmem10.C index a17df7fb36..ff8c843411 100644 --- a/gcc/testsuite/g++.dg/other/ptrmem10.C +++ b/gcc/testsuite/g++.dg/other/ptrmem10.C @@ -3,7 +3,7 @@ template <class C, void (C::*M) ()> static -void foo(void *obj) // { dg-message "note" } +void foo(void *obj) { C *p = static_cast<C*>(obj); (p->*M)(); @@ -13,8 +13,7 @@ template <class C> static void bar(C *c, void (C::*m) ()) { - foo<C,m>((void *)c);// { dg-error "(not a valid template arg|pointer-to-member|no matching fun|could not convert)" } - // { dg-message "candidate" "candidate note" { target *-*-* } 16 } + foo<C,m>((void *)c);// { dg-error "(not a valid template arg|pointer-to-member|no matching fun|could not convert|constant)" } } struct S diff --git a/gcc/testsuite/g++.dg/other/ptrmem11.C b/gcc/testsuite/g++.dg/other/ptrmem11.C index e73164eef2..e18abddd67 100644 --- a/gcc/testsuite/g++.dg/other/ptrmem11.C +++ b/gcc/testsuite/g++.dg/other/ptrmem11.C @@ -5,7 +5,7 @@ struct A {}; template <int A::* p> int -foo(A* q) // { dg-message "note" } +foo(A* q) { return q->*p; } @@ -14,8 +14,7 @@ template <typename T> int bar(int T::* p) { - return foo<p>(0);// { dg-error "(not a valid template arg|no matching func|pointer-to-member|could not convert)" } - // { dg-message "candidate" "candidate note" { target *-*-* } 17 } + return foo<p>(0);// { dg-error "(not a valid template arg|no matching func|pointer-to-member|could not convert|constant)" } } int i = bar<A>(0); diff --git a/gcc/testsuite/g++.dg/other/redecl2.C b/gcc/testsuite/g++.dg/other/redecl2.C index 591c258b89..6c8913c1f0 100644 --- a/gcc/testsuite/g++.dg/other/redecl2.C +++ b/gcc/testsuite/g++.dg/other/redecl2.C @@ -7,5 +7,5 @@ struct S { virtual int foo() = 0; }; -int S::foo() { return 0; } // { dg-error "defined here" } +int S::foo() { return 0; } // { dg-message "defined here" } int S::foo() { return 0; } // { dg-error "redefinition" } diff --git a/gcc/testsuite/g++.dg/other/unused1.C b/gcc/testsuite/g++.dg/other/unused1.C index 2a3ca1be74..b28d69874f 100644 --- a/gcc/testsuite/g++.dg/other/unused1.C +++ b/gcc/testsuite/g++.dg/other/unused1.C @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-g" } */ -/* { dg-skip-if "" { { hppa*-*-hpux* *-*-solaris2.[56]* } && { ! hppa*64*-*-* } } { "*" } { "" } } */ +/* { dg-skip-if "" { { hppa*-*-hpux* *-*-solaris2.[56]* powerpc-ibm-aix* } && { ! hppa*64*-*-* } } { "*" } { "" } } */ /* Make sure we didn't eliminate casted types because we thought they were unused. */ diff --git a/gcc/testsuite/g++.dg/other/var_copy-1.C b/gcc/testsuite/g++.dg/other/var_copy-1.C index 2fc6b780e1..192af75821 100644 --- a/gcc/testsuite/g++.dg/other/var_copy-1.C +++ b/gcc/testsuite/g++.dg/other/var_copy-1.C @@ -1,5 +1,4 @@ -// { dg-options "-std=c++0x" } -// { dg-do compile } +// { dg-do compile { target c++11 } } // Test to allow for va_copy with C++0x standard. diff --git a/gcc/testsuite/g++.dg/other/vararg-4.C b/gcc/testsuite/g++.dg/other/vararg-4.C new file mode 100644 index 0000000000..e242cfceff --- /dev/null +++ b/gcc/testsuite/g++.dg/other/vararg-4.C @@ -0,0 +1,12 @@ +// PR c++/37404 + +typedef __builtin_va_list __gnuc_va_list; +typedef __gnuc_va_list va_list; + +template <class> struct S { static void foo () { } }; +template <class T, int N> +struct S<T [N]> { static void foo () { T(); } }; + +int main () { + S<va_list>::foo(); +} diff --git a/gcc/testsuite/g++.dg/other/vector-compare.C b/gcc/testsuite/g++.dg/other/vector-compare.C new file mode 100644 index 0000000000..03ff5fd725 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/vector-compare.C @@ -0,0 +1,36 @@ +/* { dg-do compile { target c++11 } } */ +/* { dg-options "-Wall" } */ + +// Check that we can compare vector types that really are the same through +// typedefs. + +typedef float v4f __attribute__((vector_size(4*sizeof(float)))); + +template <class T> void eat (T&&) {} + +template <class T, int n> +struct Vec +{ + typedef T type __attribute__((vector_size(4*sizeof(T)))); + + template <class U> + static void fun (type const& t, U& u) { eat (t > u); } +}; + +long long +f (v4f *x, v4f const *y) +{ + return ((*x < *y) | (*x <= *y))[2]; +} + +int main () +{ + v4f x = {0,1,2,3}; + Vec<const volatile float,4>::type f = {-1,5,2,3.1}; + auto c = (x == f) == (x >= x); + eat (c[3]); + Vec<const volatile float,4>::fun (f, x); + Vec<const volatile float,4>::fun (x, f); + Vec<const volatile float,4>::fun (f, f); + Vec<const volatile float,4>::fun (x, x); +} diff --git a/gcc/testsuite/g++.dg/other/warning1.C b/gcc/testsuite/g++.dg/other/warning1.C index c65ae0ff6e..a23d0ca6cb 100644 --- a/gcc/testsuite/g++.dg/other/warning1.C +++ b/gcc/testsuite/g++.dg/other/warning1.C @@ -7,8 +7,8 @@ extern "C" int printf(const char *, ...); struct S { - static const float inf = 1.0f / 0.0f; // { dg-warning "1.0|float|initializ" } - static const float nan = 0.0f / 0.0f; // { dg-warning "0.0|float|initializ" } + static const float inf = 1.0f / 0.0f; // { dg-error "1.0|float|initializ" } + static const float nan = 0.0f / 0.0f; // { dg-error "0.0|float|initializ" } }; int main() |