This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Support "nothrow" function attribute
On Sun, May 26, 2002 at 08:02:51PM -0600, Roger Sayle wrote:
> When I first searched the testsuite for examples of attribute tests,
> I was shocked to find that there are currently no occurances of
> __attribute__((pure)) or __attribute__((const)) etc.. Obviously
> some patches are more meticulously reviewed than others :>
Yeah, and some of them fall into the "historic" category
that didn't get as through treatment either.
Rather than this generic non-test, perhaps you'd like to
come up with some functional tests for these attributes?
Const and Pure, in particular, should be easy enough to
come up with aliasing tests like
int foo(int) __attribute__((pure));
void link_error(void);
int main ()
{
int i[10], r;
i[0] = 0;
r = foo(0);
if (i[0])
link_error();
return r;
}
int foo(int x) { return x - x; }
You should be able to steal constructor/destructor ideas
from the c++ test suite.
> Ahhh! That's how to do it. Can I have permission to add this test
> (with suitable comments) to the testsuite as g++.dg/ext/attrib6.C?
Assuming it actually works, yes. ;-)
r~