[libcxxabi] Cleanup memory in tests to placate ASAN.

Summary: ASAN fires on these tests because they don't clean up their memory.

Reviewers: danalbert, jroelofs, mclow.lists

Reviewed By: jroelofs

Subscribers: dblaikie, cfe-commits

Differential Revision: http://reviews.llvm.org/D6281

git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@222493 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/inherited_exception.cpp b/test/inherited_exception.cpp
index 090ae97..7c106c1 100644
--- a/test/inherited_exception.cpp
+++ b/test/inherited_exception.cpp
@@ -56,11 +56,11 @@
 }
 
 void f3() {
-  Child* child  = new Child;
-  child->b1 = 10;
-  child->b2 = 11;
-  child->c = 12;
-  throw static_cast<Base2*>(child);
+  static Child child;
+  child.b1 = 10;
+  child.b2 = 11;
+  child.c = 12;
+  throw static_cast<Base2*>(&child);
 }
 
 int main()