| Index: tools/clang/blink_gc_plugin/tests/destructor_eagerly_finalized.cpp
|
| diff --git a/tools/clang/blink_gc_plugin/tests/destructor_eagerly_finalized.cpp b/tools/clang/blink_gc_plugin/tests/destructor_eagerly_finalized.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..07409cc3ab36b48cbc905e5a78a7c7013608e38f
|
| --- /dev/null
|
| +++ b/tools/clang/blink_gc_plugin/tests/destructor_eagerly_finalized.cpp
|
| @@ -0,0 +1,37 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "destructor_eagerly_finalized.h"
|
| +
|
| +namespace blink {
|
| +
|
| +HeapObjectEagerFinalized::~HeapObjectEagerFinalized()
|
| +{
|
| + // Valid access to a non-eagerly finalized field
|
| + m_obj->foo();
|
| +}
|
| +
|
| +void HeapObjectEagerFinalized::trace(Visitor* visitor)
|
| +{
|
| + visitor->trace(m_obj);
|
| +}
|
| +
|
| +HeapObjectEagerFinalizedAlso::~HeapObjectEagerFinalizedAlso()
|
| +{
|
| + // Valid access to a non-eagerly finalized field
|
| + m_heapObject->foo();
|
| +
|
| + // Non-valid accesses to eagerly finalized fields.
|
| + m_heapObjectFinalized->foo();
|
| + m_heapVector[0]->foo();
|
| +}
|
| +
|
| +void HeapObjectEagerFinalizedAlso::trace(Visitor* visitor)
|
| +{
|
| + visitor->trace(m_heapObject);
|
| + visitor->trace(m_heapObjectFinalized);
|
| + visitor->trace(m_heapVector);
|
| +}
|
| +
|
| +} // namespace blink
|
|
|