summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/DwarfTest.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-10-05 05:59:29 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-10-05 05:59:29 +0000
commit149f6eaed9818057b83d8f0b17bb5e8764a13143 (patch)
treeb0b1a0063de2bc0dfc3db17266a1d477be54c844 /llvm/unittests/Support/DwarfTest.cpp
parentefe40389c0e82cf173f88979c56420dfeba6b8ed (diff)
downloadbcm5719-llvm-149f6eaed9818057b83d8f0b17bb5e8764a13143.tar.gz
bcm5719-llvm-149f6eaed9818057b83d8f0b17bb5e8764a13143.zip
Re-commit "Use StringRef in Support/Darf APIs (NFC)"
This reverts commit r283285 and re-commit r283275 with a fix for format("%s", Str); where Str is a StringRef. llvm-svn: 283298
Diffstat (limited to 'llvm/unittests/Support/DwarfTest.cpp')
-rw-r--r--llvm/unittests/Support/DwarfTest.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/llvm/unittests/Support/DwarfTest.cpp b/llvm/unittests/Support/DwarfTest.cpp
index 74fcc989b45..148ea2736e1 100644
--- a/llvm/unittests/Support/DwarfTest.cpp
+++ b/llvm/unittests/Support/DwarfTest.cpp
@@ -17,13 +17,13 @@ namespace {
TEST(DwarfTest, TagStringOnInvalid) {
// This is invalid, so it shouldn't be stringified.
- EXPECT_EQ(nullptr, TagString(DW_TAG_invalid));
+ EXPECT_EQ(StringRef(), TagString(DW_TAG_invalid));
// These aren't really tags: they describe ranges within tags. They
// shouldn't be stringified either.
- EXPECT_EQ(nullptr, TagString(DW_TAG_lo_user));
- EXPECT_EQ(nullptr, TagString(DW_TAG_hi_user));
- EXPECT_EQ(nullptr, TagString(DW_TAG_user_base));
+ EXPECT_EQ(StringRef(), TagString(DW_TAG_lo_user));
+ EXPECT_EQ(StringRef(), TagString(DW_TAG_hi_user));
+ EXPECT_EQ(StringRef(), TagString(DW_TAG_user_base));
}
TEST(DwarfTest, getTag) {
@@ -58,12 +58,12 @@ TEST(DwarfTest, getOperationEncoding) {
TEST(DwarfTest, LanguageStringOnInvalid) {
// This is invalid, so it shouldn't be stringified.
- EXPECT_EQ(nullptr, LanguageString(0));
+ EXPECT_EQ(StringRef(), LanguageString(0));
// These aren't really tags: they describe ranges within tags. They
// shouldn't be stringified either.
- EXPECT_EQ(nullptr, LanguageString(DW_LANG_lo_user));
- EXPECT_EQ(nullptr, LanguageString(DW_LANG_hi_user));
+ EXPECT_EQ(StringRef(), LanguageString(DW_LANG_lo_user));
+ EXPECT_EQ(StringRef(), LanguageString(DW_LANG_hi_user));
}
TEST(DwarfTest, getLanguage) {
@@ -85,12 +85,12 @@ TEST(DwarfTest, getLanguage) {
TEST(DwarfTest, AttributeEncodingStringOnInvalid) {
// This is invalid, so it shouldn't be stringified.
- EXPECT_EQ(nullptr, AttributeEncodingString(0));
+ EXPECT_EQ(StringRef(), AttributeEncodingString(0));
// These aren't really tags: they describe ranges within tags. They
// shouldn't be stringified either.
- EXPECT_EQ(nullptr, AttributeEncodingString(DW_ATE_lo_user));
- EXPECT_EQ(nullptr, AttributeEncodingString(DW_ATE_hi_user));
+ EXPECT_EQ(StringRef(), AttributeEncodingString(DW_ATE_lo_user));
+ EXPECT_EQ(StringRef(), AttributeEncodingString(DW_ATE_hi_user));
}
TEST(DwarfTest, getAttributeEncoding) {
@@ -122,8 +122,8 @@ TEST(DwarfTest, VirtualityString) {
VirtualityString(DW_VIRTUALITY_max));
// Invalid numbers shouldn't be stringified.
- EXPECT_EQ(nullptr, VirtualityString(DW_VIRTUALITY_max + 1));
- EXPECT_EQ(nullptr, VirtualityString(DW_VIRTUALITY_max + 77));
+ EXPECT_EQ(StringRef(), VirtualityString(DW_VIRTUALITY_max + 1));
+ EXPECT_EQ(StringRef(), VirtualityString(DW_VIRTUALITY_max + 77));
}
TEST(DwarfTest, getVirtuality) {
OpenPOWER on IntegriCloud