From 29f116546d381aec8ee7b07a3196b590881d2ba4 Mon Sep 17 00:00:00 2001
From: Iain Sandoe <iain@sandoe.co.uk>
Date: Fri, 4 Sep 2020 13:14:58 -0700
Subject: [PATCH] testsuite, Darwin, Arm64 : Fixup tests where the output is
 different.

It's to be expected that the output from scan assembler tests will
vary for Darwin - since the object format, assembler syntax and ABI
all have differences from ELF/AAPCS64.

(cherry picked from commit d84274d8e8ee6223b123e70a0d885210057a3880)
Signed-off-by: Kirill A. Korinsky <kirill@korins.ky>
---
 gcc/testsuite/g++.dg/abi/aarch64_guard1.C | 3 ++-
 gcc/testsuite/g++.dg/abi/arm_va_list.C    | 6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git gcc/testsuite/g++.dg/abi/aarch64_guard1.C gcc/testsuite/g++.dg/abi/aarch64_guard1.C
index e2669a89fbf..715750ae019 100644
--- gcc/testsuite/g++.dg/abi/aarch64_guard1.C
+++ gcc/testsuite/g++.dg/abi/aarch64_guard1.C
@@ -12,5 +12,6 @@ int *foo ()
   return &x;
 }
 
-// { dg-final { scan-assembler _ZGVZ3foovE1x,8,8 } }
+// { dg-final { scan-assembler _ZGVZ3foovE1x,8,8 { target { ! *-*-darwin* } } } }
+// { dg-final { scan-assembler __DATA,__common,__ZGVZ3foovE1x,8,3 { target *-*-darwin* } } }
 // { dg-final { scan-tree-dump "& 1" "original" } }
diff --git gcc/testsuite/g++.dg/abi/arm_va_list.C gcc/testsuite/g++.dg/abi/arm_va_list.C
index 4f6f3a46da4..ff9fd8bcf0d 100644
--- gcc/testsuite/g++.dg/abi/arm_va_list.C
+++ gcc/testsuite/g++.dg/abi/arm_va_list.C
@@ -8,8 +8,10 @@
 // #include <stdarg.h>
 typedef __builtin_va_list va_list;
 
-// { dg-final { scan-assembler "\n_Z1fPSt9__va_list:" } }
+// { dg-final { scan-assembler "\n_Z1fPSt9__va_list:" { target { ! *-*-darwin* } } } }
+// { dg-final { scan-assembler "\n__Z1fPPc:" { target *-*-darwin* } } }
 void f(va_list*) {}
 
-// { dg-final { scan-assembler "\n_Z1gSt9__va_listS_:" } }
+// { dg-final { scan-assembler "\n_Z1gSt9__va_listS_:" { target { ! *-*-darwin* } } } }
+// { dg-final { scan-assembler "\n__Z1gPcS_:" { target *-*-darwin* } } }
 void g(va_list, va_list) {}
-- 
2.42.1

