simd_pcs_attribute.c: New test.
authorSteve Ellcey <sellcey@marvell.com>
Fri, 2 Aug 2019 16:04:14 +0000 (16:04 +0000)
committerSteve Ellcey <sje@gcc.gnu.org>
Fri, 2 Aug 2019 16:04:14 +0000 (16:04 +0000)
2019-08-02  Steve Ellcey  <sellcey@marvell.com>

* gcc.target/aarch64/simd_pcs_attribute.c: New test.
* gcc.target/aarch64/simd_pcs_attribute-2.c: Ditto.
* gcc.target/aarch64/simd_pcs_attribute-3.c: Ditto.

From-SVN: r274020

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute.c [new file with mode: 0644]

index 45d941d7e6e54b940a06f378373bd7275dbe22d6..5d04531f6996d5b7317868158f48135fa4476b12 100644 (file)
@@ -1,3 +1,9 @@
+2019-08-02  Steve Ellcey  <sellcey@marvell.com>
+
+       * gcc.target/aarch64/simd_pcs_attribute.c: New test.
+       * gcc.target/aarch64/simd_pcs_attribute-2.c: Ditto.
+       * gcc.target/aarch64/simd_pcs_attribute-3.c: Ditto.
+
 2019-08-02  Uroš Bizjak  <ubizjak@gmail.com>
 
        PR target/91201
diff --git a/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute-2.c b/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute-2.c
new file mode 100644 (file)
index 0000000..8eec682
--- /dev/null
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-Ofast" } */
+
+__attribute__ ((__simd__ ("notinbranch")))
+__attribute__ ((__nothrow__ , __leaf__ , __const__))
+extern double foo (double x);
+
+void bar(double * f, int n)
+{
+       int i;
+       for (i = 0; i < n; i++)
+               f[i] = foo(f[i]);
+}
+
+/* { dg-final { scan-assembler-not {\.variant_pcs\tfoo} } } */
+/* { dg-final { scan-assembler-times {\.variant_pcs\t_ZGVnN2v_foo} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute-3.c b/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute-3.c
new file mode 100644 (file)
index 0000000..95f6a68
--- /dev/null
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-Ofast" } */
+
+__attribute__ ((__simd__))
+__attribute__ ((__nothrow__ , __leaf__ , __const__))
+double foo (double x);
+
+void bar(double *f, int n)
+{
+       int i;
+       for (i = 0; i < n; i++)
+               f[i] = foo(f[i]);
+}
+
+double foo(double x)
+{
+       return x * x / 3.0;
+}
+
+/* { dg-final { scan-assembler-not {\.variant_pcs\tfoo} } } */
+/* { dg-final { scan-assembler-times {\.variant_pcs\t_ZGVnM1v_foo} 1 } } */
+/* { dg-final { scan-assembler-times {\.variant_pcs\t_ZGVnM2v_foo} 1 } } */
+/* { dg-final { scan-assembler-times {\.variant_pcs\t_ZGVnN1v_foo} 1 } } */
+/* { dg-final { scan-assembler-times {\.variant_pcs\t_ZGVnN2v_foo} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute.c b/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute.c
new file mode 100644 (file)
index 0000000..eddcef3
--- /dev/null
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-Ofast" } */
+
+__attribute__ ((__simd__ ("notinbranch")))
+__attribute__ ((__nothrow__ , __leaf__ , __const__))
+extern double log (double __x);
+
+void foo(double *f, int n)
+{
+       int i;
+       for (i = 0; i < n; i++)
+               f[i] = log(f[i]);
+}
+
+/* { dg-final { scan-assembler-not {\.variant_pcs\tlog} } } */
+/* { dg-final { scan-assembler-times {\.variant_pcs\t_ZGVnN2v_log} 1 } } */