diff --git a/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute-2.c b/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute-2.c index e69de29bb2d..8eec6824f37 100644 --- a/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute-2.c +++ b/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute-2.c @@ -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 index e69de29bb2d..95f6a6803e8 100644 --- a/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute-3.c +++ b/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute-3.c @@ -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 index e69de29bb2d..eddcef3597c 100644 --- a/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute.c +++ b/gcc/testsuite/gcc.target/aarch64/simd_pcs_attribute.c @@ -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 } } */