* g++.dg/other/pr35504.C: Add check for thiscall.
* g++.dg/torture/stackalign/eh-thiscall-1.C: New.
* gcc.dg/torture/stackalign/thiscall-1.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158153
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-04-09 Kai Tietz <kai.tietz@onevision.com>
+
+ * g++.dg/other/pr35504.C: Add check for thiscall.
+ * g++.dg/torture/stackalign/eh-thiscall-1.C: New.
+ * gcc.dg/torture/stackalign/thiscall-1.c: New.
+
2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/28584
#define ATTR5 __attribute__((__stdcall__))
#define ATTR6 __attribute__((__cdecl__))
#define ATTR7
+#define ATTR8 __attribute__((__thiscall__))
extern "C" void abort (void);
{
return ret;
}
+
+ virtual ATTR8 struct long_struct method8 ()
+ {
+ return ret;
+ }
};
class c3:c1, public c2
{
return check_this (7);
}
+
+ virtual ATTR8 struct long_struct method8 ()
+ {
+ return check_this (7);
+ }
};
class c3 c3_instance;
c2_ptr->method5 ();
c2_ptr->method6 ();
c2_ptr->method7 ();
+ c2_ptr->method8 ();
return 0;
}
--- /dev/null
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+class Base {};
+
+struct A : virtual public Base
+{
+ A() {}
+};
+
+struct B {};
+
+__attribute__ ((thiscall))
+void
+foo (int j, int k, int m, int n, int o) throw (B,A)
+{
+ aligned i;
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+
+ if (i != 20 || j != 1 || k != 2 || m != 3 || n != 4 || o != 5)
+ abort ();
+
+ throw A();
+}
+
+int
+main()
+{
+ try { foo (1, 2, 3, 4, 5); }
+ catch (A& a) { }
+ return 0;
+}
--- /dev/null
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+__attribute__ ((thiscall))
+void
+foo (int j, int k, int m, int n, int o)
+{
+ aligned i;
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+
+ if (i != 20 || j != 1 || k != 2 || m != 3 || n != 4 || o != 5)
+ abort ();
+}
+
+int
+main()
+{
+ foo (1, 2, 3, 4, 5);
+ return 0;
+}