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

Ville Voutilainen ville.voutilainen@gmail.com
Sun Sep 14 17:45:00 GMT 2014


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.
-------------- next part --------------
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, "");
 }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: var-templ-test-cleanup.changelog
Type: application/octet-stream
Size: 376 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140914/e0e6cdbd/attachment.obj>


More information about the Gcc-patches mailing list