From 399fbdbdddd6ea476c7f47d20bd2ceb0be827218 Mon Sep 17 00:00:00 2001 From: jason Date: Tue, 2 Jun 2015 02:28:19 +0000 Subject: PR c++/44282 gcc/cp/ * mangle.c (attr_strcmp): New. (write_CV_qualifiers_for_type): Also write out attributes that affect type identity. (write_type): Strip all attributes after writing qualifiers. libiberty/ * cp-demangle.c (cplus_demangle_type): Handle arguments to vendor extended qualifier. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224007 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/g++.dg/abi/macro0.C | 2 +- gcc/testsuite/g++.dg/abi/mangle-regparm.C | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/abi/mangle-regparm.C (limited to 'gcc/testsuite') diff --git a/gcc/testsuite/g++.dg/abi/macro0.C b/gcc/testsuite/g++.dg/abi/macro0.C index fbcbb2cdc96..35b8769c3d3 100644 --- a/gcc/testsuite/g++.dg/abi/macro0.C +++ b/gcc/testsuite/g++.dg/abi/macro0.C @@ -1,6 +1,6 @@ // This testcase will need to be kept in sync with c_common_post_options. // { dg-options "-fabi-version=0" } -#if __GXX_ABI_VERSION != 1008 +#if __GXX_ABI_VERSION != 1009 #error "Incorrect value of __GXX_ABI_VERSION" #endif diff --git a/gcc/testsuite/g++.dg/abi/mangle-regparm.C b/gcc/testsuite/g++.dg/abi/mangle-regparm.C new file mode 100644 index 00000000000..7d4121b5f73 --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/mangle-regparm.C @@ -0,0 +1,29 @@ +// { dg-do run { target i?86-*-* } } +// { dg-final { scan-assembler "_Z18IndirectExternCallIPU7stdcallU7regparmILi3EEFviiEiEvT_T0_S3_" } } + +typedef __SIZE_TYPE__ size_t; + +template +void IndirectExternCall(F f, T t1, T t2) { + typedef F (*WrapF)(F); + f (t1, t2); +} + +__attribute__((regparm(3), stdcall)) +void regparm_func (int i, int j) +{ + if (i != 24 || j != 42) + __builtin_abort(); +} + +void normal_func (int i, int j) +{ + if (i != 24 || j != 42) + __builtin_abort(); +} + +int main() +{ + IndirectExternCall (regparm_func, 24, 42); + IndirectExternCall (normal_func, 24, 42); +} -- cgit v1.2.3