diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-02-13 01:05:00 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-02-13 01:05:00 +0000 |
commit | 3b631d291efec2b8b1ef2f20d63e2b31d2bd8254 (patch) | |
tree | 447e20d6c627163d127bf17419675b2afa0e62aa /llvm/unittests/Support/DwarfTest.cpp | |
parent | 8f46ee61c10d57a95d565629c7b81250d6dba3bb (diff) | |
download | bcm5719-llvm-3b631d291efec2b8b1ef2f20d63e2b31d2bd8254.tar.gz bcm5719-llvm-3b631d291efec2b8b1ef2f20d63e2b31d2bd8254.zip |
Support: Add dwarf::getOperationEncoding()
llvm-svn: 229001
Diffstat (limited to 'llvm/unittests/Support/DwarfTest.cpp')
-rw-r--r-- | llvm/unittests/Support/DwarfTest.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/unittests/Support/DwarfTest.cpp b/llvm/unittests/Support/DwarfTest.cpp index 5352982aa13..74fcc989b45 100644 --- a/llvm/unittests/Support/DwarfTest.cpp +++ b/llvm/unittests/Support/DwarfTest.cpp @@ -42,6 +42,20 @@ TEST(DwarfTest, getTag) { EXPECT_EQ(DW_TAG_invalid, getTag("DW_TAG_user_base")); } +TEST(DwarfTest, getOperationEncoding) { + // Some valid ops. + EXPECT_EQ(DW_OP_deref, getOperationEncoding("DW_OP_deref")); + EXPECT_EQ(DW_OP_bit_piece, getOperationEncoding("DW_OP_bit_piece")); + + // Invalid ops. + EXPECT_EQ(0u, getOperationEncoding("DW_OP_otherthings")); + EXPECT_EQ(0u, getOperationEncoding("other")); + + // Markers shouldn't be recognized. + EXPECT_EQ(0u, getOperationEncoding("DW_OP_lo_user")); + EXPECT_EQ(0u, getOperationEncoding("DW_OP_hi_user")); +} + TEST(DwarfTest, LanguageStringOnInvalid) { // This is invalid, so it shouldn't be stringified. EXPECT_EQ(nullptr, LanguageString(0)); |