move asm-names into gcc.dg/compat ?
Joern Rennecke
joern.rennecke@superh.com
Thu Jul 17 14:22:00 GMT 2003
gcc.dg/asm-names.c tests if a declaration with an asm name with three
underscores, compiled with -fleading-underscores, is compatible with a
plain function definition with two underscores, also compiled with
-fleading-underscores.
The test needs to be at least linked to verify that the symbols match.
Thus, a definition of main is also required. On some ports, defining
main does not work properly with -fleading-underscores. The current
asm-names test has a number of to work around this problem, which also
break a number of ports, and my latest patch to address some of this
breakage causes a warning on another port.
To avoid all this trouble, the main function shouldn't be compiled
with -fleading-underscores in the first place. Thus, the test has to be
split into several files. AFAIK the basic gcc.dg framework doesn't handle
multiple-file tests, and since asm-names.c is also a compatibility test of
sorts, I wondered if it is all right for you to move it into gcc.dg .
And if compat.exp will allow to set dg-options to different values in
different parts of the test.
Some further technical thoughts on the implementation:
although for linking it is not necessary that main calls any of the
other functions, the test might get spurious sucesses when selective
linking is enabled by default unless we have such a call.
We can make this call work across the default mangling / -fleading-underscores
boundary by using another asm name declaration at the call site.
More information about the Gcc-regression
mailing list