diff options
| author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-02-03 21:08:33 +0000 |
|---|---|---|
| committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-02-03 21:08:33 +0000 |
| commit | b036f1c98caf4742aa8e66a4831841d635e3f008 (patch) | |
| tree | 959075c3510a8465103e12910b7753c0496ae6c7 /llvm/unittests/Support | |
| parent | 5b67ed496ee74a2ebfc88549cfe23851c9a555d4 (diff) | |
| download | bcm5719-llvm-b036f1c98caf4742aa8e66a4831841d635e3f008.tar.gz bcm5719-llvm-b036f1c98caf4742aa8e66a4831841d635e3f008.zip | |
Support: Stop stringifying DW_TAG_{lo,hi}_user
`dwarf::TagString()` shouldn't stringify `DW_TAG_lo_user` or
`DW_TAG_hi_user`. These aren't actual tags; they're markers for the
edge of vendor-specific tag regions.
llvm-svn: 228029
Diffstat (limited to 'llvm/unittests/Support')
| -rw-r--r-- | llvm/unittests/Support/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | llvm/unittests/Support/DwarfTest.cpp | 29 |
2 files changed, 30 insertions, 0 deletions
diff --git a/llvm/unittests/Support/CMakeLists.txt b/llvm/unittests/Support/CMakeLists.txt index dd270ccea42..214972ef8a9 100644 --- a/llvm/unittests/Support/CMakeLists.txt +++ b/llvm/unittests/Support/CMakeLists.txt @@ -13,6 +13,7 @@ add_llvm_unittest(SupportTests CompressionTest.cpp ConvertUTFTest.cpp DataExtractorTest.cpp + DwarfTest.cpp EndianTest.cpp ErrorOrTest.cpp FileOutputBufferTest.cpp diff --git a/llvm/unittests/Support/DwarfTest.cpp b/llvm/unittests/Support/DwarfTest.cpp new file mode 100644 index 00000000000..9b141601b20 --- /dev/null +++ b/llvm/unittests/Support/DwarfTest.cpp @@ -0,0 +1,29 @@ +//===- unittest/Support/DwarfTest.cpp - Dwarf support tests ---------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "llvm/Support/Dwarf.h" +#include "gtest/gtest.h" + +using namespace llvm; +using namespace llvm::dwarf; + +namespace { + +TEST(DwarfTest, TagStringOnInvalid) { + // This is invalid, so it shouldn't be stringified. + EXPECT_EQ(nullptr, 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)); +} + +} // end namespace |

