diff options
author | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-02-18 00:07:08 +0000 |
---|---|---|
committer | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-02-18 00:07:08 +0000 |
commit | 3df08290a6d569ae3aedcb6c77ff73f89f420330 (patch) | |
tree | 54534f78980e1831bc5c797daa3cc849ff55be31 /gcc/testsuite/g++.dg | |
parent | 8cd21199dc17f279496b1fcde9c7dbe71271dc7b (diff) |
Merge from mainline
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/dataflow-branch@111216 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg')
-rw-r--r-- | gcc/testsuite/g++.dg/eh/cond3.C | 10 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/expr/stdarg2.C | 30 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/opt/pr26179.C | 22 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/opt/temp1.C | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/other/virtual1.C | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/other/virtual2.C | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/ttp15.C | 21 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/ttp16.C | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/ttp17.C | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/tree-ssa/pr18178.C | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/tree-ssa/pr26140.C | 15 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/warn/Wdiv-by-zero.C | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/warn/Wno-div-by-zero.C | 8 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/warn/no-write-strings.C | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/warn/write-strings-default.C | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/warn/write-strings.C | 7 |
16 files changed, 166 insertions, 4 deletions
diff --git a/gcc/testsuite/g++.dg/eh/cond3.C b/gcc/testsuite/g++.dg/eh/cond3.C new file mode 100644 index 00000000000..0af4ecdad96 --- /dev/null +++ b/gcc/testsuite/g++.dg/eh/cond3.C @@ -0,0 +1,10 @@ +// PR c++/24996 +// Bug: the cleanup for the A temporary was confusing the gimplifier +// because of the TRY_CATCH_EXPR for the exception object. + +struct A { A(int); ~A(); }; +struct B { B(A); ~B(); }; +void foo(bool b) +{ + throw b ? B(1) : B(1); +} diff --git a/gcc/testsuite/g++.dg/expr/stdarg2.C b/gcc/testsuite/g++.dg/expr/stdarg2.C new file mode 100644 index 00000000000..cf2eabcb161 --- /dev/null +++ b/gcc/testsuite/g++.dg/expr/stdarg2.C @@ -0,0 +1,30 @@ +// PR target/26141 + +#include <stdarg.h> + +struct S +{ + double a; +}; + +void +foo (int z, ...) +{ + struct S arg; + va_list ap; + arg = va_arg (ap, struct S); +} + + +struct T +{ + __complex__ float a; +}; + +void +bar (int z, ...) +{ + struct T arg; + va_list ap; + arg = va_arg (ap, struct T); +} diff --git a/gcc/testsuite/g++.dg/opt/pr26179.C b/gcc/testsuite/g++.dg/opt/pr26179.C new file mode 100644 index 00000000000..32cd7a00ea9 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr26179.C @@ -0,0 +1,22 @@ +/* The problem here is that Load PRE on the tree level + forgot to handle RETURN_DECL which causes us to ICE. */ + +// { dg-do compile } +// { dg-options "-O2" } + +struct a +{ + int i; +}; +void h(struct a&); +void l(void); + +struct a g(void) +{ + struct a fl; + h(fl); + if (fl.i) + l(); + fl.i+=2; + return fl; +} diff --git a/gcc/testsuite/g++.dg/opt/temp1.C b/gcc/testsuite/g++.dg/opt/temp1.C index 6b0e2f3906d..b822dc464fe 100644 --- a/gcc/testsuite/g++.dg/opt/temp1.C +++ b/gcc/testsuite/g++.dg/opt/temp1.C @@ -1,6 +1,6 @@ // PR c++/16405 // { dg-options "-O2" } -// { dg-do run { xfail *-*-* } } +// { dg-do run } // There should be exactly one temporary generated for the code in "f" // below when optimizing -- for the result of "b + c". We have no diff --git a/gcc/testsuite/g++.dg/other/virtual1.C b/gcc/testsuite/g++.dg/other/virtual1.C new file mode 100644 index 00000000000..5f44fa78ab2 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/virtual1.C @@ -0,0 +1,7 @@ +// PR c++/26070 +// { dg-do compile } + +struct A +{ + virtual static int i; // { dg-error "virtual" } +}; diff --git a/gcc/testsuite/g++.dg/other/virtual2.C b/gcc/testsuite/g++.dg/other/virtual2.C new file mode 100644 index 00000000000..f007403dfdc --- /dev/null +++ b/gcc/testsuite/g++.dg/other/virtual2.C @@ -0,0 +1,7 @@ +// PR c++/26071 +// { dg-do compile } + +struct A +{ + virtual static ~A(); // { dg-error "virtual" } +}; diff --git a/gcc/testsuite/g++.dg/template/ttp15.C b/gcc/testsuite/g++.dg/template/ttp15.C new file mode 100644 index 00000000000..5bb285eb556 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/ttp15.C @@ -0,0 +1,21 @@ +struct Dense { + static const unsigned int dim = 1; +}; + +template <template <typename> class View, + typename Block> +void operator+(float, View<Block> const&); + +template <typename Block, + unsigned int Dim = Block::dim> +struct Lvalue_proxy { + operator float() const; +}; + +void +test_1d (void) +{ + Lvalue_proxy<Dense> p; + float b; + b + p; +} diff --git a/gcc/testsuite/g++.dg/template/ttp16.C b/gcc/testsuite/g++.dg/template/ttp16.C new file mode 100644 index 00000000000..c556c7d98a4 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/ttp16.C @@ -0,0 +1,7 @@ +template <template <typename> class C> +void f() {} + +template <typename T, typename U = int> +struct S {}; + +template void f<S>(); // { dg-error "match" } diff --git a/gcc/testsuite/g++.dg/template/ttp17.C b/gcc/testsuite/g++.dg/template/ttp17.C new file mode 100644 index 00000000000..f1ddeb12ef3 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/ttp17.C @@ -0,0 +1,7 @@ +template <template <typename> class C> +void f(C<double>) {} + +template <typename T, typename U = int> +struct S {}; + +template void f(S<double>); // { dg-error "match" } diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr18178.C b/gcc/testsuite/g++.dg/tree-ssa/pr18178.C index 430a625f75d..9223e8323c0 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/pr18178.C +++ b/gcc/testsuite/g++.dg/tree-ssa/pr18178.C @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-vrp" } */ +/* { dg-options "-O2 -fdump-tree-vrp1" } */ // Define this to see it work. // #define WORK_WORK_WORK @@ -43,5 +43,5 @@ void doit (array *a) /* VRP should remove all but 1 if() in the loop. */ -/* { dg-final { scan-tree-dump-times "if " 1 "vrp"} } */ -/* { dg-final { cleanup-tree-dump "vrp" } } */ +/* { dg-final { scan-tree-dump-times "if " 1 "vrp1"} } */ +/* { dg-final { cleanup-tree-dump "vrp1" } } */ diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr26140.C b/gcc/testsuite/g++.dg/tree-ssa/pr26140.C new file mode 100644 index 00000000000..3e3743fbdbe --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-ssa/pr26140.C @@ -0,0 +1,15 @@ +/* { dg-do compile } */ + +struct Pitch +{ + int notename_; +}; +struct Audio_note +{ + Audio_note (Pitch p); +}; +void create_audio_elements () +{ + Pitch *pit; + new Audio_note (*pit); +} diff --git a/gcc/testsuite/g++.dg/warn/Wdiv-by-zero.C b/gcc/testsuite/g++.dg/warn/Wdiv-by-zero.C new file mode 100644 index 00000000000..7dc77667c22 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wdiv-by-zero.C @@ -0,0 +1,7 @@ +// test that division by zero warnings are enabled by default +int breakme() +{ + int x = 0; + x /= 0; // { dg-warning "division by" } + return x; +} diff --git a/gcc/testsuite/g++.dg/warn/Wno-div-by-zero.C b/gcc/testsuite/g++.dg/warn/Wno-div-by-zero.C new file mode 100644 index 00000000000..937628ee924 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wno-div-by-zero.C @@ -0,0 +1,8 @@ +// { dg-options "-Wno-div-by-zero" } + +int breakme() +{ + int x = 0; + x /= 0; + return x; +} diff --git a/gcc/testsuite/g++.dg/warn/no-write-strings.C b/gcc/testsuite/g++.dg/warn/no-write-strings.C new file mode 100644 index 00000000000..c5d48de37aa --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/no-write-strings.C @@ -0,0 +1,7 @@ +// { dg-do compile } +// { dg-options -Wno-write-strings } + +int main() +{ + char* p = "Asgaard"; +} diff --git a/gcc/testsuite/g++.dg/warn/write-strings-default.C b/gcc/testsuite/g++.dg/warn/write-strings-default.C new file mode 100644 index 00000000000..234c473801b --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/write-strings-default.C @@ -0,0 +1,7 @@ +// { dg-do compile } +// Test the default for -Wwrite-strings + +int main() +{ + char* p = "Asgaard"; // { dg-warning "warning:.*deprecated.*" } +} diff --git a/gcc/testsuite/g++.dg/warn/write-strings.C b/gcc/testsuite/g++.dg/warn/write-strings.C new file mode 100644 index 00000000000..38233e0e1d9 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/write-strings.C @@ -0,0 +1,7 @@ +// { dg-do compile } +// { dg-options -Wwrite-strings } + +int main() +{ + char* p = "Asgaard"; // { dg-warning "warning:.*deprecated.*" } +} |