diff mbox

[C++14] Minor cleanup, don't run tests for which compilation is enough.

Message ID CAFk2RUYrrjZNGS9E8b+CwgDeEC56nfDqCpTKH0wiiaQ8qXiSXA@mail.gmail.com
State New
Headers show

Commit Message

Ville Voutilainen Sept. 14, 2014, 5:44 p.m. UTC
Tested on Linux-x64.

/testsuite
2014-09-14  Ville Voutilainen  <ville.voutilainen@gmail.com>

    Minor cleanup, don't run tests for which compilation is enough.
    * g++.dg/g++.dg/cpp1y/var-templ1.C: Change return to
static_assert, compile instead of running.
    * g++.dg/g++.dg/cpp1y/var-templ3.C: Likewise.
    * g++.dg/g++.dg/cpp1y/var-templ4.C: Likewise.
    * g++.dg/g++.dg/cpp1y/var-templ5.C: Likewise.

Comments

Paolo Carlini Sept. 14, 2014, 6:36 p.m. UTC | #1
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.
Ville Voutilainen Sept. 14, 2014, 6:51 p.m. UTC | #2
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. ;)
Jason Merrill Sept. 17, 2014, 5:34 p.m. UTC | #3
Applied, thanks.

Jason
diff mbox

Patch

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, "");
 }