From: Carl Love Date: Fri, 7 Jul 2017 16:20:52 +0000 (+0000) Subject: builtins-1-p9-runnable.c: Forgot to add new file before doing commit 250051. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=13bd548e161528218d523a6cdc46fd9f9b97e98e;p=gcc.git builtins-1-p9-runnable.c: Forgot to add new file before doing commit 250051. gcc/testsuite/ChangeLog: 2017-07-07 Carl Love * gcc.target/powerpc/builtins-1-p9-runnable.c: Forgot to add new file before doing commit 250051. From-SVN: r250052 --- 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 index 00000000000..790f64c7519 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/builtins-1-p9-runnable.c @@ -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 + +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(); + } +}