public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] aarch64: fix gcc.target/aarch64/pcs_attribute-2.c on non-gnu targets
@ 2019-06-07 16:03 Szabolcs Nagy
  2019-06-17 15:55 ` Szabolcs Nagy
  2019-06-18 10:46 ` Richard Earnshaw (lists)
  0 siblings, 2 replies; 3+ messages in thread
From: Szabolcs Nagy @ 2019-06-07 16:03 UTC (permalink / raw)
  To: GCC Patches, James Greenhalgh; +Cc: nd

[-- Attachment #1: Type: text/plain, Size: 336 bytes --]

Move the ifunc symbol tests into a separate file with dg-require-ifunc.
And added a base pcs ifunc symbol to the test for completeness.

gcc/testsuite/ChangeLog:

2019-06-07  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* gcc.target/aarch64/pcs_attribute-2.c: Remove ifunc usage.
	* gcc.target/aarch64/pcs_attribute-3.c: New test.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: vpcsfix.diff --]
[-- Type: text/x-patch; name="vpcsfix.diff", Size: 3645 bytes --]

diff --git a/gcc/testsuite/gcc.target/aarch64/pcs_attribute-2.c b/gcc/testsuite/gcc.target/aarch64/pcs_attribute-2.c
index d997f52921c..e85465f25fb 100644
--- a/gcc/testsuite/gcc.target/aarch64/pcs_attribute-2.c
+++ b/gcc/testsuite/gcc.target/aarch64/pcs_attribute-2.c
@@ -53,21 +53,6 @@ ATTR void bar_def_vpcs (void)
 {
 }
 
-static void (*f_ifunc_resolver ()) (void)
-{
-  return (void (*)(void))f_local_vpcs;
-}
-
-__attribute__ ((ifunc ("f_ifunc_resolver")))
-ATTR void f_ifunc_vpcs (void);
-
-__attribute__ ((visibility ("hidden")))
-__attribute__ ((ifunc ("f_ifunc_resolver")))
-ATTR void f_hidden_ifunc_vpcs (void);
-
-__attribute__ ((ifunc ("f_ifunc_resolver")))
-ATTR static void f_local_ifunc_vpcs (void);
-
 void (*refs_basepcs[]) (void) = {
 	f_undef_basepcs,
 	f_def_basepcs,
@@ -86,9 +71,6 @@ void (*ATTR refs_vpcs[]) (void) = {
 	f_local_weakref_def_vpcs,
 	bar_undef_vpcs,
 	bar_def_vpcs,
-	f_ifunc_vpcs,
-	f_hidden_ifunc_vpcs,
-	f_local_ifunc_vpcs,
 };
 
 /* Note: local symbols don't need .variant_pcs, but gcc generates it, so
@@ -109,6 +91,3 @@ void (*ATTR refs_vpcs[]) (void) = {
 /* { dg-final { scan-assembler-times {\.variant_pcs\tf_local_weakref_def_vpcs} 1 } } */
 /* { dg-final { scan-assembler-times {\.variant_pcs\tf_undef_renamed_vpcs} 1 } } */
 /* { dg-final { scan-assembler-times {\.variant_pcs\tf_def_renamed_vpcs} 1 } } */
-/* { dg-final { scan-assembler-times {\.variant_pcs\tf_ifunc_vpcs} 1 } } */
-/* { dg-final { scan-assembler-times {\.variant_pcs\tf_hidden_ifunc_vpcs} 1 } } */
-/* { dg-final { scan-assembler-times {\.variant_pcs\tf_local_ifunc_vpcs} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/pcs_attribute-3.c b/gcc/testsuite/gcc.target/aarch64/pcs_attribute-3.c
new file mode 100644
index 00000000000..8e306af660f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/pcs_attribute-3.c
@@ -0,0 +1,58 @@
+/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
+/* { dg-require-effective-target aarch64_variant_pcs } */
+
+/* Test that .variant_pcs is emitted for vector PCS symbol references.  */
+
+#define ATTR __attribute__ ((aarch64_vector_pcs))
+
+static void f_local_basepcs (void)
+{
+}
+
+static void (*f_ifunc_basepcs_resolver ()) (void)
+{
+  return (void (*)(void))f_local_basepcs;
+}
+
+__attribute__ ((ifunc ("f_ifunc_basepcs_resolver")))
+void f_ifunc_basepcs (void);
+
+ATTR static void f_local_vpcs (void)
+{
+}
+
+static void (*f_ifunc_vpcs_resolver ()) (void)
+{
+  return (void (*)(void))f_local_vpcs;
+}
+
+__attribute__ ((ifunc ("f_ifunc_vpcs_resolver")))
+ATTR void f_ifunc_vpcs (void);
+
+__attribute__ ((visibility ("hidden")))
+__attribute__ ((ifunc ("f_ifunc_vpcs_resolver")))
+ATTR void f_hidden_ifunc_vpcs (void);
+
+__attribute__ ((ifunc ("f_ifunc_vpcs_resolver")))
+ATTR static void f_local_ifunc_vpcs (void);
+
+void (*refs_basepcs[]) (void) = {
+	f_ifunc_basepcs,
+};
+
+void (*ATTR refs_vpcs[]) (void) = {
+	f_ifunc_vpcs,
+	f_hidden_ifunc_vpcs,
+	f_local_ifunc_vpcs,
+};
+
+/* Note: local symbols don't need .variant_pcs, but gcc generates it, so
+   we check them here.  */
+
+/* { dg-final { scan-assembler-not {\.variant_pcs\tf_local_basepcs} } } */
+/* { dg-final { scan-assembler-not {\.variant_pcs\tf_ifunc_basepcs} } } */
+/* { dg-final { scan-assembler-times {\.variant_pcs\tf_local_vpcs} 1 } } */
+/* { dg-final { scan-assembler-times {\.variant_pcs\tf_ifunc_vpcs} 1 } } */
+/* { dg-final { scan-assembler-times {\.variant_pcs\tf_hidden_ifunc_vpcs} 1 } } */
+/* { dg-final { scan-assembler-times {\.variant_pcs\tf_local_ifunc_vpcs} 1 } } */

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] aarch64: fix gcc.target/aarch64/pcs_attribute-2.c on non-gnu targets
  2019-06-07 16:03 [PATCH] aarch64: fix gcc.target/aarch64/pcs_attribute-2.c on non-gnu targets Szabolcs Nagy
