From b15e733f3c23987afbac235247d68fd1fd84b668 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Sat, 17 Dec 2005 07:17:06 +0100 Subject: [PATCH] attr-weakref-1.c: Do not run on darwin. * gcc.dg/attr-weakref-1.c: Do not run on darwin. * gcc.dg/attr-weakref-1-darwin.c: New test to run on darwin. From-SVN: r108710 --- gcc/testsuite/ChangeLog | 138 +++++++++-------- gcc/testsuite/gcc.dg/attr-weakref-1-darwin.c | 223 +++++++++++++++++++++++++++ gcc/testsuite/gcc.dg/attr-weakref-1.c | 4 +- 3 files changed, 296 insertions(+), 69 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/attr-weakref-1-darwin.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 391df15..8af6712 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-12-17 Andreas Jaeger + + * gcc.dg/attr-weakref-1.c: Do not run on darwin. + * gcc.dg/attr-weakref-1-darwin.c: New test to run on darwin. + 2005-12-16 Jerry DeLisle PR fortran/24268 @@ -123,7 +128,7 @@ Remove xfail. 2005-12-14 Kean Johnston - Kaveh R. Ghazi + Kaveh R. Ghazi * gcc.dg/sibcall-6.c: Skip in -fPIC mode on X86 ilp32. * gcc.target/i386/20020523-1.c: Ditto. @@ -144,8 +149,8 @@ 2005-12-14 David Billinghurst (David.Billinghurst@riotinto.com) - * lib/fortran-torture.exp: Catch remaining uses of - remote_file build delete. + * lib/fortran-torture.exp: Catch remaining uses of + remote_file build delete. 2005-12-13 Kaveh R. Ghazi @@ -399,7 +404,7 @@ PR libgfortran/25039 * gfortran.dg/read_comma.f: New test. - + 2005-12-08 Jakub Jelinek PR c++/19317 @@ -435,9 +440,9 @@ ILP32 vect_no_align platforms. 2005-12-08 Andreas Krebbel - Jakub Jelinek + Jakub Jelinek - PR target/25268 + PR target/25268 * gcc.c-torture/compile/20051207-1.c: New test. 2005-12-07 Kaveh R. Ghazi @@ -550,7 +555,7 @@ PR c++/24173 * g++.dg/template/friend40.C: New test. - + 2005-12-02 Jakub Jelinek PR target/25199 @@ -579,11 +584,11 @@ 2005-12-01 Jerry DeLisle * gfortran.dg/pr24489.f90: Delete, replaced by read_eor.f90. - * gfortran.dg/pr24584.f90: Delete, replaced by namelist_empty.f90. + * gfortran.dg/pr24584.f90: Delete, replaced by namelist_empty.f90. 2005-12-01 Gabriel Dos Reis - PR c/13384 + PR c/13384 * gcc.dg/pr17730-1.c: Adjust. * gcc.dg/lvalue1.c (main): Likewise. * gcc.dg/lvalue-2.c: Likewise. @@ -618,7 +623,7 @@ g++.dg/tls/diag-3.C, g++.dg/tls/diag-4.C, g++.dg/tls/init-1.C, g++.dg/tls/init-2.C, g++.dg/tls/trivial.C: Require effective-target TLS. - * gcc.dg/tls/pr24428-2.c, gcc.dg/tls/pr24428.c, gcc.dg/tls/opt-11.c, + * gcc.dg/tls/pr24428-2.c, gcc.dg/tls/pr24428.c, gcc.dg/tls/opt-11.c, g++.dg/tls/static-1a.cc, g++.dg/tls/static-1.C: Require effective-target TLS runtime. @@ -1014,7 +1019,7 @@ * gcc.dg/tree-ssa/loop-14.c: New test. 2005-11-17 James A. Morrison - Michael Chamberlain + Michael Chamberlain * ada/acats/run_all.sh (target_run): Kill long running tests. @@ -1185,7 +1190,7 @@ PR middle-end/24750 * gcc.dg/torture/pr24750-1.c, gcc.target/cris/torture/pr24750-2.c: - New tests. + New tests. 2005-11-11 Andreas Tobler @@ -1277,7 +1282,7 @@ 2005-11-09 Andreas Krebbel - PR 24624 + PR 24624 * gcc.dg/pr24624.c: Testcase added. 2005-11-09 Andreas Krebbel @@ -1361,14 +1366,14 @@ PR target/24230 - * gcc.target/powerpc/altivec-consts.c, - gcc.target/powerpc/altivec-splat.c: New testcase. + * gcc.target/powerpc/altivec-consts.c, + gcc.target/powerpc/altivec-splat.c: New testcase. 2005-11-07 Paolo Bonzini PR c/24599 - * gcc.dg/overflow-2.c: New testcase. + * gcc.dg/overflow-2.c: New testcase. 2005-11-07 Jakub Jelinek @@ -1722,8 +1727,8 @@ 2005-10-31 Jerry DeLisle - PR libgfortran/24584 - * gfortran.dg/pr24584.f90: New test. + PR libgfortran/24584 + * gfortran.dg/pr24584.f90: New test. 2005-10-28 Erik Edelmann @@ -1833,14 +1838,14 @@ 2005-10-24 Jerry DeLisle - PR libgfortran/24224 - * gfortran.dg/arrayio_1.f90: Update attribution. - * gfortran.dg/arrayio_2.f90: Update attribution. - * gfortran.dg/arrayio_3.f90: Update attribution. - * gfortran.dg/arrayio_4.f90: Update test conditions. - * gfortran.dg/arrayio_5.f90: Update attribution. - * gfortran.dg/arrayio_6.f90: New test. - * gfortran.dg/arrayio_7.f90: New test. + PR libgfortran/24224 + * gfortran.dg/arrayio_1.f90: Update attribution. + * gfortran.dg/arrayio_2.f90: Update attribution. + * gfortran.dg/arrayio_3.f90: Update attribution. + * gfortran.dg/arrayio_4.f90: Update test conditions. + * gfortran.dg/arrayio_5.f90: Update attribution. + * gfortran.dg/arrayio_6.f90: New test. + * gfortran.dg/arrayio_7.f90: New test. 2005-10-24 Zdenek Dvorak @@ -2240,12 +2245,12 @@ 2005-10-12 Razya Ladelsky - * g++.dg/ipa/ipa-1.c: New test. - * g++.dg/ipa/ipa-2.c: New test. - * g++.dg/ipa/ipa-3.c: New test. - * g++.dg/ipa/ipa-4.c: New test. - * g++.dg/ipa/ipa-5.c: New test. - * g++.dg/ipa/ipa.exp: New file. + * g++.dg/ipa/ipa-1.c: New test. + * g++.dg/ipa/ipa-2.c: New test. + * g++.dg/ipa/ipa-3.c: New test. + * g++.dg/ipa/ipa-4.c: New test. + * g++.dg/ipa/ipa-5.c: New test. + * g++.dg/ipa/ipa.exp: New file. 2005-10-12 Paul Thomas @@ -3252,7 +3257,7 @@ * gfortran.dg/direct_io_4.f90: New test case. 2005-09-04 Andrew Pinski - Rasmus Hahn + Rasmus Hahn PR libobjc/23108 * objc.dg/type-stream-1.m: New test. @@ -3693,10 +3698,10 @@ * gcc.dg/vect/vect-78: Likewise. * gcc.dg/vect/vect-80: Likewise. * gcc.dg/vect/vect-35: Likewise, and also check that the test wasn't - vectorized for the expected reason, rather than checking how alignment - was handled. + vectorized for the expected reason, rather than checking how alignment + was handled. * gcc.dg/vect/vect-92.c: Use aligned arrays instead of arrays to aligned - type and also instead of aligned pointers. Added documentation. + type and also instead of aligned pointers. Added documentation. 2005-08-16 Feng Wang @@ -3734,7 +3739,7 @@ * gcc.dg/vect/vect-105.c: Add xfail for no_align targets. 2005-08-13 Marcin Koziej - Andrew Pinski + Andrew Pinski PR libobjc/22492 * execute/exceptions/finally-1.m: New test. @@ -3893,7 +3898,7 @@ * gcc.dg/pr22458-1.c: New test. 2005-08-07 Janne Blomqvist - Steven G. Kargl + Steven G. Kargl PR fortran/22390 * gfortran.dg/flush_1.f90: New test. @@ -4196,7 +4201,7 @@ 2005-07-27 Jeff Law - * gcc.c-torture/execute/pr22630.c: New test. + * gcc.c-torture/execute/pr22630.c: New test. 2005-07-27 Dorit Nuzman @@ -4252,8 +4257,8 @@ 2005-07-25 Adam Nemet - * lib/profopt.exp (profopt-execute): Check for profiling data - files on the target. + * lib/profopt.exp (profopt-execute): Check for profiling data + files on the target. 2005-07-25 Richard Guenther @@ -4308,14 +4313,14 @@ 2005-07-23 Jerry DeLisle - * gfortran.fortran-torture/execute/nan_inf_fmt.f90: Revise test to - include case of field width of zero. + * gfortran.fortran-torture/execute/nan_inf_fmt.f90: Revise test to + include case of field width of zero. 2005-07-23 Jerry DeLisle - PR libgfortran/21875 - * gfortran.dg/fmt_read_bz_bn.f90: Revised test to include case - with trailing blanks on normal formatted read. + PR libgfortran/21875 + * gfortran.dg/fmt_read_bz_bn.f90: Revised test to include case + with trailing blanks on normal formatted read. 2005-07-23 Chao-ying Fu @@ -4404,8 +4409,8 @@ 2005-07-21 Paolo Bonzini PR tree-optimization/19210 - * gcc.dg/tree-ssa/pr19210-1.c: New. - * gcc.dg/tree-ssa/pr19210-2.c: New. + * gcc.dg/tree-ssa/pr19210-1.c: New. + * gcc.dg/tree-ssa/pr19210-2.c: New. 2005-07-21 Richard Sandiford @@ -4889,7 +4894,7 @@ 2005-06-28 Thomas Koenig - PR libfortran/22142 + PR libfortran/22142 * gfortran.fortran-torture/execute/intrinsic_eoshift.f90: Add testcase also testing eoshift1 for PR 22142. @@ -4903,7 +4908,7 @@ 2005-06-28 Thomas Koenig - PR libfortran/22142 + PR libfortran/22142 * gfortran.fortran-torture/execute/intrinsic_eoshift.f90: Add testcase for PR 22142. @@ -5934,7 +5939,7 @@ 2005-05-26 Andreas Jaeger - PR testsuite/20772 + PR testsuite/20772 * gfortran.dg/promotion.f90, gcc.misc-tests/i386-pf-3dnow-1.c, gcc.misc-tests/i386-pf-athlon-1.c, gcc.misc-tests/i386-pf-none-1.c, gcc.misc-tests/i386-pf-sse-1.c, @@ -7187,20 +7192,20 @@ 2004-04-11 Devang Patel - * lib/target-supports.exp (check_effective_target_vect_condition): New. - * gcc.dg/vect/vect-ifcvt-1.c: New test. - * gcc.dg/vect/vect-ifcvt-2.c: New test. - * gcc.dg/vect/vect-ifcvt-3.c: New test. - * gcc.dg/vect/vect-ifcvt-4.c: New test. - * gcc.dg/vect/vect-ifcvt-5.c: New test. - * gcc.dg/vect/vect-ifcvt-6.c: New test. - * gcc.dg/vect/vect-ifcvt-7.c: New test. - * gcc.dg/vect/vect-none.c: Now one loop is vectorized. + * lib/target-supports.exp (check_effective_target_vect_condition): New. + * gcc.dg/vect/vect-ifcvt-1.c: New test. + * gcc.dg/vect/vect-ifcvt-2.c: New test. + * gcc.dg/vect/vect-ifcvt-3.c: New test. + * gcc.dg/vect/vect-ifcvt-4.c: New test. + * gcc.dg/vect/vect-ifcvt-5.c: New test. + * gcc.dg/vect/vect-ifcvt-6.c: New test. + * gcc.dg/vect/vect-ifcvt-7.c: New test. + * gcc.dg/vect/vect-none.c: Now one loop is vectorized. 2004-04-11 Devang Patel - * gcc.dg/vect/vect-dv-1.c: New test. - * gcc.dg/vect/vect-dv-2.c: New test. + * gcc.dg/vect/vect-dv-1.c: New test. + * gcc.dg/vect/vect-dv-2.c: New test. 2005-04-11 Diego Novillo @@ -7254,7 +7259,7 @@ * gcc.dg/pr20126.c: New. 2005-04-09 Bud Davis - Steven G. Kargl + Steven G. Kargl * gfortran.dg/PR19872.f: New test. @@ -7507,7 +7512,7 @@ * g++.dg/template/spec23.C: New. 2005-04-03 Dale Ranta - Francois-Xavier Coudert + Francois-Xavier Coudert PR libfortran/20068 PR libfortran/20125 @@ -8499,7 +8504,7 @@ 2005-03-06 John David Anglin * lib/file-format.exp (gcc_target_object_format): Add check for som - format and hardcode object formats on hppa*-*-hpux*. + format and hardcode object formats on hppa*-*-hpux*. * lib/target-supports.exp (check_weak_available): Add check for som object format. Always return 0 on hppa*-*-hpux10*. @@ -8515,7 +8520,7 @@ * gfortran.dg/pr19936_3.f90: New test. 2005-03-05 Steven G. Kargl - Paul Thomas + Paul Thomas * gfortran.dg/PR19754_1.f90: New test. * gfortran.dg/PR19754_2.f90: Ditto. @@ -39037,4 +39042,3 @@ rlsruhe.de> correspond to c-torture 1.11. * New file. - diff --git a/gcc/testsuite/gcc.dg/attr-weakref-1-darwin.c b/gcc/testsuite/gcc.dg/attr-weakref-1-darwin.c new file mode 100644 index 0000000..ef0ec52 --- /dev/null +++ b/gcc/testsuite/gcc.dg/attr-weakref-1-darwin.c @@ -0,0 +1,223 @@ +// { dg-do run { target { powerpc-*-darwin* } } } +// { dg-require-weak "" } +// { dg-options "-O2" } +// { dg-options "-O2 -mmacosx-version-min=10.2" { target { powerpc-*-darwin* } } } +// { dg-additional-sources "attr-weakref-1a.c attr-weakref-1b.c" } + +// Copyright 2005 Free Software Foundation, Inc. +// Contributed by Alexandre Oliva + +// Torture test for weakrefs. The first letter of an identifier +// indicates whether/how it is defined; the second letter indicates +// whether it is part of a variable or function test; the number that +// follows is a test counter, and a letter that may follow enables +// multiple identifiers within the same test (e.g., multiple weakrefs +// or pointers to the same identifier). + +// Identifiers starting with W are weakrefs; those with p are +// pointers; those with g are global definitions; those with l are +// local definitions; those with w are expected to be weak undefined +// in the symbol table; those with u are expected to be marked as +// non-weak undefined in the symbol table. + +#include + +#define USED __attribute__((used)) + +typedef int vtype; + +extern vtype wv1; +static vtype Wv1a __attribute__((weakref ("wv1"))); +static vtype *pv1a USED = &Wv1a; + +vtype gv2; +static vtype Wv2a __attribute__((weakref ("gv2"))); +static vtype *pv2a USED = &Wv2a; + +static vtype lv3; +static vtype Wv3a __attribute__((weakref ("lv3"))); +static vtype *pv3a USED = &Wv3a; + +extern vtype uv4; +static vtype Wv4a __attribute__((weakref ("uv4"))); +static vtype *pv4a USED = &Wv4a; +static vtype *pv4 USED = &uv4; + +static vtype Wv5a __attribute__((weakref ("uv5"))); +static vtype *pv5a USED = &Wv5a; +extern vtype uv5; +static vtype *pv5 USED = &uv5; + +static vtype Wv6a __attribute__((weakref ("wv6"))); +static vtype *pv6a USED = &Wv6a; +extern vtype wv6; + +static vtype Wv7a __attribute__((weakref ("uv7"))); +static vtype* USED fv7 (void) { + return &Wv7a; +} +extern vtype uv7; +static vtype* USED fv7a (void) { + return &uv7; +} + +extern vtype uv8; +static vtype* USED fv8a (void) { + return &uv8; +} +static vtype Wv8a __attribute__((weakref ("uv8"))); +static vtype* USED fv8 (void) { + return &Wv8a; +} + +extern vtype wv9 __attribute__((weak)); +static vtype Wv9a __attribute__((weakref ("wv9"))); +static vtype *pv9a USED = &Wv9a; + +static vtype Wv10a __attribute__((weakref ("Wv10b"))); +static vtype Wv10b __attribute__((weakref ("Wv10c"))); +static vtype Wv10c __attribute__((weakref ("Wv10d"))); +static vtype Wv10d __attribute__((weakref ("wv10"))); +extern vtype wv10; + +extern vtype wv11; +static vtype Wv11d __attribute__((weakref ("wv11"))); +static vtype Wv11c __attribute__((weakref ("Wv11d"))); +static vtype Wv11b __attribute__((weakref ("Wv11c"))); +static vtype Wv11a __attribute__((weakref ("Wv11b"))); + +static vtype Wv12 __attribute__((weakref ("wv12"))); +extern vtype wv12 __attribute__((weak)); + +static vtype Wv13 __attribute__((weakref ("wv13"))); +extern vtype wv13 __attribute__((weak)); + +static vtype Wv14a __attribute__((weakref ("wv14"))); +static vtype Wv14b __attribute__((weakref ("wv14"))); +extern vtype wv14 __attribute__((weak)); + +typedef void ftype(void); + +extern ftype wf1; +static ftype Wf1a __attribute__((weakref ("wf1"))); +static ftype *pf1a USED = &Wf1a; +static ftype Wf1c __attribute__((weakref)); +extern ftype Wf1c __attribute__((alias ("wf1"))); +static ftype *pf1c USED = &Wf1c; + +void gf2(void) {} +static ftype Wf2a __attribute__((weakref ("gf2"))); +static ftype *pf2a USED = &Wf2a; + +static void lf3(void) {} +static ftype Wf3a __attribute__((weakref ("lf3"))); +static ftype *pf3a USED = &Wf3a; + +extern ftype uf4; +static ftype Wf4a __attribute__((weakref ("uf4"))); +static ftype *pf4a USED = &Wf4a; +static ftype *pf4 USED = &uf4; + +static ftype Wf5a __attribute__((weakref ("uf5"))); +static ftype *pf5a USED = &Wf5a; +extern ftype uf5; +static ftype *pf5 USED = &uf5; + +static ftype Wf6a __attribute__((weakref ("wf6"))); +static ftype *pf6a USED = &Wf6a; +extern ftype wf6; + +static ftype Wf7a __attribute__((weakref ("uf7"))); +static ftype* USED ff7 (void) { + return &Wf7a; +} +extern ftype uf7; +static ftype* USED ff7a (void) { + return &uf7; +} + +extern ftype uf8; +static ftype* USED ff8a (void) { + return &uf8; +} +static ftype Wf8a __attribute__((weakref ("uf8"))); +static ftype* USED ff8 (void) { + return &Wf8a; +} + +extern ftype wf9 __attribute__((weak)); +static ftype Wf9a __attribute__((weakref ("wf9"))); +static ftype *pf9a USED = &Wf9a; + +static ftype Wf10a __attribute__((weakref ("Wf10b"))); +static ftype Wf10b __attribute__((weakref ("Wf10c"))); +static ftype Wf10c __attribute__((weakref ("Wf10d"))); +static ftype Wf10d __attribute__((weakref ("wf10"))); +extern ftype wf10; + +extern ftype wf11; +static ftype Wf11d __attribute__((weakref ("wf11"))); +static ftype Wf11c __attribute__((weakref ("Wf11d"))); +static ftype Wf11b __attribute__((weakref ("Wf11c"))); +static ftype Wf11a __attribute__((weakref ("Wf11b"))); + +static ftype Wf12 __attribute__((weakref ("wf12"))); +extern ftype wf12 __attribute__((weak)); + +static ftype Wf13 __attribute__((weakref ("wf13"))); +extern ftype wf13 __attribute__((weak)); + +static ftype Wf14a __attribute__((weakref ("wf14"))); +static ftype Wf14b __attribute__((weakref ("wf14"))); +extern ftype wf14 __attribute__((weak)); + +#ifndef __APPLE__ +#define chk(p) do { if (!p) abort (); } while (0) +#else +#define chk(p) /* */ +#endif + +int main () { + chk (!pv1a); + chk (pv2a); + chk (pv3a); + chk (pv4a); + chk (pv4); + chk (pv5a); + chk (pv5); + chk (!pv6a); + chk (fv7 ()); + chk (fv7a ()); + chk (fv8 ()); + chk (fv8a ()); + chk (!pv9a); + chk (!&Wv10a); + chk (!&Wv11a); + chk (!&Wv12); + chk (!&wv12); + chk (!&wv13); + chk (!&Wv14a); + + chk (!pf1a); + chk (!pf1c); + chk (pf2a); + chk (pf3a); + chk (pf4a); + chk (pf4); + chk (pf5a); + chk (pf5); + chk (!pf6a); + chk (ff7 ()); + chk (ff7a ()); + chk (ff8 ()); + chk (ff8a ()); + chk (!pf9a); + chk (!&Wf10a); + chk (!&Wf11a); + chk (!&Wf12); + chk (!&wf12); + chk (!&wf13); + chk (!&Wf14a); + + exit (0); +} diff --git a/gcc/testsuite/gcc.dg/attr-weakref-1.c b/gcc/testsuite/gcc.dg/attr-weakref-1.c index 7ffd64d..0307110 100644 --- a/gcc/testsuite/gcc.dg/attr-weakref-1.c +++ b/gcc/testsuite/gcc.dg/attr-weakref-1.c @@ -1,9 +1,9 @@ // { dg-do run } // { dg-require-weak "" } +// On darwin, we use attr-weakref-1-darwin.c +// { dg-skip-if "" { "*-*-darwin*" } "*" { "*" } } // { dg-options "-O2" } -// { dg-options "-O2 -mmacosx-version-min=10.2" { target { powerpc-*-darwin* } } } // { dg-additional-sources "attr-weakref-1a.c" } -// { dg-additional-sources "attr-weakref-1a.c attr-weakref-1b.c" { target { *-*-darwin* } } } // Copyright 2005 Free Software Foundation, Inc. // Contributed by Alexandre Oliva -- 2.7.4