forked from OSchip/llvm-project
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:
parent
669d9486f9
commit
7f95aacfe6
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue