Message ID | CAFk2RUYrrjZNGS9E8b+CwgDeEC56nfDqCpTKH0wiiaQ8qXiSXA@mail.gmail.com |
---|---|
State | New |
Headers | show |
Hi,
On 09/14/2014 07:44 PM, Ville Voutilainen wrote:
> Tested on Linux-x64.
Thanks. In such cases you can as well remove the main: then is also
immediately obvious the the testcase is a dg-do compile.
Paolo.
On 14 September 2014 21:36, Paolo Carlini <paolo.carlini@oracle.com> wrote: > Hi, > > On 09/14/2014 07:44 PM, Ville Voutilainen wrote: >> >> Tested on Linux-x64. > > Thanks. In such cases you can as well remove the main: then is also > immediately obvious the the testcase is a dg-do compile. Sure, but sometimes I use such test snippets as starting points for something more elaborate that gets actually run, it saves time having a main already there even if the test itself doesn't use it. ;)
Applied, thanks. Jason
diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ1.C b/gcc/testsuite/g++.dg/cpp1y/var-templ1.C index 856198a..89b3c8f 100644 --- a/gcc/testsuite/g++.dg/cpp1y/var-templ1.C +++ b/gcc/testsuite/g++.dg/cpp1y/var-templ1.C @@ -1,4 +1,4 @@ -// { dg-do run { target c++14 } } +// { dg-do compile { target c++14 } } template<int A, int B> struct S1 @@ -12,10 +12,7 @@ template<typename T> int main () { - int v = var<S1<199, 23>>/2; - return !( - var<S1<11, 100>> == v - && var<S1<50, 120>> == var<S1<150, var<S1<10, 10>>>> - && var<S1<53, 23>> != 222 - ); + static_assert(var<S1<11, 100>> == var<S1<199, 23>>/2 + && var<S1<50, 120>> == var<S1<150, var<S1<10, 10>>>> + && var<S1<53, 23>> != 222, ""); } diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ3.C b/gcc/testsuite/g++.dg/cpp1y/var-templ3.C index 52ef668..254f388 100644 --- a/gcc/testsuite/g++.dg/cpp1y/var-templ3.C +++ b/gcc/testsuite/g++.dg/cpp1y/var-templ3.C @@ -1,4 +1,4 @@ -// { dg-do run { target c++14 } } +// { dg-do compile { target c++14 } } template<typename T> constexpr int var = sizeof (T); @@ -12,7 +12,5 @@ template<typename T> int main () { - return !( - var<int> + var<char> == S1<int>::a<char> - ); + static_assert(var<int> + var<char> == S1<int>::a<char>, ""); } diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ4.C b/gcc/testsuite/g++.dg/cpp1y/var-templ4.C index 4ad7be6..3cd84a8 100644 --- a/gcc/testsuite/g++.dg/cpp1y/var-templ4.C +++ b/gcc/testsuite/g++.dg/cpp1y/var-templ4.C @@ -1,4 +1,4 @@ -// { dg-do run { target c++14 } } +// { dg-do compile { target c++14 } } template<typename T> constexpr int var = sizeof (T); @@ -8,8 +8,5 @@ template<> int main () { - return !( - var<int> == 100000 - && var<char> == sizeof(char) - ); + static_assert(var<int> == 100000 && var<char> == sizeof(char), ""); } diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ5.C b/gcc/testsuite/g++.dg/cpp1y/var-templ5.C index a10f388..a8bc7f6 100644 --- a/gcc/testsuite/g++.dg/cpp1y/var-templ5.C +++ b/gcc/testsuite/g++.dg/cpp1y/var-templ5.C @@ -1,4 +1,4 @@ -// { dg-do run { target c++14 } } +// { dg-do compile { target c++14 } } template<int A, int B> struct S1 @@ -15,7 +15,5 @@ template<template<int,int> class T, int A> int main () { - return !( - var2<S1, 40> == 120 - ); + static_assert(var2<S1, 40> == 120, ""); }