This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Add testcase for PR sanitizer/65000


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]