This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
tell dejagnu that darwin has weak
- From: gkeating at apple dot com (Geoffrey Keating)
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 27 Oct 2004 17:13:50 -0700 (PDT)
- Subject: tell dejagnu that darwin has weak
Since my last patch made GCC not use weak symbols in the bootstrap
(just in the libstdc++ build), I went looking for a good place to put
a testcase. I found one. I also found many tests that could be being
run, if only dejagnu was a bit smarter...
Tested with 'make check-gcc'.
--
- Geoffrey Keating <geoffk@apple.com>
===File ~/patches/gcc-darwin-weak-tests.patch===============
2004-10-27 Geoffrey Keating <geoffk@apple.com>
* gcc.dg/weak/typeof-2.c: Needs aliases as well as weak.
* gcc.dg/weak/weak-3.c: Likewise.
* gcc.dg/weak/weak-5.c: Likewise.
* gcc.dg/weak/weak-9.c: Likewise.
* lib/file-format.exp (gcc_target_object_format): Darwin has Mach-O.
* lib/target-supports.exp (check_weak_available): Mach-O does weak.
Index: gcc.dg/weak/typeof-2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/weak/typeof-2.c,v
retrieving revision 1.5
diff -u -p -u -p -r1.5 typeof-2.c
--- gcc.dg/weak/typeof-2.c 6 Jun 2003 21:34:41 -0000 1.5
+++ gcc.dg/weak/typeof-2.c 27 Oct 2004 21:52:14 -0000
@@ -1,6 +1,7 @@
/* Test typeof with __asm redirection. */
/* { dg-do compile } */
/* { dg-require-weak "" } */
+/* { dg-require-alias "" } */
/* { dg-options "-O2" } */
extern int foo1 (int x) __asm ("baz1");
Index: gcc.dg/weak/weak-3.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/weak/weak-3.c,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 weak-3.c
--- gcc.dg/weak/weak-3.c 12 Oct 2003 22:09:28 -0000 1.4
+++ gcc.dg/weak/weak-3.c 27 Oct 2004 21:52:14 -0000
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-require-alias "" } */
/* { dg-require-weak "" } */
/* { dg-options "-fno-common" } */
Index: gcc.dg/weak/weak-5.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/weak/weak-5.c,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 weak-5.c
--- gcc.dg/weak/weak-5.c 6 Jun 2003 21:34:41 -0000 1.2
+++ gcc.dg/weak/weak-5.c 27 Oct 2004 21:52:14 -0000
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-require-weak "" } */
+/* { dg-require-alias "" } */
/* { dg-options "-fno-common" } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1a" } } */
Index: gcc.dg/weak/weak-9.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/weak/weak-9.c,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 weak-9.c
--- gcc.dg/weak/weak-9.c 6 Jun 2003 21:34:41 -0000 1.2
+++ gcc.dg/weak/weak-9.c 27 Oct 2004 21:52:14 -0000
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-require-weak "" } */
+/* { dg-require-alias "" } */
/* { dg-options "-fno-common" } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?f1" } } */
Index: lib/file-format.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/file-format.exp,v
retrieving revision 1.6
diff -u -p -u -p -r1.6 file-format.exp
--- lib/file-format.exp 5 Feb 2004 05:09:38 -0000 1.6
+++ lib/file-format.exp 27 Oct 2004 21:52:14 -0000
@@ -24,10 +24,14 @@
proc gcc_target_object_format { } {
global gcc_target_object_format_saved
+ global target_triplet
global tool
if [info exists gcc_target_object_format_saved] {
verbose "gcc_target_object_format returning saved $gcc_target_object_format_saved" 2
+ } elseif { [string match "*-*-darwin*" $target_triplet] } {
+ # Darwin doesn't necessarily have objdump, so hand-code it.
+ set gcc_target_object_format_saved mach-o
} else {
set objdump_name [find_binutils_prog objdump]
set open_file [open objfmtst.c w]
Index: lib/target-supports.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/target-supports.exp,v
retrieving revision 1.22
diff -u -p -u -p -r1.22 target-supports.exp
--- lib/target-supports.exp 3 Sep 2004 18:09:34 -0000 1.22
+++ lib/target-supports.exp 27 Oct 2004 21:52:14 -0000
@@ -57,6 +57,7 @@ proc check_weak_available { } {
elf { return 1 }
ecoff { return 1 }
a.out { return 1 }
+ mach-o { return 1 }
unknown { return -1 }
default { return 0 }
}
============================================================