Support: Fix tests for VirtualityString

Since these `dwarf` functions return `const char *`, the tests need to
use `StringRef` for checks.  Should fix, e.g., hexagon [1].

[1]: http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/22435

llvm-svn: 228478
This commit is contained in:
Duncan P. N. Exon Smith 2015-02-07 01:07:30 +00:00
parent 669d9486f9
commit 7f95aacfe6
1 changed files with 7 additions and 4 deletions

View File

@ -96,13 +96,16 @@ TEST(DwarfTest, getAttributeEncoding) {
}
TEST(DwarfTest, VirtualityString) {
EXPECT_EQ("DW_VIRTUALITY_none", VirtualityString(DW_VIRTUALITY_none));
EXPECT_EQ("DW_VIRTUALITY_virtual", VirtualityString(DW_VIRTUALITY_virtual));
EXPECT_EQ("DW_VIRTUALITY_pure_virtual",
EXPECT_EQ(StringRef("DW_VIRTUALITY_none"),
VirtualityString(DW_VIRTUALITY_none));
EXPECT_EQ(StringRef("DW_VIRTUALITY_virtual"),
VirtualityString(DW_VIRTUALITY_virtual));
EXPECT_EQ(StringRef("DW_VIRTUALITY_pure_virtual"),
VirtualityString(DW_VIRTUALITY_pure_virtual));
// DW_VIRTUALITY_max should be pure virtual.
EXPECT_EQ("DW_VIRTUALITY_pure_virtual", VirtualityString(DW_VIRTUALITY_max));
EXPECT_EQ(StringRef("DW_VIRTUALITY_pure_virtual"),
VirtualityString(DW_VIRTUALITY_max));
// Invalid numbers shouldn't be stringified.
EXPECT_EQ(nullptr, VirtualityString(DW_VIRTUALITY_max + 1));