Commit 2a4217d3 by Jason Merrill Committed by Jason Merrill

* g++.dg/abi/regparm1.C: Fix execute test.

From-SVN: r154000
parent c58bbf00
2009-11-07 Jason Merrill <jason@redhat.com>
* g++.dg/abi/regparm1.C: Fix execute test.
2009-11-07 Jakub Jelinek <jakub@redhat.com> 2009-11-07 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/41643 PR tree-optimization/41643
......
...@@ -7,18 +7,29 @@ extern "C" int printf(const char *, ...); ...@@ -7,18 +7,29 @@ extern "C" int printf(const char *, ...);
void *save_this; void *save_this;
int *save_addr1, *save_addr2; int *save_addr1, *save_addr2;
int fail;
struct Base struct Base
{ {
__attribute((regparm(3))) void __attribute((regparm(3))) void
set(int *addr1, int *addr2) set(int *addr1, int *addr2)
{ {
if (this != save_this) if (this != save_this)
{
++fail;
printf("error! this == %p, should be %p\n", this, save_this); printf("error! this == %p, should be %p\n", this, save_this);
}
if (addr1 != save_addr1) if (addr1 != save_addr1)
{
++fail;
printf("error! addr1 == %p, should be %p\n", addr1, save_addr1); printf("error! addr1 == %p, should be %p\n", addr1, save_addr1);
}
if (addr2 != save_addr2) if (addr2 != save_addr2)
{
++fail;
printf("error! addr2 == %p, should be %p\n", addr2, save_addr1); printf("error! addr2 == %p, should be %p\n", addr2, save_addr1);
} }
}
}; };
int main() int main()
...@@ -36,5 +47,5 @@ int main() ...@@ -36,5 +47,5 @@ int main()
(obj.* pfm3) (&x, &y); (obj.* pfm3) (&x, &y);
(obj.* pfm4) (&x, &y); (obj.* pfm4) (&x, &y);
return 0; return fail;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment