builtins-1-p9-runnable.c: Forgot to add new file before doing commit 250051.
authorCarl Love <carll@gcc.gnu.org>
Fri, 7 Jul 2017 16:20:52 +0000 (16:20 +0000)
committerCarl Love <carll@gcc.gnu.org>
Fri, 7 Jul 2017 16:20:52 +0000 (16:20 +0000)
gcc/testsuite/ChangeLog:

2017-07-07  Carl Love  <cel@us.ibm.com>

* gcc.target/powerpc/builtins-1-p9-runnable.c: Forgot to add new
file before doing commit 250051.

From-SVN: r250052

gcc/testsuite/gcc.target/powerpc/builtins-1-p9-runnable.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-1-p9-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-1-p9-runnable.c
new file mode 100644 (file)
index 0000000..790f64c
--- /dev/null
@@ -0,0 +1,26 @@
+/* { dg-do run { target { powerpc*-*-linux* } } } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-options "-O2 -mcpu=power9" } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
+
+#include <altivec.h>
+
+void abort (void);
+
+int main() {
+  int i;
+  vector float vfa, vfb;
+  vector unsigned short vur, vuexpt;
+
+  vfa = (vector float){3.4, 5.0, 20.0, 50.9 };
+  vfb = (vector float){10.0, 40.0, 70.0, 100.0 };
+  vuexpt = (vector unsigned short){ 3, 5, 20, 50,
+                                    10, 40, 70, 100};
+
+  vur = vec_pack_to_short_fp32 (vfa, vfb);
+
+  for(i = 0; i< 8; i++) {
+    if (vur[i] != vuexpt[i])
+      abort();
+  }
+}