This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Add testcase for PR sanitizer/65000
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 12 Feb 2015 22:23:24 +0100
- Subject: [PATCH] Add testcase for PR sanitizer/65000
- Authentication-results: sourceware.org; auth=none
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
This patch adds testcase for the PR you've fixed. Bootstrapped/regtested on
x86_64-linux and i686-linux, additionally tested with your patch reverted,
where the testcase fails.
Ok for trunk?
2015-02-12 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/65000
* g++.dg/ubsan/pr65000.C: New test.
--- gcc/testsuite/g++.dg/ubsan/pr65000.C.jj 2015-02-12 14:23:00.908487082 +0100
+++ gcc/testsuite/g++.dg/ubsan/pr65000.C 2015-02-12 14:21:35.000000000 +0100
@@ -0,0 +1,14 @@
+// PR sanitizer/65000
+// { dg-do compile }
+// { dg-options "-O1 -fsanitize=undefined -fno-sanitize-recover" }
+
+struct B { virtual ~B () {} void foo (); };
+struct C { virtual ~C (); };
+struct A : public virtual C {};
+struct D : A { ~D () { d.foo (); } B d; };
+
+void
+bar ()
+{
+ D a;
+}
Jakub