diff options
author | Hans-Peter Nilsson <hp@gcc.gnu.org> | 2008-09-22 01:54:41 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@gcc.gnu.org> | 2008-09-22 01:54:41 +0000 |
commit | 187fcb85b64e556f8e1142fa944ed05e5a21fc57 (patch) | |
tree | 260c382923a70dfdbc147094e351b12a26aae542 /gcc | |
parent | c70d0414afa803f535420815116971725933234c (diff) | |
download | gcc-187fcb85b64e556f8e1142fa944ed05e5a21fc57.zip gcc-187fcb85b64e556f8e1142fa944ed05e5a21fc57.tar.gz gcc-187fcb85b64e556f8e1142fa944ed05e5a21fc57.tar.bz2 |
re PR target/37170 (gcc.dg/weak/weak-1.c)
PR middle-end/37170
PR middle-end/37280
* gcc.dg/weak/weak-15.c, gcc.dg/weak/weak-16.c,
g++.dg/ext/inline1.C: New tests.
From-SVN: r140540
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 23 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/inline1.C | 34 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/weak/weak-15.c | 39 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/weak/weak-16.c | 21 |
4 files changed, 109 insertions, 8 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 370a370..ca0e708 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2008-09-22 Hans-Peter Nilsson <hp@axis.com> + + PR middle-end/37170 + PR middle-end/37280 + * gcc.dg/weak/weak-15.c, gcc.dg/weak/weak-16.c, + g++.dg/ext/inline1.C: New tests. + 2008-09-21 Kaz Kojima <kkojima@gcc.gnu.org> PR rtl-optimization/33642 @@ -2738,7 +2745,7 @@ * gfortran.dg/cshift_char_3.f90: New test case. * gfortran.dg/cshift_nan_1.f90: New test case. -2008-08-14 Rafael Ávila de Espíndola <espindola@google.com> +2008-08-14 Rafael Ãvila de EspÃndola <espindola@google.com> * gcc.dg/visibility-14.c: New test. * gcc.dg/visibility-15.c: New test. @@ -3460,7 +3467,7 @@ PR tree-optimization/36967 * gfortran.dg/pr36967.f: New testcase. -2008-07-30 Rafael Ávila de Espíndola <espindola@google.com> +2008-07-30 Rafael Ãvila de EspÃndola <espindola@google.com> * gcc.dg/visibility-14.c: New test. * gcc.dg/visibility-15.c: New test. @@ -5154,7 +5161,7 @@ dg-additional-sources. (profopt-execute): Handle additional sources. -2008-05-28 Rafael Espíndola <espindola@google.com> +2008-05-28 Rafael EspÃndola <espindola@google.com> * gcc.dg/20080528-1.c: New test. @@ -5291,7 +5298,7 @@ * g++.dg/template/inline1.C: For the not-defined symbol, use the pattern from g++.dg/template/qualttp17.C. -2008-05-23 Rafael Espíndola <espindola@google.com> +2008-05-23 Rafael EspÃndola <espindola@google.com> * gcc.c-torture/compile/20080522-1.c: Move to gcc.dg. * gcc.dg/20080522-1.c: Moved from gcc.c-torture. @@ -5329,7 +5336,7 @@ * gfortran.dg/cshift_large_1.f90: New test. * gfortran.dg/eoshift_large_1.f90: New test. -2008-05-22 Rafael Espíndola <espindola@google.com> +2008-05-22 Rafael EspÃndola <espindola@google.com> * gcc.c-torture/compile/20080522-1.c: New testcase. @@ -6094,7 +6101,7 @@ PR fortran/36162 * gfortran.dg/module_widestring_1.f90: New test. -2008-05-08 Rafael Espíndola <espindola@google.com> +2008-05-08 Rafael EspÃndola <espindola@google.com> * gcc.dg/vect/vect-111.c: Rename to no-trapping-math-vect-111.c * gcc.dg/vect/vect-ifcvt-11.c: Rename to no-trapping-math-vect-ifcvt-11.c @@ -7033,7 +7040,7 @@ PR fortran/35780 * gfortran.dg/simplify_argN_1.f90: New test. -2008-04-06 Tobias Schlüter <tobi@gcc.gnu.org> +2008-04-06 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/35832 * gfortran.dg/io_constraints_2.f90: Adapt to new error message. @@ -8794,7 +8801,7 @@ * g++.dg/torture/pr35164-1.C: New testcase. * g++.dg/torture/pr35164-2.C: Likewise. -2008-02-15 Dominique d'Humières <dominiq@lps.ens.fr> +2008-02-15 Dominique d'Humières <dominiq@lps.ens.fr> PR testsuite/35119 * g++.dg/template/spec35.C: Change the regular expressions diff --git a/gcc/testsuite/g++.dg/ext/inline1.C b/gcc/testsuite/g++.dg/ext/inline1.C new file mode 100644 index 0000000..7e5f062 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/inline1.C @@ -0,0 +1,34 @@ +// { dg-do compile } +// { dg-options "-O" } +// Make sure inlined non-outlined functions aren't marked weak. +// We'd get a ".weak xyzzy" annotation trigged by the second declaration. + +// { dg-final { scan-assembler-not "weak\[^ \t\]*\[ \t\]_?xyzzy" } } + +// The next check isn't really part of the actual test, just to make +// sure there's no outline-copy of xyzzy, because if that really +// happened, it *should* be marked linkonce or perhaps weak. +// { dg-final { scan-assembler-not "xyzzy" } } + +extern int x; +extern void foo(void); +extern void bar(void); + +extern "C" inline int xyzzy(int a) +{ + foo(); + return a + x; +} + +extern "C" int xyzzy(int); + +extern inline int plugh(int c) +{ + return xyzzy (c); +} + +int y; +void doit(int b) +{ + y = xyzzy (b) + plugh (b); +} diff --git a/gcc/testsuite/gcc.dg/weak/weak-15.c b/gcc/testsuite/gcc.dg/weak/weak-15.c new file mode 100644 index 0000000..2218ca4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/weak/weak-15.c @@ -0,0 +1,39 @@ +/* { dg-do compile } */ +/* { dg-require-weak "" } */ +/* { dg-options "-fno-common" } */ + +/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?a" } } */ +/* { dg-final { scan-assembler-not "weak\[^ \t\]*\[ \t\]_?b" } } */ +/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?c" } } */ +/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?d" } } */ + +#pragma weak a +extern char a[]; + +char *user_a(void) +{ + return a+1; +} + +int x; +int extern inline b(int y) +{ + return x+y; +} + +extern int b(int y); + +int user_b(int z) +{ + return b(z); +} + +#pragma weak c +extern int c; + +int *user_c = &c; + +#pragma weak d +extern char d[]; + +char *user_d = &d[1]; diff --git a/gcc/testsuite/gcc.dg/weak/weak-16.c b/gcc/testsuite/gcc.dg/weak/weak-16.c new file mode 100644 index 0000000..3bcf388 --- /dev/null +++ b/gcc/testsuite/gcc.dg/weak/weak-16.c @@ -0,0 +1,21 @@ +/* From PR37280. */ +/* { dg-do compile } */ +/* { dg-require-weak "" } */ +/* { dg-options "-fno-common -Os" } */ +/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?kallsyms_token_index" } } */ +/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?kallsyms_token_table" } } */ + +extern int kallsyms_token_index[] __attribute__((weak)); +extern int kallsyms_token_table[] __attribute__((weak)); +void kallsyms_expand_symbol(int *result) +{ + int len = *result; + int *tptr; + while(len) { + tptr = &kallsyms_token_table[ kallsyms_token_index[*result] ]; + len--; + while (*tptr) tptr++; + *tptr = 1; + } + *result = 0; +} |