[PATCH] D21846: [Triple] Reimplement isLittleEndian()
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 29 11:24:42 PDT 2016
On Wed, Jun 29, 2016 at 10:59 AM, Rafael Ávila de Espíndola
<rafael.espindola at gmail.com> wrote:
> rafael accepted this revision.
> rafael added a comment.
> This revision is now accepted and ready to land.
>
> LGTM, but can you add a unit test showing that we now produce the correct answer for ARM?
>
>
> http://reviews.llvm.org/D21846
>
>
how does this look?
diff --git a/unittests/ADT/TripleTest.cpp b/unittests/ADT/TripleTest.cpp
index 294fcf5..4f3ec1b 100644
--- a/unittests/ADT/TripleTest.cpp
+++ b/unittests/ADT/TripleTest.cpp
@@ -643,6 +643,14 @@ TEST(TripleTest, EndianArchVariants) {
T.setArch(Triple::arm);
EXPECT_EQ(Triple::UnknownArch, T.getBigEndianArchVariant().getArch());
EXPECT_EQ(Triple::arm, T.getLittleEndianArchVariant().getArch());
+ T = Triple("arm");
+ EXPECT_TRUE(T.isLittleEndian());
+ T = Triple("thumb");
+ EXPECT_TRUE(T.isLittleEndian());
+ T = Triple("armeb");
+ EXPECT_FALSE(T.isLittleEndian());
+ T = Triple("thumbeb");
+ EXPECT_FALSE(T.isLittleEndian());
T.setArch(Triple::bpfeb);
EXPECT_EQ(Triple::bpfeb, T.getBigEndianArchVariant().getArch());
Thanks,
--
Davide
More information about the llvm-commits
mailing list