summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-03-15 04:25:12 +0000
committerGreg Clayton <gclayton@apple.com>2011-03-15 04:25:12 +0000
commit8f67fd10e950630611b6f3d206fb2f54b8f6000f (patch)
tree1258f888c2ae08fad53f2afe96c0ae944de27f91
parent616f490777a4f35269a23abee851680134050065 (diff)
downloadbcm5719-llvm-8f67fd10e950630611b6f3d206fb2f54b8f6000f.tar.gz
bcm5719-llvm-8f67fd10e950630611b6f3d206fb2f54b8f6000f.zip
Added a test case for unique types. In the test case there are two std::vector
types that have different contents. Currently LLDB is incorrectly uniquing, on MacOSX, the std::vector _VectorImpl class from the two different vector templates. The DWARF looks like: 0x0000008e: DW_TAG_structure_type [7] * DW_AT_name( "_Vector_base<int,std::allocator<int> >" ) DW_AT_declaration( 0x01 ) DW_AT_sibling( {0x00000103} ) 0x00000098: DW_TAG_structure_type [8] * DW_AT_name( "_Vector_impl" ) DW_AT_byte_size( 0x18 ) DW_AT_decl_file( "/usr/include/c++/4.2.1/bits/stl_vector.h" ) DW_AT_decl_line( 83 ) 0x000000a0: DW_TAG_inheritance [9] DW_AT_type( {0x000006fa} ( allocator<int> ) ) DW_AT_data_member_location( +0 ) DW_AT_accessibility( DW_ACCESS_public ) 0x0000011b: DW_TAG_structure_type [7] * DW_AT_name( "_Vector_base<short int,std::allocator<short int> >" ) DW_AT_declaration( 0x01 ) DW_AT_sibling( {0x00000190} ) 0x00000125: DW_TAG_structure_type [8] * DW_AT_name( "_Vector_impl" ) DW_AT_byte_size( 0x18 ) DW_AT_decl_file( "/usr/include/c++/4.2.1/bits/stl_vector.h" ) DW_AT_decl_line( 83 ) 0x0000012d: DW_TAG_inheritance [9] DW_AT_type( {0x00000f75} ( allocator<short int> ) ) DW_AT_data_member_location( +0 ) DW_AT_accessibility( DW_ACCESS_public ) In this case it using DIE 0x00000098 for both 0x00000098 and 0x00000125. This test will help detect this issue once I have a fix for it. I have a fix that I am testing. llvm-svn: 127660
-rw-r--r--lldb/test/unique-types/Makefile5
-rw-r--r--lldb/test/unique-types/main.cpp16
2 files changed, 21 insertions, 0 deletions
diff --git a/lldb/test/unique-types/Makefile b/lldb/test/unique-types/Makefile
new file mode 100644
index 00000000000..d4bc9c68904
--- /dev/null
+++ b/lldb/test/unique-types/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules
diff --git a/lldb/test/unique-types/main.cpp b/lldb/test/unique-types/main.cpp
new file mode 100644
index 00000000000..536bf6cd9de
--- /dev/null
+++ b/lldb/test/unique-types/main.cpp
@@ -0,0 +1,16 @@
+#include <vector>
+
+#include <stdio.h>
+#include <stdint.h>
+
+int main (int argc, char const *argv[], char const *envp[])
+{
+ std::vector<int> ints;
+ std::vector<short> shorts;
+ for (int i=0; i<12; i++)
+ {
+ ints.push_back(i);
+ shorts.push_back((short)i);
+ }
+ return 0;
+}
OpenPOWER on IntegriCloud