This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix three testcases for Darwin


Darwin uses .weak_definition directives instead of .weak to declare
symbols as weak.  The attached patch changes three testcases to check
for the correct syntax when the target is darwin.  Verified that the
tests pass with patch applied on powerpc-apple-darwin and
i686-pc-linux-gnu.  OK for mainline?  What about 4.2?

Thanks -

Josh

2006-12-12  Josh Conner  <jconner@apple.com>

	* g++.dg/abi/thunk3.C: Use .weak_definition on darwin.
	* g++.dg/abi/thunk4.C: Likewise.
	* g++.dg/abi/rtti3.C: Likewise.


:ADDPATCH testsuite:
Index: thunk3.C
===================================================================
--- thunk3.C	(revision 121257)
+++ thunk3.C	(working copy)
@@ -1,5 +1,5 @@
 // { dg-require-weak "" }
-// { dg-final { scan-assembler-not ".weak\[\t \]_?_ZThn._N7Derived3FooEv" } }
+// { dg-final { if [ istarget *-*-darwin* ] { scan-assembler-not ".weak_definition\[\t \]_?_ZThn._N7Derived3FooEv" } else { scan-assembler-not ".weak\[\t \]_?_ZThn._N7Derived3FooEv" } } }
 
 struct Base 
 {
Index: rtti3.C
===================================================================
--- rtti3.C	(revision 121257)
+++ rtti3.C	(working copy)
@@ -2,8 +2,8 @@
 // necessarily the type info object
 
 // { dg-require-weak "" }
-// { dg-final { scan-assembler ".weak\[ \t\]_?_ZTSPP1A" } }
-// { dg-final { scan-assembler-not ".weak\[ \t\]_?_ZTIPP1A" } }
+// { dg-final { if [ istarget *-*-darwin* ] { scan-assembler ".weak_definition\[ \t\]_?_ZTSPP1A" } else { scan-assembler ".weak\[ \t\]_?_ZTSPP1A" } } }
+// { dg-final { if [ istarget *-*-darwin* ] { scan-assembler-not ".weak_definition\[ \t\]_?_ZTIPP1A" } else { scan-assembler-not ".weak\[ \t\]_?_ZTIPP1A" } } }
 
 struct A;
 
Index: thunk4.C
===================================================================
--- thunk4.C	(revision 121257)
+++ thunk4.C	(working copy)
@@ -1,5 +1,5 @@
 // { dg-require-weak "" }
-// { dg-final { scan-assembler ".weak\[ \t\]_?_ZThn._N7Derived3FooEv" } }
+// { dg-final { if [ istarget *-*-darwin* ] { scan-assembler ".weak_definition\[ \t\]_?_ZThn._N7Derived3FooEv" } else { scan-assembler ".weak\[ \t\]_?_ZThn._N7Derived3FooEv" } } }
 
 struct Base 
 {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]