re PR c++/68180 ([ICE] at cp/constexpr.c:2768 in initializing __vector in a loop)
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 17 Nov 2016 09:59:07 +0000 (09:59 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 17 Nov 2016 09:59:07 +0000 (09:59 +0000)
2016-11-17  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/68180
* g++.dg/cpp1y/pr68180.C: New.

From-SVN: r242541

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/pr68180.C [new file with mode: 0644]

index 7928a49186bd1929c2b06dc92e4a4eb111476956..0a0a1b57e20e181a835bc17200dd5cfb7e7a0c1d 100644 (file)
@@ -1,3 +1,8 @@
+2016-11-17  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/68180
+       * g++.dg/cpp1y/pr68180.C: New.
+
 2016-11-17  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
 
        PR tree-optimization/78319
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr68180.C b/gcc/testsuite/g++.dg/cpp1y/pr68180.C
new file mode 100644 (file)
index 0000000..acecff4
--- /dev/null
@@ -0,0 +1,15 @@
+// PR c++/68180
+// { dg-do compile { target c++14 } }
+
+typedef float __attribute__( ( vector_size( 16 ) ) ) float32x4_t;
+constexpr float32x4_t fill(float x) {
+  float32x4_t v{0};
+  constexpr auto vs = sizeof(v)/sizeof(v[0]);
+  for (auto i=0U; i<vs; ++i) v[i]=i;
+  return v+x;
+}
+
+float32x4_t foo(float32x4_t x) {
+  constexpr float32x4_t v = fill(1.f); // { dg-error "not a constant" }
+  return x+v;
+}