@@ -5853,6 +5853,20 @@ aarch64_preferred_simd_mode (enum machine_mode mode)
return word_mode;
}
+/* Implement TARGET_MANGLE_TYPE. */
+
+const char *
+aarch64_mangle_type (const_tree type)
+{
+ /* The AArch64 ABI documents say that "__va_list" has to be
+ managled as if it is in the "std" namespace. */
+ if (lang_hooks.types_compatible_p (CONST_CAST_TREE (type), va_list_type))
+ return "St9__va_list";
+
+ /* Use the default mangling. */
+ return NULL;
+}
+
/* Return the equivalent letter for size. */
static unsigned char
sizetochar (int size)
@@ -6778,6 +6792,9 @@ aarch64_c_mode_for_suffix (char suffix)
#undef TARGET_LIBGCC_CMP_RETURN_MODE
#define TARGET_LIBGCC_CMP_RETURN_MODE aarch64_libgcc_cmp_return_mode
+#undef TARGET_MANGLE_TYPE
+#define TARGET_MANGLE_TYPE aarch64_mangle_type
+
#undef TARGET_MEMORY_MOVE_COST
#define TARGET_MEMORY_MOVE_COST aarch64_memory_move_cost
@@ -1,9 +1,10 @@
-// { dg-do compile }
+// { dg-do compile { target { aarch64*-*-* arm*-*-* } } }
// { dg-options "-Wno-abi" }
-// { dg-require-effective-target arm_eabi }
+// { dg-require-effective-target arm_eabi { target arm*-*-* } }
// AAPCS \S 7.1.4 requires that va_list be a typedef for "struct
// __va_list". The mangling is as if it were "std::__va_list".
+// AAPCS64 \S 7.1.4 has the same requirement for AArch64 targets.
// #include <stdarg.h>
typedef __builtin_va_list va_list;