Change SometimesInlineFunction to "return i * i * 3;"

The debug_msg test has 2 implementations of SometimesInlineFunction:

int SometimesInlineFunction(int i) { return i; }
int SometimesInlineFunction(int i) { return i * i; }

and One Definition Rule (ODR) violation detection expects they will be
compiled into functions of different sizes.  Hower, on x86, GCC 4.7 and
newer compile them into functions of the same size and ODR violation
detection test fails.  This patch changes

int SometimesInlineFunction(int i) { return i; }

to

int SometimesInlineFunction(int i) { return i * i * 3; }

so that it will be compiled into a function of larger size.

	PR gold/14608
	* testsuite/debug_msg.cc (SometimesInlineFunction): Changed
	to "return i * i * 3;".
This commit is contained in:
H.J. Lu 2014-12-20 08:05:45 -08:00
parent 13a1997e66
commit bd040da1db
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
PR gold/14608
* testsuite/debug_msg.cc (SometimesInlineFunction): Changed
to "return i * i * 3;".
2014-12-16 Cary Coutant <ccoutant@google.com> 2014-12-16 Cary Coutant <ccoutant@google.com>
* mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes. * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.

View File

@ -66,7 +66,7 @@ OdrBase* CreateOdrDerived2(); // in odr_violation2.cc
extern "C" int OverriddenCFunction(int i); // in odr_violation*.cc extern "C" int OverriddenCFunction(int i); // in odr_violation*.cc
inline int SometimesInlineFunction(int i) { // strong in odr_violation2.cc. inline int SometimesInlineFunction(int i) { // strong in odr_violation2.cc.
return i; return i * i * 3;
} }