Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
cfe/trunk/test/CodeGenCXX/const-init-cxx11.cpp
Show First 20 Lines • Show All 337 Lines • ▼ Show 20 Lines | namespace VirtualMembers { | ||||
struct D : C, A, B { | struct D : C, A, B { | ||||
constexpr D() : A(1.0), B(), s(5) {} | constexpr D() : A(1.0), B(), s(5) {} | ||||
short s; | short s; | ||||
}; | }; | ||||
struct E : D, B { | struct E : D, B { | ||||
constexpr E() : B(3), c{'b','y','e'} {} | constexpr E() : B(3), c{'b','y','e'} {} | ||||
char c[3]; | char c[3]; | ||||
}; | }; | ||||
// CHECK: @_ZN14VirtualMembers1eE = global { i8**, double, i32, i8**, double, [5 x i8], i16, i8**, double, [5 x i8], [3 x i8] } { i8** getelementptr inbounds ({ [3 x i8*], [4 x i8*], [4 x i8*] }, { [3 x i8*], [4 x i8*], [4 x i8*] }* @_ZTVN14VirtualMembers1EE, i32 0, i32 0, i32 2), double 1.000000e+00, i32 64, i8** getelementptr inbounds ({ [3 x i8*], [4 x i8*], [4 x i8*] }, { [3 x i8*], [4 x i8*], [4 x i8*] }* @_ZTVN14VirtualMembers1EE, i32 0, i32 1, i32 2), double 2.000000e+00, [5 x i8] c"hello", i16 5, i8** getelementptr inbounds ({ [3 x i8*], [4 x i8*], [4 x i8*] }, { [3 x i8*], [4 x i8*], [4 x i8*] }* @_ZTVN14VirtualMembers1EE, i32 0, i32 2, i32 2), double 3.000000e+00, [5 x i8] c"world", [3 x i8] c"bye" } | // CHECK: @_ZN14VirtualMembers1eE = global { i8**, double, i32, i8**, double, [5 x i8], i16, i8**, double, [5 x i8], [3 x i8] } { i8** getelementptr inbounds ({ [3 x i8*], [4 x i8*], [4 x i8*] }, { [3 x i8*], [4 x i8*], [4 x i8*] }* @_ZTVN14VirtualMembers1EE, i32 0, inrange i32 0, i32 2), double 1.000000e+00, i32 64, i8** getelementptr inbounds ({ [3 x i8*], [4 x i8*], [4 x i8*] }, { [3 x i8*], [4 x i8*], [4 x i8*] }* @_ZTVN14VirtualMembers1EE, i32 0, inrange i32 1, i32 2), double 2.000000e+00, [5 x i8] c"hello", i16 5, i8** getelementptr inbounds ({ [3 x i8*], [4 x i8*], [4 x i8*] }, { [3 x i8*], [4 x i8*], [4 x i8*] }* @_ZTVN14VirtualMembers1EE, i32 0, inrange i32 2, i32 2), double 3.000000e+00, [5 x i8] c"world", [3 x i8] c"bye" } | ||||
E e; | E e; | ||||
struct nsMemoryImpl { | struct nsMemoryImpl { | ||||
virtual void f(); | virtual void f(); | ||||
}; | }; | ||||
// CHECK: @_ZN14VirtualMembersL13sGlobalMemoryE = internal global { i8** } { i8** getelementptr inbounds ({ [3 x i8*] }, { [3 x i8*] }* @_ZTVN14VirtualMembers12nsMemoryImplE, i32 0, i32 0, i32 2) } | // CHECK: @_ZN14VirtualMembersL13sGlobalMemoryE = internal global { i8** } { i8** getelementptr inbounds ({ [3 x i8*] }, { [3 x i8*] }* @_ZTVN14VirtualMembers12nsMemoryImplE, i32 0, inrange i32 0, i32 2) } | ||||
__attribute__((used)) | __attribute__((used)) | ||||
static nsMemoryImpl sGlobalMemory; | static nsMemoryImpl sGlobalMemory; | ||||
template<class T> | template<class T> | ||||
struct TemplateClass { | struct TemplateClass { | ||||
constexpr TemplateClass() : t{42} {} | constexpr TemplateClass() : t{42} {} | ||||
virtual void templateMethod() {} | virtual void templateMethod() {} | ||||
T t; | T t; | ||||
}; | }; | ||||
// CHECK: @_ZN14VirtualMembers1tE = global { i8**, i32 } { i8** getelementptr inbounds ({ [3 x i8*] }, { [3 x i8*] }* @_ZTVN14VirtualMembers13TemplateClassIiEE, i32 0, i32 0, i32 2), i32 42 } | // CHECK: @_ZN14VirtualMembers1tE = global { i8**, i32 } { i8** getelementptr inbounds ({ [3 x i8*] }, { [3 x i8*] }* @_ZTVN14VirtualMembers13TemplateClassIiEE, i32 0, inrange i32 0, i32 2), i32 42 } | ||||
TemplateClass<int> t; | TemplateClass<int> t; | ||||
} | } | ||||
namespace PR13273 { | namespace PR13273 { | ||||
struct U { | struct U { | ||||
int t; | int t; | ||||
U() = default; | U() = default; | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 240 Lines • Show Last 20 Lines |