From 3f25ee080ca7c92ff735df29c78e7cfbd62c8cb6 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 24 Jul 2011 20:44:30 +0000 Subject: Add Twine support for characters, and switch twine to use a union internally to eliminate some casting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135888 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/ADT/TwineTest.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'unittests') diff --git a/unittests/ADT/TwineTest.cpp b/unittests/ADT/TwineTest.cpp index 57f54cb006..e9cc41d13f 100644 --- a/unittests/ADT/TwineTest.cpp +++ b/unittests/ADT/TwineTest.cpp @@ -37,12 +37,16 @@ TEST(TwineTest, Numbers) { EXPECT_EQ("-123", Twine(-123).str()); EXPECT_EQ("123", Twine(123).str()); EXPECT_EQ("-123", Twine(-123).str()); - EXPECT_EQ("123", Twine((char) 123).str()); - EXPECT_EQ("-123", Twine((signed char) -123).str()); EXPECT_EQ("7b", Twine::utohexstr(123).str()); } +TEST(TwineTest, Characters) { + EXPECT_EQ("x", Twine('x').str()); + EXPECT_EQ("x", Twine(static_cast('x')).str()); + EXPECT_EQ("x", Twine(static_cast('x')).str()); +} + TEST(TwineTest, Concat) { // Check verse repr, since we care about the actual representation not just // the result. -- cgit v1.2.3