Blame SOURCES/gcc9-add-sve-tests.patch

02b0fd
These tests are missing from the r273140 commit in gcc-9-branch.
02b0fd
02b0fd
--- /dev/null
02b0fd
+++ gcc/testsuite/gcc.target/aarch64/pcs_attribute-2.c
02b0fd
@@ -0,0 +1,93 @@
02b0fd
+/* { dg-do compile } */
02b0fd
+/* { dg-require-effective-target aarch64_variant_pcs } */
02b0fd
+
02b0fd
+/* Test that .variant_pcs is emitted for vector PCS symbol references.  */
02b0fd
+
02b0fd
+#define ATTR __attribute__ ((aarch64_vector_pcs))
02b0fd
+
02b0fd
+void f_undef_basepcs (void);
02b0fd
+
02b0fd
+void f_def_basepcs (void)
02b0fd
+{
02b0fd
+}
02b0fd
+
02b0fd
+ATTR void f_undef_vpcs (void);
02b0fd
+
02b0fd
+ATTR void f_def_vpcs (void)
02b0fd
+{
02b0fd
+}
02b0fd
+
02b0fd
+__attribute__ ((alias ("f_def_vpcs")))
02b0fd
+ATTR void f_alias_vpcs (void);
02b0fd
+
02b0fd
+__attribute__ ((weak, alias ("f_def_vpcs")))
02b0fd
+ATTR void f_weak_alias_vpcs (void);
02b0fd
+
02b0fd
+__attribute__ ((weak))
02b0fd
+ATTR void f_weak_undef_vpcs (void);
02b0fd
+
02b0fd
+__attribute__ ((visibility ("protected")))
02b0fd
+ATTR void f_protected_vpcs (void)
02b0fd
+{
02b0fd
+}
02b0fd
+
02b0fd
+__attribute__ ((visibility ("hidden")))
02b0fd
+ATTR void f_hidden_vpcs (void)
02b0fd
+{
02b0fd
+}
02b0fd
+
02b0fd
+ATTR static void f_local_vpcs (void)
02b0fd
+{
02b0fd
+}
02b0fd
+
02b0fd
+__attribute__((weakref ("f_undef_vpcs")))
02b0fd
+ATTR static void f_local_weakref_undef_vpcs (void);
02b0fd
+
02b0fd
+__attribute__((weakref ("f_hidden_vpcs")))
02b0fd
+ATTR static void f_local_weakref_def_vpcs (void);
02b0fd
+
02b0fd
+ATTR void bar_undef_vpcs (void) __asm__ ("f_undef_renamed_vpcs");
02b0fd
+
02b0fd
+ATTR void bar_def_vpcs (void) __asm__ ("f_def_renamed_vpcs");
02b0fd
+ATTR void bar_def_vpcs (void)
02b0fd
+{
02b0fd
+}
02b0fd
+
02b0fd
+void (*refs_basepcs[]) (void) = {
02b0fd
+	f_undef_basepcs,
02b0fd
+	f_def_basepcs,
02b0fd
+};
02b0fd
+
02b0fd
+void (*ATTR refs_vpcs[]) (void) = {
02b0fd
+	f_undef_vpcs,
02b0fd
+	f_def_vpcs,
02b0fd
+	f_alias_vpcs,
02b0fd
+	f_weak_alias_vpcs,
02b0fd
+	f_weak_undef_vpcs,
02b0fd
+	f_protected_vpcs,
02b0fd
+	f_hidden_vpcs,
02b0fd
+	f_local_vpcs,
02b0fd
+	f_local_weakref_undef_vpcs,
02b0fd
+	f_local_weakref_def_vpcs,
02b0fd
+	bar_undef_vpcs,
02b0fd
+	bar_def_vpcs,
02b0fd
+};
02b0fd
+
02b0fd
+/* Note: local symbols don't need .variant_pcs, but gcc generates it, so
02b0fd
+   we check them here.  An undefined weakref does not show up in the
02b0fd
+   symbol table, only the target symbol, so it does not need .variant_pcs.  */
02b0fd
+
02b0fd
+/* { dg-final { scan-assembler-not {\.variant_pcs\tf_undef_basepcs} } } */
02b0fd
+/* { dg-final { scan-assembler-not {\.variant_pcs\tf_def_basepcs} } } */
02b0fd
+/* { dg-final { scan-assembler-times {\.variant_pcs\tf_undef_vpcs} 1 } } */
02b0fd
+/* { dg-final { scan-assembler-times {\.variant_pcs\tf_def_vpcs} 1 } } */
02b0fd
+/* { dg-final { scan-assembler-times {\.variant_pcs\tf_alias_vpcs} 1 } } */
02b0fd
+/* { dg-final { scan-assembler-times {\.variant_pcs\tf_weak_alias_vpcs} 1 } } */
02b0fd
+/* { dg-final { scan-assembler-times {\.variant_pcs\tf_weak_undef_vpcs} 1 } } */
02b0fd
+/* { dg-final { scan-assembler-times {\.variant_pcs\tf_protected_vpcs} 1 } } */
02b0fd
+/* { dg-final { scan-assembler-times {\.variant_pcs\tf_hidden_vpcs} 1 } } */
02b0fd
+/* { dg-final { scan-assembler-times {\.variant_pcs\tf_local_vpcs} 1 } } */
02b0fd
+/* { dg-final { scan-assembler-not {\.variant_pcs\tf_local_weakref_undef_vpcs} } } */
02b0fd
+/* { dg-final { scan-assembler-times {\.variant_pcs\tf_local_weakref_def_vpcs} 1 } } */
02b0fd
+/* { dg-final { scan-assembler-times {\.variant_pcs\tf_undef_renamed_vpcs} 1 } } */
02b0fd
+/* { dg-final { scan-assembler-times {\.variant_pcs\tf_def_renamed_vpcs} 1 } } */
02b0fd
--- /dev/null
02b0fd
+++ gcc/testsuite/gcc.target/aarch64/pcs_attribute-3.c
02b0fd
@@ -0,0 +1,58 @@
02b0fd
+/* { dg-do compile } */
02b0fd
+/* { dg-require-ifunc "" } */
02b0fd
+/* { dg-require-effective-target aarch64_variant_pcs } */
02b0fd
+
02b0fd
+/* Test that .variant_pcs is emitted for vector PCS symbol references.  */
02b0fd
+
02b0fd
+#define ATTR __attribute__ ((aarch64_vector_pcs))
02b0fd
+
02b0fd
+static void f_local_basepcs (void)
02b0fd
+{
02b0fd
+}
02b0fd
+
02b0fd
+static void (*f_ifunc_basepcs_resolver ()) (void)
02b0fd
+{
02b0fd
+  return (void (*)(void))f_local_basepcs;
02b0fd
+}
02b0fd
+
02b0fd
+__attribute__ ((ifunc ("f_ifunc_basepcs_resolver")))
02b0fd
+void f_ifunc_basepcs (void);
02b0fd
+
02b0fd
+ATTR static void f_local_vpcs (void)
02b0fd
+{
02b0fd
+}
02b0fd
+
02b0fd
+static void (*f_ifunc_vpcs_resolver ()) (void)
02b0fd
+{
02b0fd
+  return (void (*)(void))f_local_vpcs;
02b0fd
+}
02b0fd
+
02b0fd
+__attribute__ ((ifunc ("f_ifunc_vpcs_resolver")))
02b0fd
+ATTR void f_ifunc_vpcs (void);
02b0fd
+
02b0fd
+__attribute__ ((visibility ("hidden")))
02b0fd
+__attribute__ ((ifunc ("f_ifunc_vpcs_resolver")))
02b0fd
+ATTR void f_hidden_ifunc_vpcs (void);
02b0fd
+
02b0fd
+__attribute__ ((ifunc ("f_ifunc_vpcs_resolver")))
02b0fd
+ATTR static void f_local_ifunc_vpcs (void);
02b0fd
+
02b0fd
+void (*refs_basepcs[]) (void) = {
02b0fd
+	f_ifunc_basepcs,
02b0fd
+};
02b0fd
+
02b0fd
+void (*ATTR refs_vpcs[]) (void) = {
02b0fd
+	f_ifunc_vpcs,
02b0fd
+	f_hidden_ifunc_vpcs,
02b0fd
+	f_local_ifunc_vpcs,
02b0fd
+};
02b0fd
+
02b0fd
+/* Note: local symbols don't need .variant_pcs, but gcc generates it, so
02b0fd
+   we check them here.  */
02b0fd
+
02b0fd
+/* { dg-final { scan-assembler-not {\.variant_pcs\tf_local_basepcs} } } */
02b0fd
+/* { dg-final { scan-assembler-not {\.variant_pcs\tf_ifunc_basepcs} } } */
02b0fd
+/* { dg-final { scan-assembler-times {\.variant_pcs\tf_local_vpcs} 1 } } */
02b0fd
+/* { dg-final { scan-assembler-times {\.variant_pcs\tf_ifunc_vpcs} 1 } } */
02b0fd
+/* { dg-final { scan-assembler-times {\.variant_pcs\tf_hidden_ifunc_vpcs} 1 } } */
02b0fd
+/* { dg-final { scan-assembler-times {\.variant_pcs\tf_local_ifunc_vpcs} 1 } } */