summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/rtti-layout.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-06-02 15:44:35 +0000
committerAnders Carlsson <andersca@mac.com>2010-06-02 15:44:35 +0000
commita85c1469c795df27ef2f883dde84f530de560582 (patch)
tree67e3d80fb47dea74b3164d3881e1ed9af17d1338 /clang/test/CodeGenCXX/rtti-layout.cpp
parent7881a64a5054e1334b555d678170d1c5ac1a5a93 (diff)
downloadbcm5719-llvm-a85c1469c795df27ef2f883dde84f530de560582.tar.gz
bcm5719-llvm-a85c1469c795df27ef2f883dde84f530de560582.zip
When building RTTI descriptors for pointer types, we need to get the unqualified array type and the qualifiers from it.
llvm-svn: 105326
Diffstat (limited to 'clang/test/CodeGenCXX/rtti-layout.cpp')
-rw-r--r--clang/test/CodeGenCXX/rtti-layout.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/rtti-layout.cpp b/clang/test/CodeGenCXX/rtti-layout.cpp
index 1ad87fbc7ef..7128c4e4d07 100644
--- a/clang/test/CodeGenCXX/rtti-layout.cpp
+++ b/clang/test/CodeGenCXX/rtti-layout.cpp
@@ -93,6 +93,14 @@ struct VMI7 : VMIBase1, VMI5, private VMI6 { };
#define CHECK_BASE_INFO_TYPE(type, index, base) CHECK(to<__vmi_class_type_info>(typeid(type)).__base_info[(index)].__base_type == &typeid(base))
#define CHECK_BASE_INFO_OFFSET_FLAGS(type, index, offset, flags) CHECK(to<__vmi_class_type_info>(typeid(type)).__base_info[(index)].__offset_flags == (((offset) << 8) | (flags)))
+struct B {
+ static int const volatile (*a)[10];
+ static int (*b)[10];
+
+ static int const volatile (B::*c)[10];
+ static int (B::*d)[10];
+};
+
// CHECK: define i32 @_Z1fv()
int f() {
// Vectors should be treated as fundamental types.
@@ -168,6 +176,12 @@ int f() {
CHECK(to<__pbase_type_info>(typeid(Incomplete Incomplete::*)).__flags == (__pbase_type_info::__incomplete_class_mask | __pbase_type_info::__incomplete_mask));
CHECK(to<__pbase_type_info>(typeid(Incomplete A::*)).__flags == (__pbase_type_info::__incomplete_mask));
+ // Check that when stripping qualifiers off the pointee type, we correctly handle arrays.
+ CHECK(to<__pbase_type_info>(typeid(B::a)).__flags == (__pbase_type_info::__const_mask | __pbase_type_info::__volatile_mask));
+ CHECK(to<__pbase_type_info>(typeid(B::a)).__pointee == to<__pbase_type_info>(typeid(B::b)).__pointee);
+ CHECK(to<__pbase_type_info>(typeid(B::c)).__flags == (__pbase_type_info::__const_mask | __pbase_type_info::__volatile_mask));
+ CHECK(to<__pbase_type_info>(typeid(B::c)).__pointee == to<__pbase_type_info>(typeid(B::d)).__pointee);
+
// Success!
// CHECK: ret i32 0
return 0;
OpenPOWER on IntegriCloud