[llvm] r260111 - Add a unit test for r259973.
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 8 11:11:58 PST 2016
On Mon, Feb 8, 2016 at 9:02 AM, Adrian Prantl via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
> Author: adrian
> Date: Mon Feb 8 11:02:34 2016
> New Revision: 260111
>
> URL: http://llvm.org/viewvc/llvm-project?rev=260111&view=rev
> Log:
> Add a unit test for r259973.
>
> Modified:
> llvm/trunk/unittests/IR/MetadataTest.cpp
>
> Modified: llvm/trunk/unittests/IR/MetadataTest.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/MetadataTest.cpp?rev=260111&r1=260110&r2=260111&view=diff
>
> ==============================================================================
> --- llvm/trunk/unittests/IR/MetadataTest.cpp (original)
> +++ llvm/trunk/unittests/IR/MetadataTest.cpp Mon Feb 8 11:02:34 2016
> @@ -2073,6 +2073,26 @@ TEST_F(ValueAsMetadataTest, UpdatesOnRAU
> EXPECT_TRUE(MD->getValue() == GV1.get());
> }
>
> +TEST_F(ValueAsMetadataTest, TempTempReplacement) {
> + // Create a constant.
> + ConstantAsMetadata *CI = ConstantAsMetadata::get(
> + ConstantInt::get(getGlobalContext(), APInt(8, 0)));
> +
> + Metadata *Ops1[] = {CI};
>
Doesn't seem to be any need to create these named arrays - you could just
replace Ops1 with {CI} below, I think?
> + auto Temp1 = MDTuple::getTemporary(Context, None);
> + auto Temp2 = MDTuple::getTemporary(Context, Ops1);
> +
> + Metadata *Ops2[] = {Temp1.get()};
> + auto *N = MDTuple::get(Context, Ops2);
> +
> + // Test replacing a temporary node with another temporary node.
> + Temp1->replaceAllUsesWith(Temp2.get());
> + EXPECT_EQ(N->getOperand(0), Temp2.get());
> +
> + // Clean up Temp2 for teardown.
> + Temp2->replaceAllUsesWith(nullptr);
> +}
> +
> TEST_F(ValueAsMetadataTest, CollidingDoubleUpdates) {
> // Create a constant.
> ConstantAsMetadata *CI = ConstantAsMetadata::get(
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160208/39ea9831/attachment.html>
More information about the llvm-commits
mailing list