@ 2019-06-17 15:55 ` Szabolcs Nagy
  2019-06-18 10:46 ` Richard Earnshaw (lists)
  1 sibling, 0 replies; 3+ messages in thread
From: Szabolcs Nagy @ 2019-06-17 15:55 UTC (permalink / raw)
  To: GCC Patches, James Greenhalgh; +Cc: nd

On 07/06/2019 17:03, Szabolcs Nagy wrote:
> Move the ifunc symbol tests into a separate file with dg-require-ifunc.
> And added a base pcs ifunc symbol to the test for completeness.
> 
> gcc/testsuite/ChangeLog:
> 
> 2019-06-07  Szabolcs Nagy  <szabolcs.nagy@arm.com>
> 
> 	* gcc.target/aarch64/pcs_attribute-2.c: Remove ifunc usage.
> 	* gcc.target/aarch64/pcs_attribute-3.c: New test.
> 

ping.

this fixes a test issue.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] aarch64: fix gcc.target/aarch64/pcs_attribute-2.c on non-gnu targets
  2019-06-07 16:03 [PATCH] aarch64: fix gcc.target/aarch64/pcs_attribute-2.c on non-gnu targets Szabolcs Nagy
  2019-06-17 15:55 ` Szabolcs Nagy
@ 2019-06-18 10:46 ` Richard Earnshaw (lists)
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Earnshaw (lists) @ 2019-06-18 10:46 UTC (permalink / raw)
  To: Szabolcs Nagy, GCC Patches, James Greenhalgh; +Cc: nd

On 07/06/2019 17:03, Szabolcs Nagy wrote:
> Move the ifunc symbol tests into a separate file with dg-require-ifunc.
> And added a base pcs ifunc symbol to the test for completeness.
> 
> gcc/testsuite/ChangeLog:
> 
> 2019-06-07  Szabolcs Nagy  <szabolcs.nagy@arm.com>
> 
> 	* gcc.target/aarch64/pcs_attribute-2.c: Remove ifunc usage.
> 	* gcc.target/aarch64/pcs_attribute-3.c: New test.
> 
> 

OK.

R.

