diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-07-03 11:40:08 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-07-03 11:40:08 +0000 |
commit | 6983fe1e36db7532af100486b526f4131926025b (patch) | |
tree | 92a4c336516c44b56768d1319d2fe84c13b85e98 /gcc/testsuite/g++.dg | |
parent | f33a0367d52b7cd93be9089eee3ccebb8b9e687d (diff) | |
download | gcc-6983fe1e36db7532af100486b526f4131926025b.tar.gz |
2013-07-03 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 200637 using svnmerge.py
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@200641 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/initlist73.C | 13 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/noexcept21.C | 87 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/udlit-nospace-neg.C | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp1y/complex_literals.h | 12 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp1y/udlit-enc-prefix-neg.C | 17 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp1y/udlit-userdef-string.C | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/pr57509.C | 16 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/simulate-thread/atomics-1.C | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/simulate-thread/atomics-2.C | 1 |
9 files changed, 158 insertions, 1 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist73.C b/gcc/testsuite/g++.dg/cpp0x/initlist73.C new file mode 100644 index 00000000000..de9748d8b90 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/initlist73.C @@ -0,0 +1,13 @@ +// PR c++/57682 +// { dg-do compile { target c++11 } } + +struct Class +{ + Class (int func) + try + : f { func } { } + catch ( ... ) { } + +private: + int f; +}; diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept21.C b/gcc/testsuite/g++.dg/cpp0x/noexcept21.C new file mode 100644 index 00000000000..ec88e1d3d87 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/noexcept21.C @@ -0,0 +1,87 @@ +// PR c++/57645 +// { dg-do compile { target c++11 } } + +struct Thrower +{ + ~Thrower() noexcept(false) { throw 1; } +}; + +struct ExplicitA +{ + ~ExplicitA() {} + + Thrower t; +}; + +struct ExplicitB +{ + ~ExplicitB(); + + Thrower t; +}; + +ExplicitB::~ExplicitB() {} + +struct ExplicitC +{ + ~ExplicitC() = default; + + Thrower t; +}; + +struct ExplicitD +{ + ~ExplicitD(); + + Thrower t; +}; + +ExplicitD::~ExplicitD() = default; + +struct NoThrower +{ + ~NoThrower() noexcept(true) {} +}; + +struct ExplicitE +{ + ~ExplicitE() {} + + NoThrower t; +}; + +struct ExplicitF +{ + ~ExplicitF(); + + NoThrower t; +}; + +ExplicitF::~ExplicitF() {} + +struct ExplicitG +{ + ~ExplicitG() = default; + + NoThrower t; +}; + +struct ExplicitH +{ + ~ExplicitH(); + + NoThrower t; +}; + +ExplicitH::~ExplicitH() = default; + +#define SA(X) static_assert(X, #X) + +SA( !noexcept(ExplicitA()) ); +SA( !noexcept(ExplicitB()) ); +SA( !noexcept(ExplicitC()) ); +SA( !noexcept(ExplicitD()) ); +SA( noexcept(ExplicitE()) ); +SA( noexcept(ExplicitF()) ); +SA( noexcept(ExplicitG()) ); +SA( noexcept(ExplicitH()) ); diff --git a/gcc/testsuite/g++.dg/cpp0x/udlit-nospace-neg.C b/gcc/testsuite/g++.dg/cpp0x/udlit-nospace-neg.C index 2b57637a916..f06bd8bdf02 100644 --- a/gcc/testsuite/g++.dg/cpp0x/udlit-nospace-neg.C +++ b/gcc/testsuite/g++.dg/cpp0x/udlit-nospace-neg.C @@ -1,3 +1,5 @@ // { dg-options "-std=c++0x" } -float operator ""_abc(const char*); // { dg-error "missing space between|and suffix identifier" } +float operator ""_abc(const char*); + +int operator""_def(long double); diff --git a/gcc/testsuite/g++.dg/cpp1y/complex_literals.h b/gcc/testsuite/g++.dg/cpp1y/complex_literals.h new file mode 100644 index 00000000000..ea328e39ecf --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/complex_literals.h @@ -0,0 +1,12 @@ + +#include <complex> + +#pragma GCC system_header + +std::complex<float> +operator""if(long double ximag) +{ return std::complex<float>(0.0F, static_cast<float>(ximag)); } + +std::complex<float> +operator""if(unsigned long long nimag) +{ return std::complex<float>(0.0F, static_cast<float>(nimag)); } diff --git a/gcc/testsuite/g++.dg/cpp1y/udlit-enc-prefix-neg.C b/gcc/testsuite/g++.dg/cpp1y/udlit-enc-prefix-neg.C new file mode 100644 index 00000000000..149fd0d162a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/udlit-enc-prefix-neg.C @@ -0,0 +1,17 @@ +// { dg-options -std=c++1y } + +int +operator L""_Ls(unsigned long long) // { dg-error "invalid encoding prefix in literal operator" } +{ return 0; } + +int +operator u""_s16(unsigned long long) // { dg-error "invalid encoding prefix in literal operator" } +{ return 0; } + +int +operator U""_s32(unsigned long long) // { dg-error "invalid encoding prefix in literal operator" } +{ return 0; } + +int +operator u8""_u8s(unsigned long long) // { dg-error "invalid encoding prefix in literal operator" } +{ return 0; } diff --git a/gcc/testsuite/g++.dg/cpp1y/udlit-userdef-string.C b/gcc/testsuite/g++.dg/cpp1y/udlit-userdef-string.C new file mode 100644 index 00000000000..e58a66bb63f --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/udlit-userdef-string.C @@ -0,0 +1,7 @@ +// { dg-options -std=c++1y } + +#include "complex_literals.h" + +auto cx = 1.1if; + +auto cn = 123if; diff --git a/gcc/testsuite/g++.dg/ext/pr57509.C b/gcc/testsuite/g++.dg/ext/pr57509.C new file mode 100644 index 00000000000..92aaadf3387 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/pr57509.C @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-std=c++11" } */ + +template <bool> struct enable_if {}; +template <> struct enable_if<true> {typedef void type;}; +template <class T> void f (T& v) { v = __builtin_shuffle (v, v); } +template <class T> void g (T const&) {} +template <class T> auto g (T const& x) -> typename enable_if<sizeof(__builtin_shuffle(x,x))!=2>::type {} +typedef int v4i __attribute__((vector_size(4*sizeof(int)))); +typedef float v4f __attribute__((vector_size(4*sizeof(float)))); +int main(){ + v4i a = {1,2,3,0}; + f(a); + v4f b = {1,2,3,0}; + g(b); +} diff --git a/gcc/testsuite/g++.dg/simulate-thread/atomics-1.C b/gcc/testsuite/g++.dg/simulate-thread/atomics-1.C index 7e0041ee382..91867ba46a0 100644 --- a/gcc/testsuite/g++.dg/simulate-thread/atomics-1.C +++ b/gcc/testsuite/g++.dg/simulate-thread/atomics-1.C @@ -1,6 +1,8 @@ /* { dg-do link } */ /* { dg-options "-std=c++0x" } */ /* { dg-final { simulate-thread } } */ +/* { dg-require-effective-target sync_char_short } */ +/* { dg-require-effective-target sync_int_long } */ /* Test that atomic int and atomic char work properly. */ diff --git a/gcc/testsuite/g++.dg/simulate-thread/atomics-2.C b/gcc/testsuite/g++.dg/simulate-thread/atomics-2.C index be3232d7087..601555bd236 100644 --- a/gcc/testsuite/g++.dg/simulate-thread/atomics-2.C +++ b/gcc/testsuite/g++.dg/simulate-thread/atomics-2.C @@ -1,6 +1,7 @@ /* { dg-do link } */ /* { dg-options "-std=c++0x" } */ /* { dg-final { simulate-thread } } */ +/* { dg-require-effective-target sync_int_long } */ using namespace std; |