summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-21 12:59:06 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-21 12:59:06 +0000
commit98154846568061a379099dc36ace942b0f07e826 (patch)
tree1d489ceef638d5a2452b97cc182f9c3fcf0a78e3 /gcc/testsuite/g++.dg
parent65e83e609ed2a9a4247780f645bba240b7a848d6 (diff)
downloadgcc-98154846568061a379099dc36ace942b0f07e826.tar.gz
PR target/30230
* config/ia64/ia64.c (ia64_add_bundle_selector_before): New function. (bundling): Use it. * g++.dg/eh/ia64-2.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120103 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg')
-rw-r--r--gcc/testsuite/g++.dg/eh/ia64-2.C57
1 files changed, 57 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/eh/ia64-2.C b/gcc/testsuite/g++.dg/eh/ia64-2.C
new file mode 100644
index 00000000000..0390bc88305
--- /dev/null
+++ b/gcc/testsuite/g++.dg/eh/ia64-2.C
@@ -0,0 +1,57 @@
+// PR target/30230
+// This testcase failed on IA-64, where end of an EH region ended
+// in the middle of a bundle (with br.call insn in first or second
+// slot of .bbb/.mbb bundles and EH region end right after it).
+// But br.call returns to the start of the next bundlem so during
+// unwinding the call was considered to be outside of the EH region
+// while it should have been inside.
+// { dg-options "-O2" }
+// { dg-do run }
+
+struct A {};
+struct B { virtual ~B(); };
+B::~B () {}
+struct C { void foo (short &, B &); };
+struct D { void *d1; C *d2; virtual void virt (void) {} };
+struct E { D *e1; B *e2; };
+struct F { void bar (void *, B &); };
+F *p __attribute__((weak));
+volatile int r;
+
+void C::foo (short &x, B &)
+{
+ if (r)
+ throw A ();
+ x = 1;
+}
+
+void F::bar (void *, B &)
+{
+ throw A ();
+}
+
+void baz (E &x)
+{
+ short g = 0;
+ B b = *x.e2;
+ x.e1->d2->foo (g, b);
+ if (g)
+ p->bar(x.e1->d1, b);
+}
+
+int main ()
+{
+ F g;
+ D s;
+ E h;
+ p = &g;
+ h.e1 = &s;
+ try
+ {
+ baz (h);
+ }
+ catch (A &)
+ {
+ }
+ return 0;
+}