aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/g++.dg/other/pr35504.C12
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/eh-thiscall-1.C43
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/thiscall-1.c31
4 files changed, 92 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 17277cf..09aa4cc 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+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
diff --git a/gcc/testsuite/g++.dg/other/pr35504.C b/gcc/testsuite/g++.dg/other/pr35504.C
index 09c13fd..58422f2 100644
--- a/gcc/testsuite/g++.dg/other/pr35504.C
+++ b/gcc/testsuite/g++.dg/other/pr35504.C
@@ -8,6 +8,7 @@
#define ATTR5 __attribute__((__stdcall__))
#define ATTR6 __attribute__((__cdecl__))
#define ATTR7
+#define ATTR8 __attribute__((__thiscall__))
extern "C" void abort (void);
@@ -69,6 +70,11 @@ public:
{
return ret;
}
+
+ virtual ATTR8 struct long_struct method8 ()
+ {
+ return ret;
+ }
};
class c3:c1, public c2
@@ -126,6 +132,11 @@ public:
{
return check_this (7);
}
+
+ virtual ATTR8 struct long_struct method8 ()
+ {
+ return check_this (7);
+ }
};
class c3 c3_instance;
@@ -142,6 +153,7 @@ main ()
c2_ptr->method5 ();
c2_ptr->method6 ();
c2_ptr->method7 ();
+ c2_ptr->method8 ();
return 0;
}
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/eh-thiscall-1.C b/gcc/testsuite/g++.dg/torture/stackalign/eh-thiscall-1.C
new file mode 100644
index 0000000..de9bed5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/eh-thiscall-1.C
@@ -0,0 +1,43 @@
+/* { 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;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/thiscall-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/thiscall-1.c
new file mode 100644
index 0000000..6f22e07
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/thiscall-1.c
@@ -0,0 +1,31 @@
+/* { 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;
+}