diff options
author | Jing Yu <jingyu@google.com> | 2009-03-18 21:58:15 +0000 |
---|---|---|
committer | Doug Kwan <dougkwan@gcc.gnu.org> | 2009-03-18 21:58:15 +0000 |
commit | 80c6520868090c4495d120aa69ea3522bfe4ac01 (patch) | |
tree | c647081bc2673b179dadf7f9722a7398c9319284 /gcc | |
parent | d680e79da863dc83716cd76acb20967c0a8076e6 (diff) | |
download | gcc-80c6520868090c4495d120aa69ea3522bfe4ac01.zip gcc-80c6520868090c4495d120aa69ea3522bfe4ac01.tar.gz gcc-80c6520868090c4495d120aa69ea3522bfe4ac01.tar.bz2 |
Fix missing file and ChangeLog error in previous check-in
From-SVN: r144945
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/inherit/thunk10.C | 60 |
2 files changed, 71 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 19b4a60..adc0ba30 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -69,13 +69,19 @@ 2009-03-17 Jing Yu <jingyu@google.com> PR middle-end/39378 - * function.h: Move is_thunk from rtl_data structure to function - structure. + * function.h (struct rtl_data): Move is_thunk from here... + (struct function): ...to here. + * cp/method.c (use_thunk): Change is_thunk from crtl to cfun. * varasm.c (assemble_start_function): Change is_thunk from crtl to cfun. - * config/alpha/alpha.c: Change is_thunk from crtl to cfun. - * config/rs6000/rs6000.c: Change is_thunk from crtl to cfun. - * config/arm/arm.h: Change is_thunk from crtl to cfun. + * config/alpha/alpha.c (alpha_sa_mask): Change is_thunk from crtl to + cfun. + (alpha_does_function_need_gp, alpha_start_function): Likewise. + (alpha_output_function_end_prologue): Likewise. + (alpha_end_function, alpha_output_mi_thunk_osf): Likewise. + * config/rs6000/rs6000.c (rs6000_ra_ever_killed): Likewise. + (rs6000_output_function_epilogue): Likewise. + * config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Likewise. 2009-03-17 Uros Bizjak <ubizjak@gmail.com> diff --git a/gcc/testsuite/g++.dg/inherit/thunk10.C b/gcc/testsuite/g++.dg/inherit/thunk10.C new file mode 100644 index 0000000..7020677 --- /dev/null +++ b/gcc/testsuite/g++.dg/inherit/thunk10.C @@ -0,0 +1,60 @@ +/* { dg-options "-mthumb" { target arm*-*-* } } */ +/* { dg-do run } */ +/* { dg-timeout 100 } */ + +/* PR middle-end/39378 */ +/* Check if the thunk target function is emitted correctly. */ +class B1 +{ +public: + virtual int foo1(void); + int b1; +}; + +class B2 +{ +public: + virtual int foo2 (void); + int b2; +}; + +class D : public B1, public B2 +{ + int foo1(void); + int foo2(void); + int d; +}; + +int B1::foo1(void) +{ + return 3; +} + +int B2::foo2(void) +{ + return 4; +} + +int D::foo1(void) +{ + return 1; +} + +int D::foo2(void) +{ + return 2; +} + +__attribute__((noinline)) int test(B2* bp) +{ + return bp->foo2(); +} + +int main() +{ + B2 *bp = new D(); + if (test(bp) == 2) + return 0; + else + return 1; +} |