> vpcsfix.diff
> 
> diff --git a/gcc/testsuite/gcc.target/aarch64/pcs_attribute-2.c b/gcc/testsuite/gcc.target/aarch64/pcs_attribute-2.c
> index d997f52921c..e85465f25fb 100644
> --- a/gcc/testsuite/gcc.target/aarch64/pcs_attribute-2.c
> +++ b/gcc/testsuite/gcc.target/aarch64/pcs_attribute-2.c
> @@ -53,21 +53,6 @@ ATTR void bar_def_vpcs (void)
>  {
>  }
>  
> -static void (*f_ifunc_resolver ()) (void)
> -{
> -  return (void (*)(void))f_local_vpcs;
> -}
> -
> -__attribute__ ((ifunc ("f_ifunc_resolver")))
> -ATTR void f_ifunc_vpcs (void);
> -
> -__attribute__ ((visibility ("hidden")))
> -__attribute__ ((ifunc ("f_ifunc_resolver")))
> -ATTR void f_hidden_ifunc_vpcs (void);
> -
> -__attribute__ ((ifunc ("f_ifunc_resolver")))
> -ATTR static void f_local_ifunc_vpcs (void);
> -
>  void (*refs_basepcs[]) (void) = {
>  	f_undef_basepcs,
>  	f_def_basepcs,
> @@ -86,9 +71,6 @@ void (*ATTR refs_vpcs[]) (void) = {
>  	f_local_weakref_def_vpcs,
>  	bar_undef_vpcs,
>  	bar_def_vpcs,
> -	f_ifunc_vpcs,
> -	f_hidden_ifunc_vpcs,
> -	f_local_ifunc_vpcs,
>  };
>  
>  /* Note: local symbols don't need .variant_pcs, but gcc generates it, so
> @@ -109,6 +91,3 @@ void (*ATTR refs_vpcs[]) (void) = {
>  /* { dg-final { scan-assembler-times {\.variant_pcs\tf_local_weakref_def_vpcs} 1 } } */
>  /* { dg-final { scan-assembler-times {\.variant_pcs\tf_undef_renamed_vpcs} 1 } } */
>  /* { dg-final { scan-assembler-times {\.variant_pcs\tf_def_renamed_vpcs} 1 } } */
> -/* { dg-final { scan-assembler-times {\.variant_pcs\tf_ifunc_vpcs} 1 } } */
> -/* { dg-final { scan-assembler-times {\.variant_pcs\tf_hidden_ifunc_vpcs} 1 } } */
> -/* { dg-final { scan-assembler-times {\.variant_pcs\tf_local_ifunc_vpcs} 1 } } */
> diff --git a/gcc/testsuite/gcc.target/aarch64/pcs_attribute-3.c b/gcc/testsuite/gcc.target/aarch64/pcs_attribute-3.c
> new file mode 100644
> index 00000000000..8e306af660f
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/aarch64/pcs_attribute-3.c
> @@ -0,0 +1,58 @@
> +/* { dg-do compile } */
> +/* { dg-require-ifunc "" } */
> +/* { dg-require-effective-target aarch64_variant_pcs } */
> +
> +/* Test that .variant_pcs is emitted for vector PCS symbol references.  */
> +
> +#define ATTR __attribute__ ((aarch64_vector_pcs))
> +
> +static void f_local_basepcs (void)
> +{
> +}
> +
> +static void (*f_ifunc_basepcs_resolver ()) (void)
> +{
> +  return (void (*)(void))f_local_basepcs;
> +}
> +
> +__attribute__ ((ifunc ("f_ifunc_basepcs_resolver")))
> +void f_ifunc_basepcs (void);
> +
> +ATTR static void f_local_vpcs (void)
> +{
> +}
> +
> +static void (*f_ifunc_vpcs_resolver ()) (void)
> +{
> +  return (void (*)(void))f_local_vpcs;
> +}
> +
> +__attribute__ ((ifunc ("f_ifunc_vpcs_resolver")))
> +ATTR void f_ifunc_vpcs (void);
> +
> +__attribute__ ((visibility ("hidden")))
> +__attribute__ ((ifunc ("f_ifunc_vpcs_resolver")))
> +ATTR void f_hidden_ifunc_vpcs (void);
> +
> +__attribute__ ((ifunc ("f_ifunc_vpcs_resolver")))
> +ATTR static void f_local_ifunc_vpcs (void);
> +
> +void (*refs_basepcs[]) (void) = {
> +	f_ifunc_basepcs,
> +};
> +
> +void (*ATTR refs_vpcs[]) (void) = {
> +	f_ifunc_vpcs,
> +	f_hidden_ifunc_vpcs,
> +	f_local_ifunc_vpcs,
> +};
> +
> +/* Note: local symbols don't need .variant_pcs, but gcc generates it, so
> +   we check them here.  */
> +
> +/* { dg-final { scan-assembler-not {\.variant_pcs\tf_local_basepcs} } } */
> +/* { dg-final { scan-assembler-not {\.variant_pcs\tf_ifunc_basepcs} } } */
> +/* { dg-final { scan-assembler-times {\.variant_pcs\tf_local_vpcs} 1 } } */
> +/* { dg-final { scan-assembler-times {\.variant_pcs\tf_ifunc_vpcs} 1 } } */
> +/* { dg-final { scan-assembler-times {\.variant_pcs\tf_hidden_ifunc_vpcs} 1 } } */
> +/* { dg-final { scan-assembler-times {\.variant_pcs\tf_local_ifunc_vpcs} 1 } } */
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-18 10:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-07 16:03 [PATCH] aarch64: fix gcc.target/aarch64/pcs_attribute-2.c on non-gnu targets Szabolcs Nagy
2019-06-17 15:55 ` Szabolcs Nagy
2019-06-18 10:46 ` Richard Earnshaw (lists)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).