diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:06:01 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:06:01 +0000 |
commit | 486754660bb926339aefcf012a3f848592babb8b (patch) | |
tree | ecdbc446c9876f4f120f701c243373cd3cb43db3 /test/CodeGenCXX | |
parent | 55e6d896ad333f07bb3b1ba487df214fc268a4ab (diff) |
Notes
Diffstat (limited to 'test/CodeGenCXX')
283 files changed, 9532 insertions, 4621 deletions
diff --git a/test/CodeGenCXX/Inputs/override-bit-field-layout.layout b/test/CodeGenCXX/Inputs/override-bit-field-layout.layout new file mode 100644 index 0000000000000..8e67dce65026b --- /dev/null +++ b/test/CodeGenCXX/Inputs/override-bit-field-layout.layout @@ -0,0 +1,16 @@ + +*** Dumping AST Record Layout +Type: struct S1 + +Layout: <ASTRecordLayout + Size:16 + Alignment:16 + FieldOffsets: [0, 11]> + +*** Dumping AST Record Layout +Type: struct S2 + +Layout: <ASTRecordLayout + Size:128 + Alignment:64 + FieldOffsets: [64]> diff --git a/test/CodeGenCXX/Inputs/std-compare.h b/test/CodeGenCXX/Inputs/std-compare.h new file mode 100644 index 0000000000000..a6ab605bb5276 --- /dev/null +++ b/test/CodeGenCXX/Inputs/std-compare.h @@ -0,0 +1,437 @@ +#ifndef STD_COMPARE_H +#define STD_COMPARE_H + +namespace std { +inline namespace __1 { + +// exposition only +enum class _EqResult : unsigned char { + __zero = 0, + __equal = __zero, + __equiv = __equal, + __nonequal = 1, + __nonequiv = __nonequal +}; + +enum class _OrdResult : signed char { + __less = -1, + __greater = 1 +}; + +enum class _NCmpResult : signed char { + __unordered = -127 +}; + +struct _CmpUnspecifiedType; +using _CmpUnspecifiedParam = void (_CmpUnspecifiedType::*)(); + +class weak_equality { + constexpr explicit weak_equality(_EqResult __val) noexcept : __value_(__val) {} + +public: + static const weak_equality equivalent; + static const weak_equality nonequivalent; + + friend constexpr bool operator==(weak_equality __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator==(_CmpUnspecifiedParam, weak_equality __v) noexcept; + friend constexpr bool operator!=(weak_equality __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator!=(_CmpUnspecifiedParam, weak_equality __v) noexcept; + friend constexpr weak_equality operator<=>(weak_equality __v, _CmpUnspecifiedParam) noexcept; + friend constexpr weak_equality operator<=>(_CmpUnspecifiedParam, weak_equality __v) noexcept; + + // test helper + constexpr bool test_eq(weak_equality const &other) const noexcept { + return __value_ == other.__value_; + } + +private: + _EqResult __value_; +}; + +inline constexpr weak_equality weak_equality::equivalent(_EqResult::__equiv); +inline constexpr weak_equality weak_equality::nonequivalent(_EqResult::__nonequiv); +inline constexpr bool operator==(weak_equality __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ == _EqResult::__zero; +} +inline constexpr bool operator==(_CmpUnspecifiedParam, weak_equality __v) noexcept { + return __v.__value_ == _EqResult::__zero; +} +inline constexpr bool operator!=(weak_equality __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ != _EqResult::__zero; +} +inline constexpr bool operator!=(_CmpUnspecifiedParam, weak_equality __v) noexcept { + return __v.__value_ != _EqResult::__zero; +} + +inline constexpr weak_equality operator<=>(weak_equality __v, _CmpUnspecifiedParam) noexcept { + return __v; +} +inline constexpr weak_equality operator<=>(_CmpUnspecifiedParam, weak_equality __v) noexcept { + return __v; +} + +class strong_equality { + explicit constexpr strong_equality(_EqResult __val) noexcept : __value_(__val) {} + +public: + static const strong_equality equal; + static const strong_equality nonequal; + static const strong_equality equivalent; + static const strong_equality nonequivalent; + + // conversion + constexpr operator weak_equality() const noexcept { + return __value_ == _EqResult::__zero ? weak_equality::equivalent + : weak_equality::nonequivalent; + } + + // comparisons + friend constexpr bool operator==(strong_equality __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator!=(strong_equality __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator==(_CmpUnspecifiedParam, strong_equality __v) noexcept; + friend constexpr bool operator!=(_CmpUnspecifiedParam, strong_equality __v) noexcept; + + friend constexpr strong_equality operator<=>(strong_equality __v, _CmpUnspecifiedParam) noexcept; + friend constexpr strong_equality operator<=>(_CmpUnspecifiedParam, strong_equality __v) noexcept; + + // test helper + constexpr bool test_eq(strong_equality const &other) const noexcept { + return __value_ == other.__value_; + } + +private: + _EqResult __value_; +}; + +inline constexpr strong_equality strong_equality::equal(_EqResult::__equal); +inline constexpr strong_equality strong_equality::nonequal(_EqResult::__nonequal); +inline constexpr strong_equality strong_equality::equivalent(_EqResult::__equiv); +inline constexpr strong_equality strong_equality::nonequivalent(_EqResult::__nonequiv); +constexpr bool operator==(strong_equality __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ == _EqResult::__zero; +} +constexpr bool operator==(_CmpUnspecifiedParam, strong_equality __v) noexcept { + return __v.__value_ == _EqResult::__zero; +} +constexpr bool operator!=(strong_equality __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ != _EqResult::__zero; +} +constexpr bool operator!=(_CmpUnspecifiedParam, strong_equality __v) noexcept { + return __v.__value_ != _EqResult::__zero; +} + +constexpr strong_equality operator<=>(strong_equality __v, _CmpUnspecifiedParam) noexcept { + return __v; +} +constexpr strong_equality operator<=>(_CmpUnspecifiedParam, strong_equality __v) noexcept { + return __v; +} + +class partial_ordering { + using _ValueT = signed char; + explicit constexpr partial_ordering(_EqResult __v) noexcept + : __value_(_ValueT(__v)) {} + explicit constexpr partial_ordering(_OrdResult __v) noexcept + : __value_(_ValueT(__v)) {} + explicit constexpr partial_ordering(_NCmpResult __v) noexcept + : __value_(_ValueT(__v)) {} + + constexpr bool __is_ordered() const noexcept { + return __value_ != _ValueT(_NCmpResult::__unordered); + } + +public: + // valid values + static const partial_ordering less; + static const partial_ordering equivalent; + static const partial_ordering greater; + static const partial_ordering unordered; + + // conversion + constexpr operator weak_equality() const noexcept { + return __value_ == 0 ? weak_equality::equivalent : weak_equality::nonequivalent; + } + + // comparisons + friend constexpr bool operator==(partial_ordering __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator!=(partial_ordering __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator<(partial_ordering __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator<=(partial_ordering __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator>(partial_ordering __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator>=(partial_ordering __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator==(_CmpUnspecifiedParam, partial_ordering __v) noexcept; + friend constexpr bool operator!=(_CmpUnspecifiedParam, partial_ordering __v) noexcept; + friend constexpr bool operator<(_CmpUnspecifiedParam, partial_ordering __v) noexcept; + friend constexpr bool operator<=(_CmpUnspecifiedParam, partial_ordering __v) noexcept; + friend constexpr bool operator>(_CmpUnspecifiedParam, partial_ordering __v) noexcept; + friend constexpr bool operator>=(_CmpUnspecifiedParam, partial_ordering __v) noexcept; + + friend constexpr partial_ordering operator<=>(partial_ordering __v, _CmpUnspecifiedParam) noexcept; + friend constexpr partial_ordering operator<=>(_CmpUnspecifiedParam, partial_ordering __v) noexcept; + + // test helper + constexpr bool test_eq(partial_ordering const &other) const noexcept { + return __value_ == other.__value_; + } + +private: + _ValueT __value_; +}; + +inline constexpr partial_ordering partial_ordering::less(_OrdResult::__less); +inline constexpr partial_ordering partial_ordering::equivalent(_EqResult::__equiv); +inline constexpr partial_ordering partial_ordering::greater(_OrdResult::__greater); +inline constexpr partial_ordering partial_ordering::unordered(_NCmpResult ::__unordered); +constexpr bool operator==(partial_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__is_ordered() && __v.__value_ == 0; +} +constexpr bool operator<(partial_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__is_ordered() && __v.__value_ < 0; +} +constexpr bool operator<=(partial_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__is_ordered() && __v.__value_ <= 0; +} +constexpr bool operator>(partial_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__is_ordered() && __v.__value_ > 0; +} +constexpr bool operator>=(partial_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__is_ordered() && __v.__value_ >= 0; +} +constexpr bool operator==(_CmpUnspecifiedParam, partial_ordering __v) noexcept { + return __v.__is_ordered() && 0 == __v.__value_; +} +constexpr bool operator<(_CmpUnspecifiedParam, partial_ordering __v) noexcept { + return __v.__is_ordered() && 0 < __v.__value_; +} +constexpr bool operator<=(_CmpUnspecifiedParam, partial_ordering __v) noexcept { + return __v.__is_ordered() && 0 <= __v.__value_; +} +constexpr bool operator>(_CmpUnspecifiedParam, partial_ordering __v) noexcept { + return __v.__is_ordered() && 0 > __v.__value_; +} +constexpr bool operator>=(_CmpUnspecifiedParam, partial_ordering __v) noexcept { + return __v.__is_ordered() && 0 >= __v.__value_; +} +constexpr bool operator!=(partial_ordering __v, _CmpUnspecifiedParam) noexcept { + return !__v.__is_ordered() || __v.__value_ != 0; +} +constexpr bool operator!=(_CmpUnspecifiedParam, partial_ordering __v) noexcept { + return !__v.__is_ordered() || __v.__value_ != 0; +} + +constexpr partial_ordering operator<=>(partial_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v; +} +constexpr partial_ordering operator<=>(_CmpUnspecifiedParam, partial_ordering __v) noexcept { + return __v < 0 ? partial_ordering::greater : (__v > 0 ? partial_ordering::less : __v); +} + +class weak_ordering { + using _ValueT = signed char; + explicit constexpr weak_ordering(_EqResult __v) noexcept : __value_(_ValueT(__v)) {} + explicit constexpr weak_ordering(_OrdResult __v) noexcept : __value_(_ValueT(__v)) {} + +public: + static const weak_ordering less; + static const weak_ordering equivalent; + static const weak_ordering greater; + + // conversions + constexpr operator weak_equality() const noexcept { + return __value_ == 0 ? weak_equality::equivalent + : weak_equality::nonequivalent; + } + constexpr operator partial_ordering() const noexcept { + return __value_ == 0 ? partial_ordering::equivalent + : (__value_ < 0 ? partial_ordering::less : partial_ordering::greater); + } + + // comparisons + friend constexpr bool operator==(weak_ordering __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator!=(weak_ordering __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator<(weak_ordering __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator<=(weak_ordering __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator>(weak_ordering __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator>=(weak_ordering __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator==(_CmpUnspecifiedParam, weak_ordering __v) noexcept; + friend constexpr bool operator!=(_CmpUnspecifiedParam, weak_ordering __v) noexcept; + friend constexpr bool operator<(_CmpUnspecifiedParam, weak_ordering __v) noexcept; + friend constexpr bool operator<=(_CmpUnspecifiedParam, weak_ordering __v) noexcept; + friend constexpr bool operator>(_CmpUnspecifiedParam, weak_ordering __v) noexcept; + friend constexpr bool operator>=(_CmpUnspecifiedParam, weak_ordering __v) noexcept; + + friend constexpr weak_ordering operator<=>(weak_ordering __v, _CmpUnspecifiedParam) noexcept; + friend constexpr weak_ordering operator<=>(_CmpUnspecifiedParam, weak_ordering __v) noexcept; + + // test helper + constexpr bool test_eq(weak_ordering const &other) const noexcept { + return __value_ == other.__value_; + } + +private: + _ValueT __value_; +}; + +inline constexpr weak_ordering weak_ordering::less(_OrdResult::__less); +inline constexpr weak_ordering weak_ordering::equivalent(_EqResult::__equiv); +inline constexpr weak_ordering weak_ordering::greater(_OrdResult::__greater); +constexpr bool operator==(weak_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ == 0; +} +constexpr bool operator!=(weak_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ != 0; +} +constexpr bool operator<(weak_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ < 0; +} +constexpr bool operator<=(weak_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ <= 0; +} +constexpr bool operator>(weak_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ > 0; +} +constexpr bool operator>=(weak_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ >= 0; +} +constexpr bool operator==(_CmpUnspecifiedParam, weak_ordering __v) noexcept { + return 0 == __v.__value_; +} +constexpr bool operator!=(_CmpUnspecifiedParam, weak_ordering __v) noexcept { + return 0 != __v.__value_; +} +constexpr bool operator<(_CmpUnspecifiedParam, weak_ordering __v) noexcept { + return 0 < __v.__value_; +} +constexpr bool operator<=(_CmpUnspecifiedParam, weak_ordering __v) noexcept { + return 0 <= __v.__value_; +} +constexpr bool operator>(_CmpUnspecifiedParam, weak_ordering __v) noexcept { + return 0 > __v.__value_; +} +constexpr bool operator>=(_CmpUnspecifiedParam, weak_ordering __v) noexcept { + return 0 >= __v.__value_; +} + +constexpr weak_ordering operator<=>(weak_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v; +} +constexpr weak_ordering operator<=>(_CmpUnspecifiedParam, weak_ordering __v) noexcept { + return __v < 0 ? weak_ordering::greater : (__v > 0 ? weak_ordering::less : __v); +} + +class strong_ordering { + using _ValueT = signed char; + explicit constexpr strong_ordering(_EqResult __v) noexcept : __value_(static_cast<signed char>(__v)) {} + explicit constexpr strong_ordering(_OrdResult __v) noexcept : __value_(static_cast<signed char>(__v)) {} + +public: + static const strong_ordering less; + static const strong_ordering equal; + static const strong_ordering equivalent; + static const strong_ordering greater; + + // conversions + constexpr operator weak_equality() const noexcept { + return __value_ == 0 ? weak_equality::equivalent + : weak_equality::nonequivalent; + } + constexpr operator strong_equality() const noexcept { + return __value_ == 0 ? strong_equality::equal + : strong_equality::nonequal; + } + constexpr operator partial_ordering() const noexcept { + return __value_ == 0 ? partial_ordering::equivalent + : (__value_ < 0 ? partial_ordering::less : partial_ordering::greater); + } + constexpr operator weak_ordering() const noexcept { + return __value_ == 0 ? weak_ordering::equivalent + : (__value_ < 0 ? weak_ordering::less : weak_ordering::greater); + } + + // comparisons + friend constexpr bool operator==(strong_ordering __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator!=(strong_ordering __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator<(strong_ordering __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator<=(strong_ordering __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator>(strong_ordering __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator>=(strong_ordering __v, _CmpUnspecifiedParam) noexcept; + friend constexpr bool operator==(_CmpUnspecifiedParam, strong_ordering __v) noexcept; + friend constexpr bool operator!=(_CmpUnspecifiedParam, strong_ordering __v) noexcept; + friend constexpr bool operator<(_CmpUnspecifiedParam, strong_ordering __v) noexcept; + friend constexpr bool operator<=(_CmpUnspecifiedParam, strong_ordering __v) noexcept; + friend constexpr bool operator>(_CmpUnspecifiedParam, strong_ordering __v) noexcept; + friend constexpr bool operator>=(_CmpUnspecifiedParam, strong_ordering __v) noexcept; + + friend constexpr strong_ordering operator<=>(strong_ordering __v, _CmpUnspecifiedParam) noexcept; + friend constexpr strong_ordering operator<=>(_CmpUnspecifiedParam, strong_ordering __v) noexcept; + + // test helper + constexpr bool test_eq(strong_ordering const &other) const noexcept { + return __value_ == other.__value_; + } + +private: + _ValueT __value_; +}; + +inline constexpr strong_ordering strong_ordering::less(_OrdResult::__less); +inline constexpr strong_ordering strong_ordering::equal(_EqResult::__equal); +inline constexpr strong_ordering strong_ordering::equivalent(_EqResult::__equiv); +inline constexpr strong_ordering strong_ordering::greater(_OrdResult::__greater); + +constexpr bool operator==(strong_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ == 0; +} +constexpr bool operator!=(strong_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ != 0; +} +constexpr bool operator<(strong_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ < 0; +} +constexpr bool operator<=(strong_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ <= 0; +} +constexpr bool operator>(strong_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ > 0; +} +constexpr bool operator>=(strong_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ >= 0; +} +constexpr bool operator==(_CmpUnspecifiedParam, strong_ordering __v) noexcept { + return 0 == __v.__value_; +} +constexpr bool operator!=(_CmpUnspecifiedParam, strong_ordering __v) noexcept { + return 0 != __v.__value_; +} +constexpr bool operator<(_CmpUnspecifiedParam, strong_ordering __v) noexcept { + return 0 < __v.__value_; +} +constexpr bool operator<=(_CmpUnspecifiedParam, strong_ordering __v) noexcept { + return 0 <= __v.__value_; +} +constexpr bool operator>(_CmpUnspecifiedParam, strong_ordering __v) noexcept { + return 0 > __v.__value_; +} +constexpr bool operator>=(_CmpUnspecifiedParam, strong_ordering __v) noexcept { + return 0 >= __v.__value_; +} + +constexpr strong_ordering operator<=>(strong_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v; +} +constexpr strong_ordering operator<=>(_CmpUnspecifiedParam, strong_ordering __v) noexcept { + return __v < 0 ? strong_ordering::greater : (__v > 0 ? strong_ordering::less : __v); +} + +// named comparison functions +constexpr bool is_eq(weak_equality __cmp) noexcept { return __cmp == 0; } +constexpr bool is_neq(weak_equality __cmp) noexcept { return __cmp != 0; } +constexpr bool is_lt(partial_ordering __cmp) noexcept { return __cmp < 0; } +constexpr bool is_lteq(partial_ordering __cmp) noexcept { return __cmp <= 0; } +constexpr bool is_gt(partial_ordering __cmp) noexcept { return __cmp > 0; } +constexpr bool is_gteq(partial_ordering __cmp) noexcept { return __cmp >= 0; } + +} // namespace __1 +} // end namespace std + +#endif // STD_COMPARE_H diff --git a/test/CodeGenCXX/PR19955.cpp b/test/CodeGenCXX/PR19955.cpp index 100108437752f..5175b74aae7f2 100644 --- a/test/CodeGenCXX/PR19955.cpp +++ b/test/CodeGenCXX/PR19955.cpp @@ -6,22 +6,22 @@ extern void __declspec(dllimport) fun(); extern int *varp; int *varp = &var; -// CHECK-DAG: @"\01?varp@@3PAHA" = global i32* null -// X64-DAG: @"\01?varp@@3PEAHEA" = global i32* null +// CHECK-DAG: @"?varp@@3PAHA" = dso_local global i32* null +// X64-DAG: @"?varp@@3PEAHEA" = dso_local global i32* null extern void (*funp)(); void (*funp)() = &fun; -// CHECK-DAG: @"\01?funp@@3P6AXXZA" = global void ()* null -// X64-DAG: @"\01?funp@@3P6AXXZEA" = global void ()* null +// CHECK-DAG: @"?funp@@3P6AXXZA" = dso_local global void ()* null +// X64-DAG: @"?funp@@3P6AXXZEA" = dso_local global void ()* null -// CHECK-LABEL: @"\01??__Evarp@@YAXXZ" -// CHECK-DAG: store i32* @"\01?var@@3HA", i32** @"\01?varp@@3PAHA" +// CHECK-LABEL: @"??__Evarp@@YAXXZ" +// CHECK-DAG: store i32* @"?var@@3HA", i32** @"?varp@@3PAHA" -// X64-LABEL: @"\01??__Evarp@@YAXXZ" -// X64-DAG: store i32* @"\01?var@@3HA", i32** @"\01?varp@@3PEAHEA" +// X64-LABEL: @"??__Evarp@@YAXXZ" +// X64-DAG: store i32* @"?var@@3HA", i32** @"?varp@@3PEAHEA" -// CHECK-LABEL: @"\01??__Efunp@@YAXXZ"() -// CHECK-DAG: store void ()* @"\01?fun@@YAXXZ", void ()** @"\01?funp@@3P6AXXZA" +// CHECK-LABEL: @"??__Efunp@@YAXXZ"() +// CHECK-DAG: store void ()* @"?fun@@YAXXZ", void ()** @"?funp@@3P6AXXZA" -// X64-LABEL: @"\01??__Efunp@@YAXXZ"() -// X64-DAG: store void ()* @"\01?fun@@YAXXZ", void ()** @"\01?funp@@3P6AXXZEA" +// X64-LABEL: @"??__Efunp@@YAXXZ"() +// X64-DAG: store void ()* @"?fun@@YAXXZ", void ()** @"?funp@@3P6AXXZEA" diff --git a/test/CodeGenCXX/PR26569.cpp b/test/CodeGenCXX/PR26569.cpp index 859b6e26f0c43..379b50c9276c3 100644 --- a/test/CodeGenCXX/PR26569.cpp +++ b/test/CodeGenCXX/PR26569.cpp @@ -9,12 +9,12 @@ class B : virtual A {}; extern template class __declspec(dllimport) B<int>; class __declspec(dllexport) C : B<int> {}; -// CHECK-DAG: @[[VTABLE_C:.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (%rtti.CompleteObjectLocator* @"\01??_R4C@@6B@" to i8*), i8* bitcast (void (%class.A*)* @"\01?m_fn1@A@@EAEXXZ" to i8*)] } -// CHECK-DAG: @[[VTABLE_B:.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (%rtti.CompleteObjectLocator* @"\01??_R4?$B@H@@6B@" to i8*), i8* bitcast (void (%class.A*)* @"\01?m_fn1@A@@EAEXXZ" to i8*)] }, comdat($"\01??_S?$B@H@@6B@") -// CHECK-DAG: @[[VTABLE_A:.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (%rtti.CompleteObjectLocator* @"\01??_R4A@@6B@" to i8*), i8* bitcast (void (%class.A*)* @"\01?m_fn1@A@@EAEXXZ" to i8*)] }, comdat($"\01??_SA@@6B@") +// CHECK-DAG: @[[VTABLE_C:.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (%rtti.CompleteObjectLocator* @"??_R4C@@6B@" to i8*), i8* bitcast (void (%class.A*)* @"?m_fn1@A@@EAEXXZ" to i8*)] } +// CHECK-DAG: @[[VTABLE_B:.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (%rtti.CompleteObjectLocator* @"??_R4?$B@H@@6B@" to i8*), i8* bitcast (void (%class.A*)* @"?m_fn1@A@@EAEXXZ" to i8*)] }, comdat($"??_S?$B@H@@6B@") +// CHECK-DAG: @[[VTABLE_A:.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (%rtti.CompleteObjectLocator* @"??_R4A@@6B@" to i8*), i8* bitcast (void (%class.A*)* @"?m_fn1@A@@EAEXXZ" to i8*)] }, comdat($"??_SA@@6B@") -// CHECK-DAG: @"\01??_7C@@6B@" = dllexport unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* @[[VTABLE_C]], i32 0, i32 0, i32 1) -// CHECK-DAG: @"\01??_S?$B@H@@6B@" = unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* @[[VTABLE_B]], i32 0, i32 0, i32 1) -// CHECK-DAG: @"\01??_SA@@6B@" = unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* @[[VTABLE_A]], i32 0, i32 0, i32 1) +// CHECK-DAG: @"??_7C@@6B@" = dllexport unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* @[[VTABLE_C]], i32 0, i32 0, i32 1) +// CHECK-DAG: @"??_S?$B@H@@6B@" = unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* @[[VTABLE_B]], i32 0, i32 0, i32 1) +// CHECK-DAG: @"??_SA@@6B@" = unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* @[[VTABLE_A]], i32 0, i32 0, i32 1) -// CHECK-DAG: @"\01??_8?$B@H@@7B@" = available_externally dllimport unnamed_addr constant [2 x i32] [i32 0, i32 4] +// CHECK-DAG: @"??_8?$B@H@@7B@" = available_externally dllimport unnamed_addr constant [2 x i32] [i32 0, i32 4] diff --git a/test/CodeGenCXX/PR28220.cpp b/test/CodeGenCXX/PR28220.cpp index 6262c87de2062..5863b6dced85e 100644 --- a/test/CodeGenCXX/PR28220.cpp +++ b/test/CodeGenCXX/PR28220.cpp @@ -14,6 +14,6 @@ template <typename T> S<T> U<T>::u; template S<int> U<int>::u; -// CHECK-NOT: define internal void @"\01??__Eu@?$U@H@@2U?$S@H@@A@YAXXZ"( +// CHECK-NOT: define internal void @"??__Eu@?$U@H@@2U?$S@H@@A@YAXXZ"( S<int> &i = U<int>::u; diff --git a/test/CodeGenCXX/PR37481.cpp b/test/CodeGenCXX/PR37481.cpp new file mode 100644 index 0000000000000..fba2ffdc8488f --- /dev/null +++ b/test/CodeGenCXX/PR37481.cpp @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -o /dev/null -emit-llvm -std=c++17 -triple x86_64-pc-windows-msvc %s + +struct Foo { + virtual void f(); + virtual void g(); +}; + +void Foo::f() {} +void Foo::g() {} + +template <void (Foo::*)()> +void h() {} + +void x() { + h<&Foo::f>(); + h<&Foo::g>(); +} diff --git a/test/CodeGenCXX/abstract-class-ctors-dtors.cpp b/test/CodeGenCXX/abstract-class-ctors-dtors.cpp index f36922413d83c..f1d207649a4af 100644 --- a/test/CodeGenCXX/abstract-class-ctors-dtors.cpp +++ b/test/CodeGenCXX/abstract-class-ctors-dtors.cpp @@ -1,6 +1,6 @@ // RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s -// Check that we dont emit the complete constructor/destructor for this class. +// Check that we don't emit the complete constructor/destructor for this class. struct A { virtual void f() = 0; A(); diff --git a/test/CodeGenCXX/address-space-cast.cpp b/test/CodeGenCXX/address-space-cast.cpp new file mode 100644 index 0000000000000..334a1a63e6277 --- /dev/null +++ b/test/CodeGenCXX/address-space-cast.cpp @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 %s -triple=amdgcn-amd-amdhsa -emit-llvm -o - | FileCheck %s + +#define __private__ __attribute__((address_space(5))) + +void func_pchar(__private__ char *x); + +void test_cast(char *gen_ptr) { + // CHECK: %[[cast:.*]] = addrspacecast i8* %{{.*}} to i8 addrspace(5)* + // CHECK-NEXT: store i8 addrspace(5)* %[[cast]] + __private__ char *priv_ptr = (__private__ char *)gen_ptr; + + // CHECK: %[[cast:.*]] = addrspacecast i8* %{{.*}} to i8 addrspace(5)* + // CHECK-NEXT: call void @_Z10func_pcharPU3AS5c(i8 addrspace(5)* %[[cast]]) + func_pchar((__private__ char *)gen_ptr); +} diff --git a/test/CodeGenCXX/address-space-ref.cpp b/test/CodeGenCXX/address-space-ref.cpp index de6bddca66a72..5f0a42950328d 100644 --- a/test/CodeGenCXX/address-space-ref.cpp +++ b/test/CodeGenCXX/address-space-ref.cpp @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 %s -std=c++11 -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -std=c++11 -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK,NULL-INVALID +// RUN: %clang_cc1 %s -std=c++11 -triple=x86_64-apple-darwin10 -fno-delete-null-pointer-checks -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK,NULL-VALID // For a reference to a complete type, output the dereferenceable attribute (in // any address space). @@ -29,6 +30,7 @@ bc & bar2(bc &x, bc & y) { return x; } -// CHECK: define nonnull %class.bc* @_Z4bar2R2bcS0_(%class.bc* nonnull %x, %class.bc* nonnull %y) +// NULL-INVALID: define nonnull %class.bc* @_Z4bar2R2bcS0_(%class.bc* nonnull %x, %class.bc* nonnull %y) +// NULL-VALID: define %class.bc* @_Z4bar2R2bcS0_(%class.bc* %x, %class.bc* %y) diff --git a/test/CodeGenCXX/alignment.cpp b/test/CodeGenCXX/alignment.cpp index 4c44badd21cda..37509fcb4dd55 100644 --- a/test/CodeGenCXX/alignment.cpp +++ b/test/CodeGenCXX/alignment.cpp @@ -1,4 +1,6 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64-apple-darwin10 | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64-apple-darwin10 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NOCOMPAT +// RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64-apple-darwin10 -fclang-abi-compat=6.0 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-V6COMPAT +// RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64-scei-ps4 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-V6COMPAT extern int int_source(); extern void int_sink(int x); @@ -54,11 +56,13 @@ namespace test0 { // CHECK: [[B_P:%.*]] = bitcast i8* [[T1]] to [[B]]* // CHECK: [[FIELD_P:%.*]] = bitcast [[B]]* [[B_P]] to i8* // CHECK: [[TRUNC:%.*]] = trunc i32 [[CALL]] to i8 - // CHECK: [[OLD_VALUE:%.*]] = load i8, i8* [[FIELD_P]], align 2 + // CHECK-V6COMPAT: [[OLD_VALUE:%.*]] = load i8, i8* [[FIELD_P]], align 2 + // CHECK-NOCOMPAT: [[OLD_VALUE:%.*]] = load i8, i8* [[FIELD_P]], align 4 // CHECK: [[T0:%.*]] = and i8 [[TRUNC]], 3 // CHECK: [[T1:%.*]] = and i8 [[OLD_VALUE]], -4 // CHECK: [[T2:%.*]] = or i8 [[T1]], [[T0]] - // CHECK: store i8 [[T2]], i8* [[FIELD_P]], align 2 + // CHECK-V6COMPAT: store i8 [[T2]], i8* [[FIELD_P]], align 2 + // CHECK-NOCOMPAT: store i8 [[T2]], i8* [[FIELD_P]], align 4 c.onebit = int_source(); // CHECK: [[C_P:%.*]] = load [[C]]*, [[C]]** @@ -66,7 +70,8 @@ namespace test0 { // CHECK: [[T1:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 8 // CHECK: [[B_P:%.*]] = bitcast i8* [[T1]] to [[B]]* // CHECK: [[FIELD_P:%.*]] = bitcast [[B]]* [[B_P]] to i8* - // CHECK: [[VALUE:%.*]] = load i8, i8* [[FIELD_P]], align 2 + // CHECK-V6COMPAT: [[VALUE:%.*]] = load i8, i8* [[FIELD_P]], align 2 + // CHECK-NOCOMPAT: [[VALUE:%.*]] = load i8, i8* [[FIELD_P]], align 4 // CHECK: [[T0:%.*]] = shl i8 [[VALUE]], 6 // CHECK: [[T1:%.*]] = ashr i8 [[T0]], 6 // CHECK: [[T2:%.*]] = sext i8 [[T1]] to i32 @@ -83,11 +88,13 @@ namespace test0 { // CHECK: [[B_P:%.*]] = bitcast i8* [[T1]] to [[B]]* // CHECK: [[FIELD_P:%.*]] = bitcast [[B]]* [[B_P]] to i8* // CHECK: [[TRUNC:%.*]] = trunc i32 [[CALL]] to i8 - // CHECK: [[OLD_VALUE:%.*]] = load i8, i8* [[FIELD_P]], align 2 + // CHECK-V6COMPAT: [[OLD_VALUE:%.*]] = load i8, i8* [[FIELD_P]], align 2 + // CHECK-NOCOMPAT: [[OLD_VALUE:%.*]] = load i8, i8* [[FIELD_P]], align 4 // CHECK: [[T0:%.*]] = and i8 [[TRUNC]], 3 // CHECK: [[T1:%.*]] = and i8 [[OLD_VALUE]], -4 // CHECK: [[T2:%.*]] = or i8 [[T1]], [[T0]] - // CHECK: store i8 [[T2]], i8* [[FIELD_P]], align 2 + // CHECK-V6COMPAT: store i8 [[T2]], i8* [[FIELD_P]], align 2 + // CHECK-NOCOMPAT: store i8 [[T2]], i8* [[FIELD_P]], align 4 c->onebit = int_source(); // CHECK: [[C_P:%.*]] = load [[C:%.*]]*, [[C]]** @@ -95,7 +102,8 @@ namespace test0 { // CHECK: [[T1:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 8 // CHECK: [[B_P:%.*]] = bitcast i8* [[T1]] to [[B:%.*]]* // CHECK: [[FIELD_P:%.*]] = bitcast [[B]]* [[B_P]] to i8* - // CHECK: [[VALUE:%.*]] = load i8, i8* [[FIELD_P]], align 2 + // CHECK-V6COMPAT: [[VALUE:%.*]] = load i8, i8* [[FIELD_P]], align 2 + // CHECK-NOCOMPAT: [[VALUE:%.*]] = load i8, i8* [[FIELD_P]], align 4 // CHECK: [[T0:%.*]] = shl i8 [[VALUE]], 6 // CHECK: [[T1:%.*]] = ashr i8 [[T0]], 6 // CHECK: [[T2:%.*]] = sext i8 [[T1]] to i32 @@ -107,7 +115,8 @@ namespace test0 { // in an alignment-2 variable. // CHECK-LABEL: @_ZN5test01dEv void d() { - // CHECK: [[C_P:%.*]] = alloca [[C:%.*]], align 2 + // CHECK-V6COMPAT: [[C_P:%.*]] = alloca [[C:%.*]], align 2 + // CHECK-NOCOMPAT: [[C_P:%.*]] = alloca [[C:%.*]], align 4 C c; // CHECK: [[CALL:%.*]] = call i32 @_Z10int_sourcev() @@ -116,18 +125,21 @@ namespace test0 { // CHECK: [[B_P:%.*]] = bitcast i8* [[T1]] to [[B]]* // CHECK: [[FIELD_P:%.*]] = bitcast [[B]]* [[B_P]] to i8* // CHECK: [[TRUNC:%.*]] = trunc i32 [[CALL]] to i8 - // CHECK: [[OLD_VALUE:%.*]] = load i8, i8* [[FIELD_P]], align 2 + // CHECK-V6COMPAT: [[OLD_VALUE:%.*]] = load i8, i8* [[FIELD_P]], align 2 + // CHECK-NOCOMPAT: [[OLD_VALUE:%.*]] = load i8, i8* [[FIELD_P]], align 4 // CHECK: [[T0:%.*]] = and i8 [[TRUNC]], 3 // CHECK: [[T1:%.*]] = and i8 [[OLD_VALUE]], -4 // CHECK: [[T2:%.*]] = or i8 [[T1]], [[T0]] - // CHECK: store i8 [[T2]], i8* [[FIELD_P]], align 2 + // CHECK-V6COMPAT: store i8 [[T2]], i8* [[FIELD_P]], align 2 + // CHECK-NOCOMPAT: store i8 [[T2]], i8* [[FIELD_P]], align 4 c.onebit = int_source(); // CHECK: [[T0:%.*]] = bitcast [[C]]* [[C_P]] to i8* // CHECK: [[T1:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 8 // CHECK: [[B_P:%.*]] = bitcast i8* [[T1]] to [[B:%.*]]* // CHECK: [[FIELD_P:%.*]] = bitcast [[B]]* [[B_P]] to i8* - // CHECK: [[VALUE:%.*]] = load i8, i8* [[FIELD_P]], align 2 + // CHECK-V6COMPAT: [[VALUE:%.*]] = load i8, i8* [[FIELD_P]], align 2 + // CHECK-NOCOMPAT: [[VALUE:%.*]] = load i8, i8* [[FIELD_P]], align 4 // CHECK: [[T0:%.*]] = shl i8 [[VALUE]], 6 // CHECK: [[T1:%.*]] = ashr i8 [[T0]], 6 // CHECK: [[T2:%.*]] = sext i8 [[T1]] to i32 @@ -204,7 +216,7 @@ namespace test1 { // CHECK: [[ARRAY_P:%.*]] = getelementptr inbounds [[A]], [[A]]* [[A_P]], i32 0, i32 0 // CHECK: [[T0:%.*]] = bitcast [[ARRAY]]* [[RESULT]] to i8* // CHECK: [[T1:%.*]] = bitcast [[ARRAY]]* [[ARRAY_P]] to i8* - // CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[T0]], i8* [[T1]], i64 16, i32 16, i1 false) + // CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 64 [[T0]], i8* align 16 [[T1]], i64 16, i1 false) AlignedArray result = a.aArray; } @@ -223,7 +235,7 @@ namespace test1 { // CHECK: [[ARRAY_P:%.*]] = getelementptr inbounds [[A]], [[A]]* [[A_P]], i32 0, i32 0 // CHECK: [[T0:%.*]] = bitcast [[ARRAY]]* [[RESULT]] to i8* // CHECK: [[T1:%.*]] = bitcast [[ARRAY]]* [[ARRAY_P]] to i8* - // CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[T0]], i8* [[T1]], i64 16, i32 16, i1 false) + // CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 64 [[T0]], i8* align 16 [[T1]], i64 16, i1 false) AlignedArray result = b.aArray; } @@ -234,7 +246,7 @@ namespace test1 { // CHECK: [[ARRAY_P:%.*]] = getelementptr inbounds [[B]], [[B]]* [[B_P]], i32 0, i32 2 // CHECK: [[T0:%.*]] = bitcast [[ARRAY]]* [[RESULT]] to i8* // CHECK: [[T1:%.*]] = bitcast [[ARRAY]]* [[ARRAY_P]] to i8* - // CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[T0]], i8* [[T1]], i64 16, i32 8, i1 false) + // CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 64 [[T0]], i8* align 8 [[T1]], i64 16, i1 false) AlignedArray result = b.bArray; } @@ -245,7 +257,7 @@ namespace test1 { // CHECK: [[ARRAY_P:%.*]] = getelementptr inbounds [[B]], [[B]]* [[B_P]], i32 0, i32 2 // CHECK: [[T0:%.*]] = bitcast [[ARRAY]]* [[RESULT]] to i8* // CHECK: [[T1:%.*]] = bitcast [[ARRAY]]* [[ARRAY_P]] to i8* - // CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[T0]], i8* [[T1]], i64 16, i32 8, i1 false) + // CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 64 [[T0]], i8* align 8 [[T1]], i64 16, i1 false) AlignedArray result = b->bArray; } @@ -256,7 +268,7 @@ namespace test1 { // CHECK: [[ARRAY_P:%.*]] = getelementptr inbounds [[B]], [[B]]* [[B_P]], i32 0, i32 2 // CHECK: [[T0:%.*]] = bitcast [[ARRAY]]* [[RESULT]] to i8* // CHECK: [[T1:%.*]] = bitcast [[ARRAY]]* [[ARRAY_P]] to i8* - // CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[T0]], i8* [[T1]], i64 16, i32 16, i1 false) + // CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 64 [[T0]], i8* align 16 [[T1]], i64 16, i1 false) B b; AlignedArray result = b.bArray; } @@ -277,7 +289,7 @@ namespace test1 { // CHECK: [[ARRAY_P:%.*]] = getelementptr inbounds [[A]], [[A]]* [[A_P]], i32 0, i32 0 // CHECK: [[T0:%.*]] = bitcast [[ARRAY]]* [[RESULT]] to i8* // CHECK: [[T1:%.*]] = bitcast [[ARRAY]]* [[ARRAY_P]] to i8* - // CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[T0]], i8* [[T1]], i64 16, i32 16, i1 false) + // CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 64 [[T0]], i8* align 16 [[T1]], i64 16, i1 false) D d; AlignedArray result = d.aArray; } @@ -292,7 +304,7 @@ namespace test1 { // CHECK: [[ARRAY_P:%.*]] = getelementptr inbounds [[B]], [[B]]* [[B_P]], i32 0, i32 2 // CHECK: [[T0:%.*]] = bitcast [[ARRAY]]* [[RESULT]] to i8* // CHECK: [[T1:%.*]] = bitcast [[ARRAY]]* [[ARRAY_P]] to i8* - // CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[T0]], i8* [[T1]], i64 16, i32 8, i1 false) + // CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 64 [[T0]], i8* align 8 [[T1]], i64 16, i1 false) D d; AlignedArray result = d.bArray; } diff --git a/test/CodeGenCXX/alloc-size.cpp b/test/CodeGenCXX/alloc-size.cpp index e93e231b70e82..e68e52c86bf26 100644 --- a/test/CodeGenCXX/alloc-size.cpp +++ b/test/CodeGenCXX/alloc-size.cpp @@ -69,4 +69,38 @@ int testIt() { __builtin_object_size(dependent_calloc<7, 8>(), 0) + __builtin_object_size(dependent_calloc2<int, 9>(), 0); } +} // namespace templated_alloc_size + +// Be sure that an ExprWithCleanups doesn't deter us. +namespace alloc_size_with_cleanups { +struct Foo { + ~Foo(); +}; + +void *my_malloc(const Foo &, int N) __attribute__((alloc_size(2))); + +// CHECK-LABEL: define i32 @_ZN24alloc_size_with_cleanups6testItEv +int testIt() { + int *const p = (int *)my_malloc(Foo{}, 3); + // CHECK: ret i32 3 + return __builtin_object_size(p, 0); +} +} // namespace alloc_size_with_cleanups + +class C { +public: + void *my_malloc(int N) __attribute__((alloc_size(2))); + void *my_calloc(int N, int M) __attribute__((alloc_size(2, 3))); +}; + +// CHECK-LABEL: define i32 @_Z16callMemberMallocv +int callMemberMalloc() { + // CHECK: ret i32 16 + return __builtin_object_size(C().my_malloc(16), 0); +} + +// CHECK-LABEL: define i32 @_Z16callMemberCallocv +int callMemberCalloc() { + // CHECK: ret i32 32 + return __builtin_object_size(C().my_calloc(16, 2), 0); } diff --git a/test/CodeGenCXX/amdgcn-func-arg.cpp b/test/CodeGenCXX/amdgcn-func-arg.cpp new file mode 100644 index 0000000000000..9ac143a520052 --- /dev/null +++ b/test/CodeGenCXX/amdgcn-func-arg.cpp @@ -0,0 +1,94 @@ +// RUN: %clang_cc1 -O0 -triple amdgcn -emit-llvm %s -o - | FileCheck %s + +class A { +public: + int x; + A():x(0) {} + ~A() {} +}; + +class B { +int x[100]; +}; + +A g_a; +B g_b; + +void func_with_ref_arg(A &a); +void func_with_ref_arg(B &b); + +// CHECK-LABEL: define void @_Z22func_with_indirect_arg1A(%class.A addrspace(5)* %a) +// CHECK: %p = alloca %class.A*, align 8, addrspace(5) +// CHECK: %[[r1:.+]] = addrspacecast %class.A* addrspace(5)* %p to %class.A** +// CHECK: %[[r0:.+]] = addrspacecast %class.A addrspace(5)* %a to %class.A* +// CHECK: store %class.A* %[[r0]], %class.A** %[[r1]], align 8 +void func_with_indirect_arg(A a) { + A *p = &a; +} + +// CHECK-LABEL: define void @_Z22test_indirect_arg_autov() +// CHECK: %a = alloca %class.A, align 4, addrspace(5) +// CHECK: %[[r0:.+]] = addrspacecast %class.A addrspace(5)* %a to %class.A* +// CHECK: %agg.tmp = alloca %class.A, align 4, addrspace(5) +// CHECK: %[[r1:.+]] = addrspacecast %class.A addrspace(5)* %agg.tmp to %class.A* +// CHECK: call void @_ZN1AC1Ev(%class.A* %[[r0]]) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64 +// CHECK: %[[r4:.+]] = addrspacecast %class.A* %[[r1]] to %class.A addrspace(5)* +// CHECK: call void @_Z22func_with_indirect_arg1A(%class.A addrspace(5)* %[[r4]]) +// CHECK: call void @_ZN1AD1Ev(%class.A* %[[r1]]) +// CHECK: call void @_Z17func_with_ref_argR1A(%class.A* dereferenceable(4) %[[r0]]) +// CHECK: call void @_ZN1AD1Ev(%class.A* %[[r0]]) +void test_indirect_arg_auto() { + A a; + func_with_indirect_arg(a); + func_with_ref_arg(a); +} + +// CHECK: define void @_Z24test_indirect_arg_globalv() +// CHECK: %agg.tmp = alloca %class.A, align 4, addrspace(5) +// CHECK: %[[r0:.+]] = addrspacecast %class.A addrspace(5)* %agg.tmp to %class.A* +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64 +// CHECK: %[[r2:.+]] = addrspacecast %class.A* %[[r0]] to %class.A addrspace(5)* +// CHECK: call void @_Z22func_with_indirect_arg1A(%class.A addrspace(5)* %[[r2]]) +// CHECK: call void @_ZN1AD1Ev(%class.A* %[[r0]]) +// CHECK: call void @_Z17func_with_ref_argR1A(%class.A* dereferenceable(4) addrspacecast (%class.A addrspace(1)* @g_a to %class.A*)) +void test_indirect_arg_global() { + func_with_indirect_arg(g_a); + func_with_ref_arg(g_a); +} + +// CHECK-LABEL: define void @_Z19func_with_byval_arg1B(%class.B addrspace(5)* byval align 4 %b) +// CHECK: %p = alloca %class.B*, align 8, addrspace(5) +// CHECK: %[[r1:.+]] = addrspacecast %class.B* addrspace(5)* %p to %class.B** +// CHECK: %[[r0:.+]] = addrspacecast %class.B addrspace(5)* %b to %class.B* +// CHECK: store %class.B* %[[r0]], %class.B** %[[r1]], align 8 +void func_with_byval_arg(B b) { + B *p = &b; +} + +// CHECK-LABEL: define void @_Z19test_byval_arg_autov() +// CHECK: %b = alloca %class.B, align 4, addrspace(5) +// CHECK: %[[r0:.+]] = addrspacecast %class.B addrspace(5)* %b to %class.B* +// CHECK: %agg.tmp = alloca %class.B, align 4, addrspace(5) +// CHECK: %[[r1:.+]] = addrspacecast %class.B addrspace(5)* %agg.tmp to %class.B* +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64 +// CHECK: %[[r4:.+]] = addrspacecast %class.B* %[[r1]] to %class.B addrspace(5)* +// CHECK: call void @_Z19func_with_byval_arg1B(%class.B addrspace(5)* byval align 4 %[[r4]]) +// CHECK: call void @_Z17func_with_ref_argR1B(%class.B* dereferenceable(400) %[[r0]]) +void test_byval_arg_auto() { + B b; + func_with_byval_arg(b); + func_with_ref_arg(b); +} + +// CHECK-LABEL: define void @_Z21test_byval_arg_globalv() +// CHECK: %agg.tmp = alloca %class.B, align 4, addrspace(5) +// CHECK: %[[r0:.+]] = addrspacecast %class.B addrspace(5)* %agg.tmp to %class.B* +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64 +// CHECK: %[[r2:.+]] = addrspacecast %class.B* %[[r0]] to %class.B addrspace(5)* +// CHECK: call void @_Z19func_with_byval_arg1B(%class.B addrspace(5)* byval align 4 %[[r2]]) +// CHECK: call void @_Z17func_with_ref_argR1B(%class.B* dereferenceable(400) addrspacecast (%class.B addrspace(1)* @g_b to %class.B*)) +void test_byval_arg_global() { + func_with_byval_arg(g_b); + func_with_ref_arg(g_b); +} diff --git a/test/CodeGenCXX/amdgcn-string-literal.cpp b/test/CodeGenCXX/amdgcn-string-literal.cpp new file mode 100644 index 0000000000000..7fd05351c863b --- /dev/null +++ b/test/CodeGenCXX/amdgcn-string-literal.cpp @@ -0,0 +1,28 @@ +// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -emit-llvm %s -o - | FileCheck %s + +// CHECK: @.str = private unnamed_addr addrspace(4) constant [6 x i8] c"g_str\00", align 1 +// CHECK: @g_str = addrspace(1) global i8* addrspacecast (i8 addrspace(4)* getelementptr inbounds ([6 x i8], [6 x i8] addrspace(4)* @.str, i32 0, i32 0) to i8*), align 8 +// CHECK: @g_array = addrspace(1) global [8 x i8] c"g_array\00", align 1 +// CHECK: @.str.1 = private unnamed_addr addrspace(4) constant [6 x i8] c"l_str\00", align 1 +// CHECK: @_ZZ1fvE7l_array = private unnamed_addr addrspace(4) constant [8 x i8] c"l_array\00", align 1 + +const char* g_str = "g_str"; +char g_array[] = "g_array"; + +void g(const char* p); + +// CHECK-LABEL: define void @_Z1fv() +void f() { + const char* l_str = "l_str"; + + // CHECK: call void @llvm.memcpy.p0i8.p4i8.i64 + char l_array[] = "l_array"; + + g(g_str); + g(g_array); + g(l_str); + g(l_array); + + const char* p = g_str; + g(p); +} diff --git a/test/CodeGenCXX/amdgcn_declspec_get.cpp b/test/CodeGenCXX/amdgcn_declspec_get.cpp new file mode 100644 index 0000000000000..93f7a36af141f --- /dev/null +++ b/test/CodeGenCXX/amdgcn_declspec_get.cpp @@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -emit-llvm -O3 -fdeclspec \ +// RUN: -disable-llvm-passes -o - %s | FileCheck %s + +int get_x(); + +struct A { + __declspec(property(get = _get_x)) int x; + static int _get_x(void) { + return get_x(); + }; +}; + +extern const A a; + +// CHECK-LABEL: define void @_Z4testv() +// CHECK: %i = alloca i32, align 4, addrspace(5) +// CHECK: %[[ii:.*]] = addrspacecast i32 addrspace(5)* %i to i32* +// CHECK: %[[cast:.*]] = bitcast i32 addrspace(5)* %i to i8 addrspace(5)* +// CHECK: call void @llvm.lifetime.start.p5i8(i64 4, i8 addrspace(5)* %[[cast]]) +// CHECK: %call = call i32 @_ZN1A6_get_xEv() +// CHECK: store i32 %call, i32* %[[ii]] +// CHECK: %[[cast2:.*]] = bitcast i32 addrspace(5)* %i to i8 addrspace(5)* +// CHECK: call void @llvm.lifetime.end.p5i8(i64 4, i8 addrspace(5)* %[[cast2]]) +void test() +{ + int i = a.x; +} diff --git a/test/CodeGenCXX/apple-kext-guard-variable.cpp b/test/CodeGenCXX/apple-kext-guard-variable.cpp index 76875a0b69ae7..ea4c1483ce707 100644 --- a/test/CodeGenCXX/apple-kext-guard-variable.cpp +++ b/test/CodeGenCXX/apple-kext-guard-variable.cpp @@ -1,4 +1,4 @@ -// RUN: %clang -target x86_64-apple-darwin10 -S -o %t.s -mkernel -Xclang -verify %s +// RUN: %clang -target x86_64-apple-darwin10 -S -o %t.s -Wno-stdlibcxx-not-found -mkernel -Xclang -verify %s // rdar://problem/9143356 diff --git a/test/CodeGenCXX/arm-swiftcall.cpp b/test/CodeGenCXX/arm-swiftcall.cpp index 5c932c77b1da3..36a5afad4c624 100644 --- a/test/CodeGenCXX/arm-swiftcall.cpp +++ b/test/CodeGenCXX/arm-swiftcall.cpp @@ -113,3 +113,13 @@ TEST(struct_indirect_1) // Should not be byval. // CHECK-LABEL: define {{.*}} void @take_struct_indirect_1({{.*}}*{{( %.*)?}}) + +// Do a simple standalone test here of a function definition to ensure that +// we don't have problems due to failure to eagerly synthesize a copy +// constructor declaration. +class struct_trivial { + int x; +}; +// CHECK-LABEL define void @test_struct_trivial(i32{{( %.*)?}}) +extern "C" SWIFTCALL +void test_struct_trivial(struct_trivial triv) {} diff --git a/test/CodeGenCXX/array-default-argument.cpp b/test/CodeGenCXX/array-default-argument.cpp index a07e3908392a4..23bc9fdbb703b 100644 --- a/test/CodeGenCXX/array-default-argument.cpp +++ b/test/CodeGenCXX/array-default-argument.cpp @@ -12,7 +12,7 @@ struct B { }; void f(); -// CHECK-LABEL: define void @_Z1gv() +// CHECK-LABEL: define {{(dso_local )?}}void @_Z1gv() void g() { // CHECK: br label %[[LOOP:.*]] diff --git a/test/CodeGenCXX/assign-construct-memcpy.cpp b/test/CodeGenCXX/assign-construct-memcpy.cpp index 3d42051324093..5e52b1625b61f 100644 --- a/test/CodeGenCXX/assign-construct-memcpy.cpp +++ b/test/CodeGenCXX/assign-construct-memcpy.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin12 -emit-llvm -o - -std=c++11 %s -DPOD | FileCheck %s -check-prefix=CHECK-POD +/// RUN: %clang_cc1 -triple x86_64-apple-darwin12 -emit-llvm -o - -std=c++11 %s -DPOD | FileCheck %s -check-prefix=CHECK-POD // RUN: %clang_cc1 -triple x86_64-apple-darwin12 -emit-llvm -o - -std=c++11 %s | FileCheck %s -check-prefix=CHECK-NONPOD // Declare the reserved placement operators. @@ -23,47 +23,47 @@ struct foo { foo *test1(void *f, const foo &x) { return new (f) foo(x); // CHECK-POD: test1 -// CHECK-POD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 24, i32 8 +// CHECK-POD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 24 // CHECK-NONPOD: test1 -// CHECK-NONPOD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 24, i32 8 +// CHECK-NONPOD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 24 } foo *test2(const foo &x) { return new foo(x); // CHECK-POD: test2 -// CHECK-POD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 24, i32 8 +// CHECK-POD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 16 {{.*}} align 8 {{.*}}i64 24 // CHECK-NONPOD: test2 -// CHECK-NONPOD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 24, i32 8 +// CHECK-NONPOD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 16 {{.*}} align 8 {{.*}}i64 24 } foo test3(const foo &x) { foo f = x; return f; // CHECK-POD: test3 -// CHECK-POD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 24, i32 8 +// CHECK-POD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 24 // CHECK-NONPOD: test3 -// CHECK-NONPOD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 24, i32 8 +// CHECK-NONPOD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 24 } foo *test4(foo &&x) { return new foo(x); // CHECK-POD: test4 -// CHECK-POD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 24, i32 8 +// CHECK-POD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 16 {{.*}} align 8 {{.*}}i64 24 // CHECK-NONPOD: test4 -// CHECK-NONPOD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 24, i32 8 +// CHECK-NONPOD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 16 {{.*}} align 8 {{.*}}i64 24 } void test5(foo &f, const foo &x) { f = x; // CHECK-POD: test5 -// CHECK-POD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 24, i32 8 +// CHECK-POD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 24 // CHECK-NONPOD: test5 -// CHECK-NONPOD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 17, i32 8 +// CHECK-NONPOD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 17 } extern foo globtest; @@ -71,10 +71,10 @@ extern foo globtest; void test6(foo &&x) { globtest = move(x); // CHECK-POD: test6 -// CHECK-POD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 24, i32 8 +// CHECK-POD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 24 // CHECK-NONPOD: test6 -// CHECK-NONPOD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 17, i32 8 +// CHECK-NONPOD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 17 } void byval(foo f); @@ -82,8 +82,8 @@ void byval(foo f); void test7(const foo &x) { byval(x); // CHECK-POD: test7 -// CHECK-POD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 24, i32 8 +// CHECK-POD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 24 // CHECK-NONPOD: test7 -// CHECK-NONPOD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 24, i32 8 +// CHECK-NONPOD: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 24 } diff --git a/test/CodeGenCXX/atomic-dllexport.cpp b/test/CodeGenCXX/atomic-dllexport.cpp index ae14222431605..20c500555c2ee 100644 --- a/test/CodeGenCXX/atomic-dllexport.cpp +++ b/test/CodeGenCXX/atomic-dllexport.cpp @@ -3,7 +3,7 @@ struct __declspec(dllexport) SomeStruct { // Copy assignment operator should be produced, and exported: - // M32: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.SomeStruct* @"\01??4SomeStruct@@QAEAAU0@ABU0@@Z" - // M64: define weak_odr dllexport dereferenceable({{[0-9]+}}) %struct.SomeStruct* @"\01??4SomeStruct@@QEAAAEAU0@AEBU0@@Z" + // M32: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.SomeStruct* @"??4SomeStruct@@QAEAAU0@ABU0@@Z" + // M64: define weak_odr dso_local dllexport dereferenceable({{[0-9]+}}) %struct.SomeStruct* @"??4SomeStruct@@QEAAAEAU0@AEBU0@@Z" _Atomic(int) mData; }; diff --git a/test/CodeGenCXX/atomic-inline.cpp b/test/CodeGenCXX/atomic-inline.cpp index fe727589d2e27..327f85d5667fd 100644 --- a/test/CodeGenCXX/atomic-inline.cpp +++ b/test/CodeGenCXX/atomic-inline.cpp @@ -1,6 +1,52 @@ // RUN: %clang_cc1 %s -std=c++11 -emit-llvm -o - -triple=x86_64-linux-gnu | FileCheck %s // RUN: %clang_cc1 %s -std=c++11 -emit-llvm -o - -triple=x86_64-linux-gnu -target-cpu core2 | FileCheck %s --check-prefix=CORE2 -// Check the atomic code generation for cpu targets w/wo cx16 support. +// RUN: %clang_cc1 %s -std=c++11 -emit-llvm -o - -triple=i386-linux-gnu -target-cpu i386 | FileCheck %s --check-prefix=I386 +// RUN: %clang_cc1 %s -std=c++11 -emit-llvm -o - -triple=i386-linux-gnu -target-cpu i486 | FileCheck %s --check-prefix=I486 +// Check the atomic code generation for cpu targets w/wo cx, cx8 and cx16 support. + +struct alignas(4) AM4 { + short f1, f2; +}; +AM4 m4; +AM4 load4() { + AM4 am; + // CHECK-LABEL: @_Z5load4v + // CHECK: load atomic i32, {{.*}} monotonic + // CORE2-LABEL: @_Z5load4v + // CORE2: load atomic i32, {{.*}} monotonic + // I386-LABEL: @_Z5load4v + // I386: call i32 @__atomic_load_4 + // I486-LABEL: @_Z5load4v + // I486: load atomic i32, {{.*}} monotonic + __atomic_load(&m4, &am, 0); + return am; +} + +AM4 s4; +void store4() { + // CHECK-LABEL: @_Z6store4v + // CHECK: store atomic i32 {{.*}} monotonic + // CORE2-LABEL: @_Z6store4v + // CORE2: store atomic i32 {{.*}} monotonic + // I386-LABEL: @_Z6store4v + // I386: call void @__atomic_store_4 + // I486-LABEL: @_Z6store4v + // I486: store atomic i32 {{.*}} monotonic + __atomic_store(&m4, &s4, 0); +} + +bool cmpxchg4() { + AM4 am; + // CHECK-LABEL: @_Z8cmpxchg4v + // CHECK: cmpxchg i32* {{.*}} monotonic + // CORE2-LABEL: @_Z8cmpxchg4v + // CORE2: cmpxchg i32* {{.*}} monotonic + // I386-LABEL: @_Z8cmpxchg4v + // I386: call zeroext i1 @__atomic_compare_exchange_4 + // I486-LABEL: @_Z8cmpxchg4v + // I486: cmpxchg i32* {{.*}} monotonic + return __atomic_compare_exchange(&m4, &s4, &am, 0, 0, 0); +} struct alignas(8) AM8 { int f1, f2; @@ -12,6 +58,10 @@ AM8 load8() { // CHECK: load atomic i64, {{.*}} monotonic // CORE2-LABEL: @_Z5load8v // CORE2: load atomic i64, {{.*}} monotonic + // I386-LABEL: @_Z5load8v + // I386: call i64 @__atomic_load_8 + // I486-LABEL: @_Z5load8v + // I486: call i64 @__atomic_load_8 __atomic_load(&m8, &am, 0); return am; } @@ -22,6 +72,10 @@ void store8() { // CHECK: store atomic i64 {{.*}} monotonic // CORE2-LABEL: @_Z6store8v // CORE2: store atomic i64 {{.*}} monotonic + // I386-LABEL: @_Z6store8v + // I386: call void @__atomic_store_8 + // I486-LABEL: @_Z6store8v + // I486: call void @__atomic_store_8 __atomic_store(&m8, &s8, 0); } @@ -31,6 +85,10 @@ bool cmpxchg8() { // CHECK: cmpxchg i64* {{.*}} monotonic // CORE2-LABEL: @_Z8cmpxchg8v // CORE2: cmpxchg i64* {{.*}} monotonic + // I386-LABEL: @_Z8cmpxchg8v + // I386: call zeroext i1 @__atomic_compare_exchange_8 + // I486-LABEL: @_Z8cmpxchg8v + // I486: call zeroext i1 @__atomic_compare_exchange_8 return __atomic_compare_exchange(&m8, &s8, &am, 0, 0, 0); } @@ -66,4 +124,3 @@ bool cmpxchg16() { // CORE2: cmpxchg i128* {{.*}} monotonic return __atomic_compare_exchange(&m16, &s16, &am, 0, 0, 0); } - diff --git a/test/CodeGenCXX/attr-target-mv-diff-ns.cpp b/test/CodeGenCXX/attr-target-mv-diff-ns.cpp new file mode 100644 index 0000000000000..4dc2b67b46444 --- /dev/null +++ b/test/CodeGenCXX/attr-target-mv-diff-ns.cpp @@ -0,0 +1,54 @@ +// RUN: %clang_cc1 -std=c++11 -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck %s +// Test ensures that this properly differentiates between types in different +// namespaces. +int __attribute__((target("sse4.2"))) foo(int) { return 0; } +int __attribute__((target("arch=sandybridge"))) foo(int); +int __attribute__((target("arch=ivybridge"))) foo(int) {return 1;} +int __attribute__((target("default"))) foo(int) { return 2; } + +namespace ns { +int __attribute__((target("sse4.2"))) foo(int) { return 0; } +int __attribute__((target("arch=sandybridge"))) foo(int); +int __attribute__((target("arch=ivybridge"))) foo(int) {return 1;} +int __attribute__((target("default"))) foo(int) { return 2; } +} + +int bar() { + return foo(1) + ns::foo(2); +} + +// CHECK: @_Z3fooi.ifunc = ifunc i32 (i32), i32 (i32)* ()* @_Z3fooi.resolver +// CHECK: @_ZN2ns3fooEi.ifunc = ifunc i32 (i32), i32 (i32)* ()* @_ZN2ns3fooEi.resolver + +// CHECK: define i32 @_Z3fooi.sse4.2(i32) +// CHECK: ret i32 0 +// CHECK: define i32 @_Z3fooi.arch_ivybridge(i32) +// CHECK: ret i32 1 +// CHECK: define i32 @_Z3fooi(i32) +// CHECK: ret i32 2 + +// CHECK: define i32 @_ZN2ns3fooEi.sse4.2(i32) +// CHECK: ret i32 0 +// CHECK: define i32 @_ZN2ns3fooEi.arch_ivybridge(i32) +// CHECK: ret i32 1 +// CHECK: define i32 @_ZN2ns3fooEi(i32) +// CHECK: ret i32 2 + +// CHECK: define i32 @_Z3barv() +// CHECK: call i32 @_Z3fooi.ifunc(i32 1) +// CHECK: call i32 @_ZN2ns3fooEi.ifunc(i32 2) + +// CHECK: define i32 (i32)* @_Z3fooi.resolver() comdat +// CHECK: ret i32 (i32)* @_Z3fooi.arch_sandybridge +// CHECK: ret i32 (i32)* @_Z3fooi.arch_ivybridge +// CHECK: ret i32 (i32)* @_Z3fooi.sse4.2 +// CHECK: ret i32 (i32)* @_Z3fooi +// +// CHECK: define i32 (i32)* @_ZN2ns3fooEi.resolver() comdat +// CHECK: ret i32 (i32)* @_ZN2ns3fooEi.arch_sandybridge +// CHECK: ret i32 (i32)* @_ZN2ns3fooEi.arch_ivybridge +// CHECK: ret i32 (i32)* @_ZN2ns3fooEi.sse4.2 +// CHECK: ret i32 (i32)* @_ZN2ns3fooEi + +// CHECK: declare i32 @_Z3fooi.arch_sandybridge(i32) +// CHECK: declare i32 @_ZN2ns3fooEi.arch_sandybridge(i32) diff --git a/test/CodeGenCXX/attr-target-mv-func-ptrs.cpp b/test/CodeGenCXX/attr-target-mv-func-ptrs.cpp new file mode 100644 index 0000000000000..290d6b5c64895 --- /dev/null +++ b/test/CodeGenCXX/attr-target-mv-func-ptrs.cpp @@ -0,0 +1,45 @@ +// RUN: %clang_cc1 -std=c++11 -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck %s +void temp(); +void temp(int); +using FP = void(*)(int); +void b() { + FP f = temp; +} + +int __attribute__((target("sse4.2"))) foo(int) { return 0; } +int __attribute__((target("arch=sandybridge"))) foo(int); +int __attribute__((target("arch=ivybridge"))) foo(int) {return 1;} +int __attribute__((target("default"))) foo(int) { return 2; } + +struct S { +int __attribute__((target("sse4.2"))) foo(int) { return 0; } +int __attribute__((target("arch=sandybridge"))) foo(int); +int __attribute__((target("arch=ivybridge"))) foo(int) {return 1;} +int __attribute__((target("default"))) foo(int) { return 2; } +}; + +using FuncPtr = int (*)(int); +using MemFuncPtr = int (S::*)(int); + +void f(FuncPtr, MemFuncPtr); + +int bar() { + FuncPtr Free = &foo; + MemFuncPtr Member = &S::foo; + S s; + f(foo, &S::foo); + return Free(1) + (s.*Member)(2); +} + + +// CHECK: @_Z3fooi.ifunc +// CHECK: @_ZN1S3fooEi.ifunc + +// CHECK: define i32 @_Z3barv() +// Store to Free of ifunc +// CHECK: store i32 (i32)* @_Z3fooi.ifunc +// Store to Member of ifunc +// CHECK: store { i64, i64 } { i64 ptrtoint (i32 (%struct.S*, i32)* @_ZN1S3fooEi.ifunc to i64), i64 0 }, { i64, i64 }* [[MEMBER:%[a-z]+]] + +// Call to 'f' with the ifunc +// CHECK: call void @_Z1fPFiiEM1SFiiE(i32 (i32)* @_Z3fooi.ifunc diff --git a/test/CodeGenCXX/attr-target-mv-member-funcs.cpp b/test/CodeGenCXX/attr-target-mv-member-funcs.cpp new file mode 100644 index 0000000000000..2e5db3b705e46 --- /dev/null +++ b/test/CodeGenCXX/attr-target-mv-member-funcs.cpp @@ -0,0 +1,137 @@ +// RUN: %clang_cc1 -std=c++11 -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck %s + +struct S { + int __attribute__((target("sse4.2"))) foo(int) { return 0; } + int __attribute__((target("arch=sandybridge"))) foo(int); + int __attribute__((target("arch=ivybridge"))) foo(int) { return 1; } + int __attribute__((target("default"))) foo(int) { return 2; } + + S &__attribute__((target("arch=ivybridge"))) operator=(const S &) { + return *this; + } + S &__attribute__((target("default"))) operator=(const S &) { + return *this; + } +}; + +struct ConvertTo { + __attribute__((target("arch=ivybridge"))) operator S() const { + return S{}; + } + __attribute__((target("default"))) operator S() const { + return S{}; + } +}; + +int bar() { + S s; + S s2; + s2 = s; + + ConvertTo C; + s2 = static_cast<S>(C); + + return s.foo(0); +} + +struct S2 { + int __attribute__((target("sse4.2"))) foo(int); + int __attribute__((target("arch=sandybridge"))) foo(int); + int __attribute__((target("arch=ivybridge"))) foo(int); + int __attribute__((target("default"))) foo(int); +}; + +int bar2() { + S2 s; + return s.foo(0); +} + +int __attribute__((target("sse4.2"))) S2::foo(int) { return 0; } +int __attribute__((target("arch=ivybridge"))) S2::foo(int) { return 1; } +int __attribute__((target("default"))) S2::foo(int) { return 2; } + +template<typename T> +struct templ { + int __attribute__((target("sse4.2"))) foo(int) { return 0; } + int __attribute__((target("arch=sandybridge"))) foo(int); + int __attribute__((target("arch=ivybridge"))) foo(int) { return 1; } + int __attribute__((target("default"))) foo(int) { return 2; } +}; + +int templ_use() { + templ<int> a; + templ<double> b; + return a.foo(1) + b.foo(2); +} + +// CHECK: @_ZN1SaSERKS_.ifunc = ifunc %struct.S* (%struct.S*, %struct.S*), %struct.S* (%struct.S*, %struct.S*)* ()* @_ZN1SaSERKS_.resolver +// CHECK: @_ZNK9ConvertTocv1SEv.ifunc = ifunc void (%struct.ConvertTo*), void (%struct.ConvertTo*)* ()* @_ZNK9ConvertTocv1SEv.resolver +// CHECK: @_ZN1S3fooEi.ifunc = ifunc i32 (%struct.S*, i32), i32 (%struct.S*, i32)* ()* @_ZN1S3fooEi.resolver +// CHECK: @_ZN2S23fooEi.ifunc = ifunc i32 (%struct.S2*, i32), i32 (%struct.S2*, i32)* ()* @_ZN2S23fooEi.resolver +// Templates: +// CHECK: @_ZN5templIiE3fooEi.ifunc = ifunc i32 (%struct.templ*, i32), i32 (%struct.templ*, i32)* ()* @_ZN5templIiE3fooEi.resolver +// CHECK: @_ZN5templIdE3fooEi.ifunc = ifunc i32 (%struct.templ.0*, i32), i32 (%struct.templ.0*, i32)* ()* @_ZN5templIdE3fooEi.resolver + +// CHECK: define i32 @_Z3barv() +// CHECK: %s = alloca %struct.S, align 1 +// CHECK: %s2 = alloca %struct.S, align 1 +// CHECK: %C = alloca %struct.ConvertTo, align 1 +// CHECK: call dereferenceable(1) %struct.S* @_ZN1SaSERKS_.ifunc(%struct.S* %s2 +// CHECK: call void @_ZNK9ConvertTocv1SEv.ifunc(%struct.ConvertTo* %C) +// CHECK: call dereferenceable(1) %struct.S* @_ZN1SaSERKS_.ifunc(%struct.S* %s2 +// CHECK: call i32 @_ZN1S3fooEi.ifunc(%struct.S* %s, i32 0) + +// CHECK: define %struct.S* (%struct.S*, %struct.S*)* @_ZN1SaSERKS_.resolver() comdat +// CHECK: ret %struct.S* (%struct.S*, %struct.S*)* @_ZN1SaSERKS_.arch_ivybridge +// CHECK: ret %struct.S* (%struct.S*, %struct.S*)* @_ZN1SaSERKS_ + +// CHECK: define void (%struct.ConvertTo*)* @_ZNK9ConvertTocv1SEv.resolver() comdat +// CHECK: ret void (%struct.ConvertTo*)* @_ZNK9ConvertTocv1SEv.arch_ivybridge +// CHECK: ret void (%struct.ConvertTo*)* @_ZNK9ConvertTocv1SEv + +// CHECK: define i32 (%struct.S*, i32)* @_ZN1S3fooEi.resolver() comdat +// CHECK: ret i32 (%struct.S*, i32)* @_ZN1S3fooEi.arch_sandybridge +// CHECK: ret i32 (%struct.S*, i32)* @_ZN1S3fooEi.arch_ivybridge +// CHECK: ret i32 (%struct.S*, i32)* @_ZN1S3fooEi.sse4.2 +// CHECK: ret i32 (%struct.S*, i32)* @_ZN1S3fooEi + +// CHECK: define i32 @_Z4bar2v() +// CHECK:call i32 @_ZN2S23fooEi.ifunc +// define i32 (%struct.S2*, i32)* @_ZN2S23fooEi.resolver() comdat +// CHECK: ret i32 (%struct.S2*, i32)* @_ZN2S23fooEi.arch_sandybridge +// CHECK: ret i32 (%struct.S2*, i32)* @_ZN2S23fooEi.arch_ivybridge +// CHECK: ret i32 (%struct.S2*, i32)* @_ZN2S23fooEi.sse4.2 +// CHECK: ret i32 (%struct.S2*, i32)* @_ZN2S23fooEi + +// CHECK: define i32 @_ZN2S23fooEi.sse4.2(%struct.S2* %this, i32) +// CHECK: define i32 @_ZN2S23fooEi.arch_ivybridge(%struct.S2* %this, i32) +// CHECK: define i32 @_ZN2S23fooEi(%struct.S2* %this, i32) + +// CHECK: define i32 @_Z9templ_usev() +// CHECK: call i32 @_ZN5templIiE3fooEi.ifunc +// CHECK: call i32 @_ZN5templIdE3fooEi.ifunc + + +// CHECK: define i32 (%struct.templ*, i32)* @_ZN5templIiE3fooEi.resolver() comdat +// CHECK: ret i32 (%struct.templ*, i32)* @_ZN5templIiE3fooEi.arch_sandybridge +// CHECK: ret i32 (%struct.templ*, i32)* @_ZN5templIiE3fooEi.arch_ivybridge +// CHECK: ret i32 (%struct.templ*, i32)* @_ZN5templIiE3fooEi.sse4.2 +// CHECK: ret i32 (%struct.templ*, i32)* @_ZN5templIiE3fooEi +// +// CHECK: define i32 (%struct.templ.0*, i32)* @_ZN5templIdE3fooEi.resolver() comdat +// CHECK: ret i32 (%struct.templ.0*, i32)* @_ZN5templIdE3fooEi.arch_sandybridge +// CHECK: ret i32 (%struct.templ.0*, i32)* @_ZN5templIdE3fooEi.arch_ivybridge +// CHECK: ret i32 (%struct.templ.0*, i32)* @_ZN5templIdE3fooEi.sse4.2 +// CHECK: ret i32 (%struct.templ.0*, i32)* @_ZN5templIdE3fooEi + +// CHECK: define linkonce_odr i32 @_ZN1S3fooEi.sse4.2(%struct.S* %this, i32) +// CHECK: ret i32 0 + +// CHECK: declare i32 @_ZN1S3fooEi.arch_sandybridge(%struct.S*, i32) + +// CHECK: define linkonce_odr i32 @_ZN1S3fooEi.arch_ivybridge(%struct.S* %this, i32) +// CHECK: ret i32 1 + +// CHECK: define linkonce_odr i32 @_ZN1S3fooEi(%struct.S* %this, i32) +// CHECK: ret i32 2 + diff --git a/test/CodeGenCXX/attr-target-mv-modules.cpp b/test/CodeGenCXX/attr-target-mv-modules.cpp new file mode 100644 index 0000000000000..6ff2046831e63 --- /dev/null +++ b/test/CodeGenCXX/attr-target-mv-modules.cpp @@ -0,0 +1,29 @@ +// RUN: %clang_cc1 -std=c++11 -triple x86_64-linux-gnu -fmodules -emit-llvm %s -o - | FileCheck %s +#pragma clang module build A +module A {} +#pragma clang module contents +#pragma clang module begin A +__attribute__((target("default"))) void f(); +__attribute__((target("sse4.2"))) void f(); +#pragma clang module end +#pragma clang module endbuild + +#pragma clang module build B +module B {} +#pragma clang module contents +#pragma clang module begin B +__attribute__((target("default"))) void f(); +__attribute__((target("sse4.2"))) void f(); +#pragma clang module end +#pragma clang module endbuild + +#pragma clang module import A +#pragma clang module import B +void g() { f(); } + +// Negative tests to validate that the resolver only calls each 1x. +// CHECK: define void ()* @_Z1fv.resolver +// CHECK: ret void ()* @_Z1fv.sse4.2 +// CHECK-NOT: ret void ()* @_Z1fv.sse4.2 +// CHECK: ret void ()* @_Z1fv +// CHECK-NOT: ret void ()* @_Z1fv diff --git a/test/CodeGenCXX/attr-target-mv-out-of-line-defs.cpp b/test/CodeGenCXX/attr-target-mv-out-of-line-defs.cpp new file mode 100644 index 0000000000000..63353c12d29a2 --- /dev/null +++ b/test/CodeGenCXX/attr-target-mv-out-of-line-defs.cpp @@ -0,0 +1,39 @@ +// RUN: %clang_cc1 -std=c++11 -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck %s +struct S { + int __attribute__((target("sse4.2"))) foo(int); + int __attribute__((target("arch=sandybridge"))) foo(int); + int __attribute__((target("arch=ivybridge"))) foo(int); + int __attribute__((target("default"))) foo(int); +}; + +int __attribute__((target("default"))) S::foo(int) { return 2; } +int __attribute__((target("sse4.2"))) S::foo(int) { return 0; } +int __attribute__((target("arch=ivybridge"))) S::foo(int) { return 1; } + +int bar() { + S s; + return s.foo(0); +} + +// CHECK: @_ZN1S3fooEi.ifunc = ifunc i32 (%struct.S*, i32), i32 (%struct.S*, i32)* ()* @_ZN1S3fooEi.resolver + +// CHECK: define i32 @_ZN1S3fooEi(%struct.S* %this, i32) +// CHECK: ret i32 2 + +// CHECK: define i32 @_ZN1S3fooEi.sse4.2(%struct.S* %this, i32) +// CHECK: ret i32 0 + +// CHECK: define i32 @_ZN1S3fooEi.arch_ivybridge(%struct.S* %this, i32) +// CHECK: ret i32 1 + +// CHECK: define i32 @_Z3barv() +// CHECK: %s = alloca %struct.S, align 1 +// CHECK: %call = call i32 @_ZN1S3fooEi.ifunc(%struct.S* %s, i32 0) + +// CHECK: define i32 (%struct.S*, i32)* @_ZN1S3fooEi.resolver() comdat +// CHECK: ret i32 (%struct.S*, i32)* @_ZN1S3fooEi.arch_sandybridge +// CHECK: ret i32 (%struct.S*, i32)* @_ZN1S3fooEi.arch_ivybridge +// CHECK: ret i32 (%struct.S*, i32)* @_ZN1S3fooEi.sse4.2 +// CHECK: ret i32 (%struct.S*, i32)* @_ZN1S3fooEi + +// CHECK: declare i32 @_ZN1S3fooEi.arch_sandybridge(%struct.S*, i32) diff --git a/test/CodeGenCXX/attr-target-mv-overloads.cpp b/test/CodeGenCXX/attr-target-mv-overloads.cpp new file mode 100644 index 0000000000000..c72ea77fa46f6 --- /dev/null +++ b/test/CodeGenCXX/attr-target-mv-overloads.cpp @@ -0,0 +1,50 @@ +// RUN: %clang_cc1 -std=c++11 -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck %s + +int __attribute__((target("sse4.2"))) foo_overload(int) { return 0; } +int __attribute__((target("arch=sandybridge"))) foo_overload(int); +int __attribute__((target("arch=ivybridge"))) foo_overload(int) {return 1;} +int __attribute__((target("default"))) foo_overload(int) { return 2; } +int __attribute__((target("sse4.2"))) foo_overload(void) { return 0; } +int __attribute__((target("arch=sandybridge"))) foo_overload(void); +int __attribute__((target("arch=ivybridge"))) foo_overload(void) {return 1;} +int __attribute__((target("default"))) foo_overload(void) { return 2; } + +int bar2() { + return foo_overload() + foo_overload(1); +} + +// CHECK: @_Z12foo_overloadv.ifunc = ifunc i32 (), i32 ()* ()* @_Z12foo_overloadv.resolver +// CHECK: @_Z12foo_overloadi.ifunc = ifunc i32 (i32), i32 (i32)* ()* @_Z12foo_overloadi.resolver + + +// CHECK: define i32 @_Z12foo_overloadi.sse4.2(i32) +// CHECK: ret i32 0 +// CHECK: define i32 @_Z12foo_overloadi.arch_ivybridge(i32) +// CHECK: ret i32 1 +// CHECK: define i32 @_Z12foo_overloadi(i32) +// CHECK: ret i32 2 +// CHECK: define i32 @_Z12foo_overloadv.sse4.2() +// CHECK: ret i32 0 +// CHECK: define i32 @_Z12foo_overloadv.arch_ivybridge() +// CHECK: ret i32 1 +// CHECK: define i32 @_Z12foo_overloadv() +// CHECK: ret i32 2 + +// CHECK: define i32 @_Z4bar2v() +// CHECK: call i32 @_Z12foo_overloadv.ifunc() +// CHECK: call i32 @_Z12foo_overloadi.ifunc(i32 1) + +// CHECK: define i32 ()* @_Z12foo_overloadv.resolver() comdat +// CHECK: ret i32 ()* @_Z12foo_overloadv.arch_sandybridge +// CHECK: ret i32 ()* @_Z12foo_overloadv.arch_ivybridge +// CHECK: ret i32 ()* @_Z12foo_overloadv.sse4.2 +// CHECK: ret i32 ()* @_Z12foo_overloadv + +// CHECK: define i32 (i32)* @_Z12foo_overloadi.resolver() comdat +// CHECK: ret i32 (i32)* @_Z12foo_overloadi.arch_sandybridge +// CHECK: ret i32 (i32)* @_Z12foo_overloadi.arch_ivybridge +// CHECK: ret i32 (i32)* @_Z12foo_overloadi.sse4.2 +// CHECK: ret i32 (i32)* @_Z12foo_overloadi + +// CHECK: declare i32 @_Z12foo_overloadv.arch_sandybridge() +// CHECK: declare i32 @_Z12foo_overloadi.arch_sandybridge(i32) diff --git a/test/CodeGenCXX/attr-x86-interrupt.cpp b/test/CodeGenCXX/attr-x86-interrupt.cpp index 5000104690350..30cf58b1e2e3d 100644 --- a/test/CodeGenCXX/attr-x86-interrupt.cpp +++ b/test/CodeGenCXX/attr-x86-interrupt.cpp @@ -26,10 +26,10 @@ static void foo9(int *a) __attribute__((interrupt)) {} // X86_LINUX: define x86_intrcc void @{{.*}}foo8{{.*}}(i32* %{{.+}}) // X86_LINUX: define linkonce_odr x86_intrcc void @{{.*}}foo9{{.*}}(i32* %{{.+}}) // X86_64_WIN: @llvm.used = appending global [3 x i8*] [i8* bitcast (void (i32*, i64)* @{{.*}}foo7{{.*}} to i8*), i8* bitcast (void (i32*)* @{{.*}}foo8{{.*}} to i8*), i8* bitcast (void (i32*)* @{{.*}}foo9{{.*}} to i8*)], section "llvm.metadata" -// X86_64_WIN: define x86_intrcc void @{{.*}}foo7{{.*}}(i32* %{{.+}}, i64 %{{.+}}) -// X86_64_WIN: define x86_intrcc void @{{.*}}foo8{{.*}}(i32* %{{.+}}) -// X86_64_WIN: define linkonce_odr x86_intrcc void @{{.*}}foo9{{.*}}(i32* %{{.+}}) +// X86_64_WIN: define dso_local x86_intrcc void @{{.*}}foo7{{.*}}(i32* %{{.+}}, i64 %{{.+}}) +// X86_64_WIN: define dso_local x86_intrcc void @{{.*}}foo8{{.*}}(i32* %{{.+}}) +// X86_64_WIN: define linkonce_odr dso_local x86_intrcc void @{{.*}}foo9{{.*}}(i32* %{{.+}}) // X86_WIN: @llvm.used = appending global [3 x i8*] [i8* bitcast (void (i32*, i32)* @{{.*}}foo7{{.*}} to i8*), i8* bitcast (void (i32*)* @{{.*}}foo8{{.*}} to i8*), i8* bitcast (void (i32*)* @{{.*}}foo9{{.*}} to i8*)], section "llvm.metadata" -// X86_WIN: define x86_intrcc void @{{.*}}foo7{{.*}}(i32* %{{.+}}, i32 %{{.+}}) -// X86_WIN: define x86_intrcc void @{{.*}}foo8{{.*}}(i32* %{{.+}}) -// X86_WIN: define linkonce_odr x86_intrcc void @{{.*}}foo9{{.*}}(i32* %{{.+}}) +// X86_WIN: define dso_local x86_intrcc void @{{.*}}foo7{{.*}}(i32* %{{.+}}, i32 %{{.+}}) +// X86_WIN: define dso_local x86_intrcc void @{{.*}}foo8{{.*}}(i32* %{{.+}}) +// X86_WIN: define linkonce_odr dso_local x86_intrcc void @{{.*}}foo9{{.*}}(i32* %{{.+}}) diff --git a/test/CodeGenCXX/block-capture.cpp b/test/CodeGenCXX/block-capture.cpp new file mode 100644 index 0000000000000..623838357a389 --- /dev/null +++ b/test/CodeGenCXX/block-capture.cpp @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -x c++ -std=c++11 -fblocks -emit-llvm %s -o - | FileCheck %s + +// CHECK: %struct.__block_byref_baz = type { i8*, %struct.__block_byref_baz*, i32, i32, i32 } +// CHECK: [[baz:%[0-9a-z_]*]] = alloca %struct.__block_byref_baz +// CHECK: [[bazref:%[0-9a-z_\.]*]] = getelementptr inbounds %struct.__block_byref_baz, %struct.__block_byref_baz* [[baz]], i32 0, i32 1 +// CHECK: store %struct.__block_byref_baz* [[baz]], %struct.__block_byref_baz** [[bazref]] +// CHECK: [[disposable:%[0-9a-z_]*]] = bitcast %struct.__block_byref_baz* [[baz]] to i8* +// CHECK: call void @_Block_object_dispose(i8* [[disposable]] + +int main() { + __block int baz = [&]() { return 0; }(); + return 0; +} diff --git a/test/CodeGenCXX/block-inalloca.cpp b/test/CodeGenCXX/block-inalloca.cpp new file mode 100644 index 0000000000000..b827dde7abdc7 --- /dev/null +++ b/test/CodeGenCXX/block-inalloca.cpp @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -triple i686-unknown-windows-msvc -fblocks -emit-llvm -o - %s | FileCheck %s + +struct S { + S(const struct S &) {} +}; + +void (^b)(S) = ^(S) {}; + +// CHECK: [[DESCRIPTOR:%.*]] = getelementptr inbounds <{ i8*, %struct.S, [3 x i8] }>, <{ i8*, %struct.S, [3 x i8] }>* %0, i32 0, i32 0 +// CHECK: load i8*, i8** [[DESCRIPTOR]] + diff --git a/test/CodeGenCXX/builtin-operator-new-delete.cpp b/test/CodeGenCXX/builtin-operator-new-delete.cpp new file mode 100644 index 0000000000000..712805a62390a --- /dev/null +++ b/test/CodeGenCXX/builtin-operator-new-delete.cpp @@ -0,0 +1,71 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s \ +// RUN: -faligned-allocation -fsized-deallocation -emit-llvm -o - \ +// RUN: | FileCheck %s + +typedef __SIZE_TYPE__ size_t; + +// Declare an 'operator new' template to tickle a bug in __builtin_operator_new. +template<typename T> void *operator new(size_t, int (*)(T)); + +// Ensure that this declaration doesn't cause operator new to lose its +// 'noalias' attribute. +void *operator new(size_t); + +namespace std { + struct nothrow_t {}; + enum class align_val_t : size_t { __zero = 0, + __max = (size_t)-1 }; +} +std::nothrow_t nothrow; + +// Declare the reserved placement operators. +void *operator new(size_t, void*) throw(); +void operator delete(void*, void*) throw(); +void *operator new[](size_t, void*) throw(); +void operator delete[](void*, void*) throw(); + +// Declare the replaceable global allocation operators. +void *operator new(size_t, const std::nothrow_t &) throw(); +void *operator new[](size_t, const std::nothrow_t &) throw(); +void operator delete(void *, const std::nothrow_t &) throw(); +void operator delete[](void *, const std::nothrow_t &) throw(); + +// Declare some other placement operators. +void *operator new(size_t, void*, bool) throw(); +void *operator new[](size_t, void*, bool) throw(); + + +// CHECK-LABEL: define void @test_basic( +extern "C" void test_basic() { + // CHECK: call i8* @_Znwm(i64 4) [[ATTR_BUILTIN_NEW:#[^ ]*]] + // CHECK: call void @_ZdlPv({{.*}}) [[ATTR_BUILTIN_DELETE:#[^ ]*]] + // CHECK: ret void + __builtin_operator_delete(__builtin_operator_new(4)); +} +// CHECK: declare noalias i8* @_Znwm(i64) [[ATTR_NOBUILTIN:#[^ ]*]] +// CHECK: declare void @_ZdlPv(i8*) [[ATTR_NOBUILTIN_NOUNWIND:#[^ ]*]] + +// CHECK-LABEL: define void @test_aligned_alloc( +extern "C" void test_aligned_alloc() { + // CHECK: call i8* @_ZnwmSt11align_val_t(i64 4, i64 4) [[ATTR_BUILTIN_NEW:#[^ ]*]] + // CHECK: call void @_ZdlPvSt11align_val_t({{.*}}, i64 4) [[ATTR_BUILTIN_DELETE:#[^ ]*]] + __builtin_operator_delete(__builtin_operator_new(4, std::align_val_t(4)), std::align_val_t(4)); +} +// CHECK: declare noalias i8* @_ZnwmSt11align_val_t(i64, i64) [[ATTR_NOBUILTIN:#[^ ]*]] +// CHECK: declare void @_ZdlPvSt11align_val_t(i8*, i64) [[ATTR_NOBUILTIN_NOUNWIND:#[^ ]*]] + + +// CHECK-LABEL: define void @test_sized_delete( +extern "C" void test_sized_delete() { + // CHECK: call i8* @_Znwm(i64 4) [[ATTR_BUILTIN_NEW:#[^ ]*]] + // CHECK: call void @_ZdlPvm({{.*}}, i64 4) [[ATTR_BUILTIN_DELETE:#[^ ]*]] + __builtin_operator_delete(__builtin_operator_new(4), 4); +} +// CHECK: declare void @_ZdlPvm(i8*, i64) [[ATTR_NOBUILTIN_UNWIND:#[^ ]*]] + + +// CHECK-DAG: attributes [[ATTR_NOBUILTIN]] = {{[{].*}} nobuiltin {{.*[}]}} +// CHECK-DAG: attributes [[ATTR_NOBUILTIN_NOUNWIND]] = {{[{].*}} nobuiltin nounwind {{.*[}]}} + +// CHECK-DAG: attributes [[ATTR_BUILTIN_NEW]] = {{[{].*}} builtin {{.*[}]}} +// CHECK-DAG: attributes [[ATTR_BUILTIN_DELETE]] = {{[{].*}} builtin {{.*[}]}} diff --git a/test/CodeGenCXX/builtins.cpp b/test/CodeGenCXX/builtins.cpp index a49deea2524c5..33c714e9e1861 100644 --- a/test/CodeGenCXX/builtins.cpp +++ b/test/CodeGenCXX/builtins.cpp @@ -30,3 +30,19 @@ long y = __builtin_abs(-2l); extern const char char_memchr_arg[32]; char *memchr_result = __builtin_char_memchr(char_memchr_arg, 123, 32); // CHECK: call i8* @memchr(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @char_memchr_arg, i32 0, i32 0), i32 123, i64 32) + +int constexpr_overflow_result() { + constexpr int x = 1; + // CHECK: alloca i32 + constexpr int y = 2; + // CHECK: alloca i32 + int z; + // CHECK: [[Z:%.+]] = alloca i32 + + __builtin_sadd_overflow(x, y, &z); + return z; + // CHECK: [[RET_PTR:%.+]] = extractvalue { i32, i1 } %0, 0 + // CHECK: store i32 [[RET_PTR]], i32* [[Z]] + // CHECK: [[RET_VAL:%.+]] = load i32, i32* [[Z]] + // CHECK: ret i32 [[RET_VAL]] +} diff --git a/test/CodeGenCXX/captured-statements.cpp b/test/CodeGenCXX/captured-statements.cpp index 95e73e548399b..c8832f1db714a 100644 --- a/test/CodeGenCXX/captured-statements.cpp +++ b/test/CodeGenCXX/captured-statements.cpp @@ -182,7 +182,7 @@ void test_capture_lambda() { } inline int test_captured_linkage() { - // CHECK-7: @_ZZ21test_captured_linkagevE1i = linkonce_odr global i32 0 + // CHECK-7: @_ZZ21test_captured_linkagevE1i = linkonce_odr {{(dso_local )?}}global i32 0 int j; #pragma clang __debug captured { diff --git a/test/CodeGenCXX/catch-undef-behavior.cpp b/test/CodeGenCXX/catch-undef-behavior.cpp index e8287538982b8..4513936e49a30 100644 --- a/test/CodeGenCXX/catch-undef-behavior.cpp +++ b/test/CodeGenCXX/catch-undef-behavior.cpp @@ -206,7 +206,7 @@ void bad_downcast_pointer(S *p) { // CHECK: %[[NONNULL:.*]] = icmp ne {{.*}}, null // CHECK: br i1 %[[NONNULL]], - // A null poiner access is guarded without -fsanitize=null. + // A null pointer access is guarded without -fsanitize=null. // DOWNCAST-NULL: %[[NONNULL:.*]] = icmp ne {{.*}}, null // DOWNCAST-NULL: br i1 %[[NONNULL]], @@ -371,7 +371,7 @@ class C : public A, public B // align=16 void downcast_pointer(B *b) { (void) static_cast<C*>(b); // Alignment check from EmitTypeCheck(TCK_DowncastPointer, ...) - // CHECK: [[SUB:%[.a-z0-9]*]] = getelementptr i8, i8* {{.*}}, i64 -16 + // CHECK: [[SUB:%[.a-z0-9]*]] = getelementptr inbounds i8, i8* {{.*}}, i64 -16 // CHECK-NEXT: [[C:%.+]] = bitcast i8* [[SUB]] to %class.C* // null check goes here // CHECK: [[FROM_PHI:%.+]] = phi %class.C* [ [[C]], {{.*}} ], {{.*}} @@ -388,7 +388,7 @@ void downcast_pointer(B *b) { void downcast_reference(B &b) { (void) static_cast<C&>(b); // Alignment check from EmitTypeCheck(TCK_DowncastReference, ...) - // CHECK: [[SUB:%[.a-z0-9]*]] = getelementptr i8, i8* {{.*}}, i64 -16 + // CHECK: [[SUB:%[.a-z0-9]*]] = getelementptr inbounds i8, i8* {{.*}}, i64 -16 // CHECK-NEXT: [[C:%.+]] = bitcast i8* [[SUB]] to %class.C* // Objectsize check goes here // CHECK: [[C_INT:%.+]] = ptrtoint %class.C* [[C]] to i64 diff --git a/test/CodeGenCXX/cfi-cross-dso.cpp b/test/CodeGenCXX/cfi-cross-dso.cpp index bfa0705c6f8f4..6d5e0591191cc 100644 --- a/test/CodeGenCXX/cfi-cross-dso.cpp +++ b/test/CodeGenCXX/cfi-cross-dso.cpp @@ -26,7 +26,7 @@ void g() { b.f(); } -// MS: @[[B_VTABLE:.*]] = private unnamed_addr constant { [2 x i8*] } {{.*}}@"\01??_R4B@?A@@6B@"{{.*}}@"\01?f@B@?A@@UEAAXXZ" +// MS: @[[B_VTABLE:.*]] = private unnamed_addr constant { [2 x i8*] } {{.*}}@"??_R4B@?A@@6B@"{{.*}}@"?f@B@?A@@UEAAXXZ" // CHECK: %[[VT:.*]] = load void (%struct.A*)**, void (%struct.A*)*** // CHECK: %[[VT2:.*]] = bitcast {{.*}}%[[VT]] to i8*, !nosanitize diff --git a/test/CodeGenCXX/cfi-icall.cpp b/test/CodeGenCXX/cfi-icall.cpp index 5f5778fc1f7c0..e53aeefd8a9be 100644 --- a/test/CodeGenCXX/cfi-icall.cpp +++ b/test/CodeGenCXX/cfi-icall.cpp @@ -21,7 +21,7 @@ void g() { } // ITANIUM: define internal void @_ZN12_GLOBAL__N_11fENS_1SE({{.*}} !type [[TS1:![0-9]+]] !type [[TS2:![0-9]+]] -// MS: define internal void @"\01?f@?A@@YAXUS@?A@@@Z"({{.*}} !type [[TS1:![0-9]+]] !type [[TS2:![0-9]+]] +// MS: define internal void @"?f@?A@@YAXUS@?A@@@Z"({{.*}} !type [[TS1:![0-9]+]] !type [[TS2:![0-9]+]] // CHECK: [[VOIDS1]] = distinct !{} // CHECK: [[TS1]] = !{i64 0, [[VOIDS1]]} diff --git a/test/CodeGenCXX/cfi-mfcall-incomplete.cpp b/test/CodeGenCXX/cfi-mfcall-incomplete.cpp new file mode 100644 index 0000000000000..345be124e93b8 --- /dev/null +++ b/test/CodeGenCXX/cfi-mfcall-incomplete.cpp @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-linux -fsanitize=cfi-mfcall -fsanitize-trap=cfi-mfcall -fvisibility hidden -emit-llvm -o - %s | FileCheck %s + +struct S; + +void f(S *s, void (S::*p)()) { + // CHECK-NOT: llvm.type.test + // CHECK: llvm.type.test{{.*}}!"_ZTSM1SFvvE.virtual" + // CHECK-NOT: llvm.type.test + (s->*p)(); +} + +// CHECK: declare i1 @llvm.type.test diff --git a/test/CodeGenCXX/cfi-mfcall.cpp b/test/CodeGenCXX/cfi-mfcall.cpp new file mode 100644 index 0000000000000..c16b20b8dcec8 --- /dev/null +++ b/test/CodeGenCXX/cfi-mfcall.cpp @@ -0,0 +1,30 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-linux -fsanitize=cfi-mfcall -fsanitize-trap=cfi-mfcall -fvisibility hidden -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-unknown-linux -fsanitize=cfi-mfcall -fsanitize-trap=cfi-mfcall -fvisibility default -emit-llvm -o - %s | FileCheck --check-prefix=DEFAULT %s + +struct B1 {}; +struct B2 {}; +struct B3 : B2 {}; +struct S : B1, B3 {}; + +// DEFAULT-NOT: llvm.type.test + +void f(S *s, void (S::*p)()) { + // CHECK: [[OFFSET:%.*]] = sub i64 {{.*}}, 1 + // CHECK: [[VFPTR:%.*]] = getelementptr i8, i8* %{{.*}}, i64 [[OFFSET]] + // CHECK: [[TT:%.*]] = call i1 @llvm.type.test(i8* [[VFPTR]], metadata !"_ZTSM1SFvvE.virtual") + // CHECK: br i1 [[TT]], label {{.*}}, label %[[TRAP1:[^,]*]] + + // CHECK: [[TRAP1]]: + // CHECK-NEXT: llvm.trap + + // CHECK: [[NVFPTR:%.*]] = bitcast void (%struct.S*)* {{.*}} to i8* + // CHECK: [[TT1:%.*]] = call i1 @llvm.type.test(i8* [[NVFPTR]], metadata !"_ZTSM2B1FvvE") + // CHECK: [[OR1:%.*]] = or i1 false, [[TT1]] + // CHECK: [[TT2:%.*]] = call i1 @llvm.type.test(i8* [[NVFPTR]], metadata !"_ZTSM2B2FvvE") + // CHECK: [[OR2:%.*]] = or i1 [[OR1]], [[TT2]] + // CHECK: br i1 [[OR2]], label {{.*}}, label %[[TRAP2:[^,]*]] + + // CHECK: [[TRAP2]]: + // CHECK-NEXT: llvm.trap + (s->*p)(); +} diff --git a/test/CodeGenCXX/cfi-ms-vbase-derived-cast.cpp b/test/CodeGenCXX/cfi-ms-vbase-derived-cast.cpp index 3276d8f33edc2..6142ca56878fb 100644 --- a/test/CodeGenCXX/cfi-ms-vbase-derived-cast.cpp +++ b/test/CodeGenCXX/cfi-ms-vbase-derived-cast.cpp @@ -8,7 +8,7 @@ struct foo { template <typename T> struct bar : virtual public foo { void f() { - // CHECK: define{{.*}}@"\01?f@?$bar@Ubaz@@@@UEAAXXZ" + // CHECK: define{{.*}}@"?f@?$bar@Ubaz@@@@UEAAXXZ" // Load "this", vbtable, vbase offset and vtable. // CHECK: load // CHECK: load diff --git a/test/CodeGenCXX/cfi-ms-vbase-nvcall.cpp b/test/CodeGenCXX/cfi-ms-vbase-nvcall.cpp index ab610628232e2..d4232555c9d8a 100644 --- a/test/CodeGenCXX/cfi-ms-vbase-nvcall.cpp +++ b/test/CodeGenCXX/cfi-ms-vbase-nvcall.cpp @@ -16,7 +16,7 @@ struct baz : public bar<baz> { }; void f(baz *z) { - // CHECK: define{{.*}}@"\01?f@@YAXPEAUbaz@@@Z" + // CHECK: define{{.*}}@"?f@@YAXPEAUbaz@@@Z" // Load z, vbtable, vbase offset and vtable. // CHECK: load // CHECK: load diff --git a/test/CodeGenCXX/cfi-vcall-check-after-args.cpp b/test/CodeGenCXX/cfi-vcall-check-after-args.cpp new file mode 100644 index 0000000000000..4c2ea8c9e85fd --- /dev/null +++ b/test/CodeGenCXX/cfi-vcall-check-after-args.cpp @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -flto -flto-unit -triple x86_64-unknown-linux -fvisibility hidden -fsanitize=cfi-vcall -fsanitize-trap=cfi-vcall -emit-llvm -o - %s | FileCheck %s + +struct A { + virtual void f(int); +}; + +int g(); +void f(A *a) { + // CHECK: call i32 @_Z1gv() + // CHECK: call i1 @llvm.type.test + a->f(g()); +} diff --git a/test/CodeGenCXX/char8_t.cpp b/test/CodeGenCXX/char8_t.cpp new file mode 100644 index 0000000000000..f24f12d6df404 --- /dev/null +++ b/test/CodeGenCXX/char8_t.cpp @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -std=c++17 -emit-llvm -fchar8_t -triple x86_64-linux %s -o - | FileCheck %s +// RUN: %clang_cc1 -std=c++17 -emit-llvm -fchar8_t -triple x86_64-windows %s -o - -verify + +// CHECK: define void @_Z1fDu( +void f(char8_t c) {} // expected-error {{cannot mangle this built-in char8_t type yet}} + +// CHECK: define weak_odr void @_Z1gIiEvDTplplcvT__ELA4_KDuELDu114EE +template<typename T> void g(decltype(T() + u8"foo" + u8'r')) {} +template void g<int>(const char8_t*); diff --git a/test/CodeGenCXX/code-seg.cpp b/test/CodeGenCXX/code-seg.cpp new file mode 100644 index 0000000000000..7dad9274208ab --- /dev/null +++ b/test/CodeGenCXX/code-seg.cpp @@ -0,0 +1,139 @@ +// RUN: %clang_cc1 -emit-llvm -triple i686-pc-win32 -fms-extensions -verify -o - %s | FileCheck %s +// expected-no-diagnostics + +// Simple case + +int __declspec(code_seg("foo_one")) bar_one() { return 1; } +//CHECK: define {{.*}}bar_one{{.*}} section "foo_one" + +// Simple case - explicit attribute used over pragma +#pragma code_seg("foo_two") +int __declspec(code_seg("foo_three")) bar2() { return 2; } +//CHECK: define {{.*}}bar2{{.*}} section "foo_three" + +// Check that attribute on one function doesn't affect another +int another1() { return 1001; } +//CHECK: define {{.*}}another1{{.*}} section "foo_two" + +// Member functions + +struct __declspec(code_seg("foo_four")) Foo { + int bar3() {return 0;} + int bar4(); + int __declspec(code_seg("foo_six")) bar6() { return 6; } + int bar7() { return 7; } + struct Inner { + int bar5() { return 5; } + } z; + virtual int baz1() { return 1; } +}; + +struct __declspec(code_seg("foo_four")) FooTwo : Foo { + int baz1() { return 20; } +}; + +int caller1() { + Foo f; return f.bar3(); +} + +//CHECK: define {{.*}}bar3@Foo{{.*}} section "foo_four" +int Foo::bar4() { return 4; } +//CHECK: define {{.*}}bar4@Foo{{.*}} section "foo_four" + +#pragma code_seg("someother") + +int caller2() { + Foo f; + Foo *fp = new FooTwo; + return f.z.bar5() + f.bar6() + f.bar7() + fp->baz1(); +} +// MS Compiler and Docs do not match for nested routines +// Doc says: define {{.*}}bar5@Inner@Foo{{.*}} section "foo_four" +// Compiler says: define {{.*}}bar5@Inner@Foo{{.*}} section "foo_two" +// A bug has been reported: see https://reviews.llvm.org/D22931, the +// Microsoft feedback page is no longer available. +//CHECK: define {{.*}}bar5@Inner@Foo{{.*}} section "foo_two" +//CHECK: define {{.*}}bar6@Foo{{.*}} section "foo_six" +//CHECK: define {{.*}}bar7@Foo{{.*}} section "foo_four" +// Check that code_seg active at class declaration is not used on member +// declared outside class when it is not active. + +#pragma code_seg(push,"AnotherSeg") + +struct FooThree { + int bar8(); + int bar9() { return 9; } +}; + +#pragma code_seg(pop) + + +int FooThree::bar8() {return 0;} + +int caller3() +{ + FooThree f; + return f.bar8() + f.bar9(); +} + +//CHECK: define {{.*}}bar8@FooThree{{.*}} section "someother" +//CHECK: define {{.*}}bar9@FooThree{{.*}} section "AnotherSeg" + +struct NonTrivialCopy { + NonTrivialCopy(); + NonTrivialCopy(const NonTrivialCopy&); + ~NonTrivialCopy(); +}; + +// check the section for compiler-generated function with declspec. + +struct __declspec(code_seg("foo_seven")) FooFour { + FooFour() {} + int __declspec(code_seg("foo_eight")) bar10(int t) { return t; } + NonTrivialCopy f; +}; + +//CHECK: define {{.*}}0FooFour@@QAE@ABU0@@Z{{.*}} section "foo_seven" +// check the section for compiler-generated function with no declspec. + +struct FooFive { + FooFive() {} + int __declspec(code_seg("foo_nine")) bar11(int t) { return t; } + NonTrivialCopy f; +}; + +//CHECK: define {{.*}}0FooFive@@QAE@ABU0@@Z{{.*}} section "someother" + +#pragma code_seg("YetAnother") +int caller4() +{ + FooFour z1; + FooFour z2 = z1; + FooFive y1; + FooFive y2 = y1; + return z2.bar10(0) + y2.bar11(1); +} + +//CHECK: define {{.*}}bar10@FooFour{{.*}} section "foo_eight" +//CHECK: define {{.*}}bar11@FooFive{{.*}} section "foo_nine" + +struct FooSix { + #pragma code_seg("foo_ten") + int bar12() { return 12; } + #pragma code_seg("foo_eleven") + int bar13() { return 13; } +}; + +int bar14() { return 14; } +//CHECK: define {{.*}}bar14{{.*}} section "foo_eleven" + +int caller5() +{ + FooSix fsix; + return fsix.bar12() + fsix.bar13(); +} + +//CHECK: define {{.*}}bar12@FooSix{{.*}} section "foo_ten" +//CHECK: define {{.*}}bar13@FooSix{{.*}} section "foo_eleven" +//CHECK: define {{.*}}baz1@FooTwo{{.*}} section "foo_four" + diff --git a/test/CodeGenCXX/code-seg1.cpp b/test/CodeGenCXX/code-seg1.cpp new file mode 100644 index 0000000000000..93be3e520a546 --- /dev/null +++ b/test/CodeGenCXX/code-seg1.cpp @@ -0,0 +1,87 @@ +// RUN: %clang_cc1 -emit-llvm -triple i686-pc-win32 -fms-extensions -verify -o - %s | FileCheck %s +// expected-no-diagnostics +// The Microsoft document says: "When this attribute is applied to a class, +// all member functions of the class and nested classes - this includes +// compiler-generated special member functions - are put in the specified segment." +// But the MS compiler does not always follow that. A bug has been reported: +// see https://reviews.llvm.org/D22931, the Microsoft feedback page is no +// longer available. +// The MS compiler will apply a declspec from the parent class if there is no +// #pragma code_seg active at the class definition. If there is an active +// code_seg that is used instead. + +// No active code_seg + +struct __declspec(code_seg("foo_outer")) Foo1 { + struct Inner { + void bar1(); + static void bar2(); + }; +}; +void Foo1::Inner::bar1() {} +void Foo1::Inner::bar2() {} + +//CHECK: define {{.*}}bar1@Inner@Foo1{{.*}} section "foo_outer" +//CHECK: define {{.*}}bar2@Inner@Foo1{{.*}} section "foo_outer" + +struct __declspec(code_seg("foo_outer")) Foo2 { + struct __declspec(code_seg("foo_inner")) Inner { + void bar1(); + static void bar2(); + }; +}; +void Foo2::Inner::bar1() {} +void Foo2::Inner::bar2() {} + +//CHECK: define {{.*}}bar1@Inner@Foo2{{.*}} section "foo_inner" +//CHECK: define {{.*}}bar2@Inner@Foo2{{.*}} section "foo_inner" + +#pragma code_seg(push, "otherseg") +struct __declspec(code_seg("foo_outer")) Foo3 { + struct Inner { + void bar1(); + static void bar2(); + }; +}; +void Foo3::Inner::bar1() {} +void Foo3::Inner::bar2() {} + +//CHECK: define {{.*}}bar1@Inner@Foo3{{.*}} section "otherseg" +//CHECK: define {{.*}}bar2@Inner@Foo3{{.*}} section "otherseg" + +struct __declspec(code_seg("foo_outer")) Foo4 { + struct __declspec(code_seg("foo_inner")) Inner { + void bar1(); + static void bar2(); + }; +}; +void Foo4::Inner::bar1() {} +void Foo4::Inner::bar2() {} + +//CHECK: define {{.*}}bar1@Inner@Foo4{{.*}} section "foo_inner" +//CHECK: define {{.*}}bar2@Inner@Foo4{{.*}} section "foo_inner" + +#pragma code_seg(pop) +// Back to no active pragma +struct __declspec(code_seg("foo_outer")) Foo5 { + struct Inner { + void bar1(); + static void bar2(); + struct __declspec(code_seg("inner1_seg")) Inner1 { + struct Inner2 { + void bar1(); + static void bar2(); + }; + }; + }; +}; +void Foo5::Inner::bar1() {} +void Foo5::Inner::bar2() {} +void Foo5::Inner::Inner1::Inner2::bar1() {} +void Foo5::Inner::Inner1::Inner2::bar2() {} + +//CHECK: define {{.*}}bar1@Inner@Foo5{{.*}} section "foo_outer" +//CHECK: define {{.*}}bar2@Inner@Foo5{{.*}} section "foo_outer" +//CHECK: define {{.*}}bar1@Inner2@Inner1@Inner@Foo5{{.*}} section "inner1_seg" +//CHECK: define {{.*}}bar2@Inner2@Inner1@Inner@Foo5{{.*}} section "inner1_seg" + diff --git a/test/CodeGenCXX/code-seg2.cpp b/test/CodeGenCXX/code-seg2.cpp new file mode 100644 index 0000000000000..ab72bf44cb89e --- /dev/null +++ b/test/CodeGenCXX/code-seg2.cpp @@ -0,0 +1,111 @@ +// RUN: %clang_cc1 -emit-llvm -triple i686-pc-win32 -std=c++11 -fms-extensions -verify -o - %s | FileCheck %s +// expected-no-diagnostics + +// Class member templates + +#pragma code_seg(push, "something") + +template <typename T> +struct __declspec(code_seg("foo_one")) ClassOne { + int bar1(T t) { return int(t); } + int bar2(T t); + int bar3(T t); +}; + +template <typename T> +int ClassOne<T>::bar2(T t) { + return int(t); +} + +int caller1() { + ClassOne<int> coi; + return coi.bar1(6) + coi.bar2(3); +} + +//CHECK: define {{.*}}bar1@?$ClassOne{{.*}} section "foo_one" +//CHECK: define {{.*}}bar2@?$ClassOne{{.*}} section "foo_one" + + +template <typename T> +struct ClassTwo { + int bar11(T t) { return int(t); } + int bar22(T t); + int bar33(T t); +}; + +#pragma code_seg("newone") + +template <typename T> +int ClassTwo<T>::bar22(T t) { + return int(t); +} + +#pragma code_seg("someother") + +template <typename T> +int ClassTwo<T>::bar33(T t) { + return int(t); +} + +#pragma code_seg("yetanother") + +int caller2() { + ClassTwo<int> coi; + return coi.bar11(6) + coi.bar22(3) + coi.bar33(44); +} + +//CHECK: define {{.*}}bar11@?$ClassTwo{{.*}} section "something" +//CHECK: define {{.*}}bar22@?$ClassTwo{{.*}} section "newone" +//CHECK: define {{.*}}bar33@?$ClassTwo{{.*}} section "someother" + +template<> +struct ClassOne<double> +{ + int bar44(double d) { return 1; } +}; +template<> +struct __declspec(code_seg("foo_three")) ClassOne<long> +{ + int bar55(long d) { return 1; } +}; + +#pragma code_seg("onemore") +int caller3() { + ClassOne<double> d; + ClassOne<long> l; + return d.bar44(1.0)+l.bar55(1); +} + +//CHECK: define {{.*}}bar44{{.*}} section "yetanother" +//CHECK: define {{.*}}bar55{{.*}} section "foo_three" + + +// Function templates +template <typename T> +int __declspec(code_seg("foo_four")) bar66(T t) { return int(t); } + +// specializations do not take the segment from primary +template<> +int bar66(int i) { return 0; } + +#pragma code_seg(pop) + +template<> +int bar66(char c) { return 0; } + +struct A1 {int i;}; +template<> +int __declspec(code_seg("foo_five")) bar66(A1 a) { return a.i; } + +int caller4() +{ +// but instantiations do use the section from the primary +return bar66(0) + bar66(1.0) + bar66('c'); +} +//CHECK: define {{.*}}bar66@H{{.*}} section "onemore" +//CHECK-NOT: define {{.*}}bar66@D{{.*}} section +//CHECK: define {{.*}}bar66@UA1{{.*}} section "foo_five" +//CHECK: define {{.*}}bar66@N{{.*}} section "foo_four" + + + diff --git a/test/CodeGenCXX/code-seg3.cpp b/test/CodeGenCXX/code-seg3.cpp new file mode 100644 index 0000000000000..d6f267747e3c1 --- /dev/null +++ b/test/CodeGenCXX/code-seg3.cpp @@ -0,0 +1,65 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s -triple x86_64-pc-win32 +// expected-no-diagnostics + +// Non-Member Function Overloading is involved + +int __declspec(code_seg("foo_one")) bar_one(int) { return 1; } +//CHECK: define {{.*}}bar_one{{.*}} section "foo_one" +int __declspec(code_seg("foo_two")) bar_one(int,float) { return 11; } +//CHECK: define {{.*}}bar_one{{.*}} section "foo_two" +int __declspec(code_seg("foo_three")) bar_one(float) { return 12; } +//CHECK: define {{.*}}bar_one{{.*}} section "foo_three" + +// virtual function overloading is involved + +struct __declspec(code_seg("my_one")) Base3 { + virtual int barA(int) { return 1; } + virtual int barA(int,float) { return 2; } + virtual int barA(float) { return 3; } + + virtual void __declspec(code_seg("my_two")) barB(int) { } + virtual void __declspec(code_seg("my_three")) barB(float) { } + virtual void __declspec(code_seg("my_four")) barB(int, float) { } + +}; + +//CHECK: define {{.*}}barA@Base3{{.*}} section "my_one" +//CHECK: define {{.*}}barA@Base3{{.*}} section "my_one" +//CHECK: define {{.*}}barA@Base3{{.*}} section "my_one" +//CHECK: define {{.*}}barB@Base3{{.*}} section "my_two" +//CHECK: define {{.*}}barB@Base3{{.*}} section "my_three" +//CHECK: define {{.*}}barB@Base3{{.*}} section "my_four" + +#pragma code_seg("another") +// Member functions +struct __declspec(code_seg("foo_four")) Foo { + int bar3() {return 0;} + __declspec(code_seg("foo_lala")) int bar4() {return 0;} }; int caller() {Foo f; return f.bar3() + f.bar4(); } + +//CHECK: define {{.*}}bar3@Foo{{.*}} section "foo_four" +//CHECK: define {{.*}}bar4@Foo{{.*}} section "foo_lala" + +// Lambdas +#pragma code_seg("something") + +int __declspec(code_seg("foo")) bar1() +{ + int lala = 4; + auto l = [=](int i) { return i+4; }; + return l(-4); +} + +//CHECK: define {{.*}}bar1{{.*}} section "foo" +//CHECK: define {{.*}}lambda{{.*}}bar1{{.*}} section "something" + +double __declspec(code_seg("foo")) bar2() +{ + double lala = 4.0; + auto l = [=](double d) __declspec(code_seg("another")) { return d+4.0; }; + return l(4.0); +} + +//CHECK: define {{.*}}bar2{{.*}} section "foo" +//CHECK: define {{.*}}lambda{{.*}}bar2{{.*}} section "another" + + diff --git a/test/CodeGenCXX/conditional-temporaries.cpp b/test/CodeGenCXX/conditional-temporaries.cpp index a3cc2fef1e8fd..e08de61f9d41d 100644 --- a/test/CodeGenCXX/conditional-temporaries.cpp +++ b/test/CodeGenCXX/conditional-temporaries.cpp @@ -1,4 +1,6 @@ +// REQUIRES: amdgpu-registered-target // RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 -O3 | FileCheck %s +// RUN: %clang_cc1 -emit-llvm %s -o - -triple=amdgcn-amd-amdhsa -O3 | FileCheck %s namespace { diff --git a/test/CodeGenCXX/const-base-cast.cpp b/test/CodeGenCXX/const-base-cast.cpp index dd980d5469bf4..bb08b9d21fcfc 100644 --- a/test/CodeGenCXX/const-base-cast.cpp +++ b/test/CodeGenCXX/const-base-cast.cpp @@ -7,4 +7,4 @@ struct B { char y; }; struct C : A,B {}; unsigned char x = ((char*)(B*)(C*)0x1000) - (char*)0x1000; -// CHECK: @x = global i8 1 +// CHECK: @x = {{(dso_local )?}}global i8 1 diff --git a/test/CodeGenCXX/const-global-linkage.cpp b/test/CodeGenCXX/const-global-linkage.cpp index e1e9321974792..2ec64cfeeecf1 100644 --- a/test/CodeGenCXX/const-global-linkage.cpp +++ b/test/CodeGenCXX/const-global-linkage.cpp @@ -4,7 +4,7 @@ const int x = 10; const int y = 20; const volatile int z = 30; // CHECK-NOT: @x -// CHECK: @z = constant i32 30 +// CHECK: @z = {{(dso_local )?}}constant i32 30 // CHECK: @_ZL1y = internal constant i32 20 const int& b() { return y; } @@ -12,6 +12,6 @@ const char z1[] = "asdf"; const char z2[] = "zxcv"; const volatile char z3[] = "zxcv"; // CHECK-NOT: @z1 -// CHECK: @z3 = constant +// CHECK: @z3 = {{(dso_local )?}}constant // CHECK: @_ZL2z2 = internal constant const char* b2() { return z2; } diff --git a/test/CodeGenCXX/const-init-cxx11.cpp b/test/CodeGenCXX/const-init-cxx11.cpp index c4962bc08ad69..801d7b1e19cc4 100644 --- a/test/CodeGenCXX/const-init-cxx11.cpp +++ b/test/CodeGenCXX/const-init-cxx11.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -w -triple x86_64-elf-gnu -emit-llvm -o - %s -std=c++11 | FileCheck %s +// RUN: %clang_cc1 -w -fmerge-all-constants -triple x86_64-elf-gnu -emit-llvm -o - %s -std=c++11 | FileCheck %s // FIXME: The padding in all these objects should be zero-initialized. namespace StructUnion { diff --git a/test/CodeGenCXX/constructor-alias.cpp b/test/CodeGenCXX/constructor-alias.cpp index 8359bb90a051d..ee2e57b711c96 100644 --- a/test/CodeGenCXX/constructor-alias.cpp +++ b/test/CodeGenCXX/constructor-alias.cpp @@ -9,4 +9,4 @@ struct B { B::B() { } -// CHECK: @_ZN1BC1Ev = alias void (%struct.B*), void (%struct.B*)* @_ZN1BC2Ev +// CHECK: @_ZN1BC1Ev = unnamed_addr alias void (%struct.B*), void (%struct.B*)* @_ZN1BC2Ev diff --git a/test/CodeGenCXX/constructor-destructor-return-this.cpp b/test/CodeGenCXX/constructor-destructor-return-this.cpp index 164fda3c1c38f..f6450e2d4d77d 100644 --- a/test/CodeGenCXX/constructor-destructor-return-this.cpp +++ b/test/CodeGenCXX/constructor-destructor-return-this.cpp @@ -45,8 +45,8 @@ B::~B() { } // CHECKIOS5-LABEL: define %class.B* @_ZN1BD2Ev(%class.B* %this) // CHECKIOS5-LABEL: define %class.B* @_ZN1BD1Ev(%class.B* %this) -// CHECKMS-LABEL: define x86_thiscallcc %class.B* @"\01??0B@@QAE@PAH@Z"(%class.B* returned %this, i32* %i) -// CHECKMS-LABEL: define x86_thiscallcc void @"\01??1B@@UAE@XZ"(%class.B* %this) +// CHECKMS-LABEL: define dso_local x86_thiscallcc %class.B* @"??0B@@QAE@PAH@Z"(%class.B* returned %this, i32* %i) +// CHECKMS-LABEL: define dso_local x86_thiscallcc void @"??1B@@UAE@XZ"(%class.B* %this) class C : public A, public B { public: @@ -83,8 +83,8 @@ C::~C() { } // CHECKIOS5-LABEL: define void @_ZN1CD0Ev(%class.C* %this) // CHECKIOS5-LABEL: define void @_ZThn8_N1CD0Ev(%class.C* %this) -// CHECKMS-LABEL: define x86_thiscallcc %class.C* @"\01??0C@@QAE@PAHPAD@Z"(%class.C* returned %this, i32* %i, i8* %c) -// CHECKMS-LABEL: define x86_thiscallcc void @"\01??1C@@UAE@XZ"(%class.C* %this) +// CHECKMS-LABEL: define dso_local x86_thiscallcc %class.C* @"??0C@@QAE@PAHPAD@Z"(%class.C* returned %this, i32* %i, i8* %c) +// CHECKMS-LABEL: define dso_local x86_thiscallcc void @"??1C@@UAE@XZ"(%class.C* %this) class D : public virtual A { public: @@ -110,8 +110,8 @@ D::~D() { } // CHECKIOS5-LABEL: define %class.D* @_ZN1DD2Ev(%class.D* %this, i8** %vtt) // CHECKIOS5-LABEL: define %class.D* @_ZN1DD1Ev(%class.D* %this) -// CHECKMS-LABEL: define x86_thiscallcc %class.D* @"\01??0D@@QAE@XZ"(%class.D* returned %this, i32 %is_most_derived) -// CHECKMS-LABEL: define x86_thiscallcc void @"\01??1D@@UAE@XZ"(%class.D* %this) +// CHECKMS-LABEL: define dso_local x86_thiscallcc %class.D* @"??0D@@QAE@XZ"(%class.D* returned %this, i32 %is_most_derived) +// CHECKMS-LABEL: define dso_local x86_thiscallcc void @"??1D@@UAE@XZ"(%class.D* %this) class E { public: diff --git a/test/CodeGenCXX/constructor-direct-call.cpp b/test/CodeGenCXX/constructor-direct-call.cpp index 9567d0968dae4..bcddc0fa7a496 100644 --- a/test/CodeGenCXX/constructor-direct-call.cpp +++ b/test/CodeGenCXX/constructor-direct-call.cpp @@ -9,7 +9,7 @@ void f1() { Test1 var; var.Test1::Test1(); - // CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %{{.*}}, i8* %{{.*}}, i32 4, i32 4, i1 false) + // CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %{{.*}}, i8* align 4 %{{.*}}, i32 4, i1 false) var.Test1::Test1(var); } @@ -28,7 +28,7 @@ void f2() { // CHECK-NEXT: call x86_thiscallcc void @_ZN5Test2C1Ev(%class.Test2* %var) var.Test2::Test2(); - // CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %{{.*}}, i8* %{{.*}}, i32 8, i32 4, i1 false) + // CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %{{.*}}, i8* align 4 %{{.*}}, i32 8, i1 false) var.Test2::Test2(var); } diff --git a/test/CodeGenCXX/constructors.cpp b/test/CodeGenCXX/constructors.cpp index a898140383407..9322c410f272b 100644 --- a/test/CodeGenCXX/constructors.cpp +++ b/test/CodeGenCXX/constructors.cpp @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 %s -emit-llvm -o - | FileCheck %s --implicit-check-not=should_not_appear_in_output +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 %s -emit-llvm -o - | FileCheck %s --implicit-check-not=should_not_appear_in_output --check-prefixes=CHECK,NULL-INVALID +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 %s -emit-llvm -fno-delete-null-pointer-checks -o - | FileCheck %s --implicit-check-not=should_not_appear_in_output --check-prefixes=CHECK,NULL-VALID struct Member { int x; Member(); Member(int); Member(const Member &); }; struct VBase { int x; VBase(); VBase(int); VBase(const VBase &); }; @@ -21,10 +22,12 @@ struct A { A::A(struct Undeclared &ref) : mem(0) {} // Check that delegation works. -// CHECK-LABEL: define void @_ZN1AC2ER10Undeclared(%struct.A* %this, %struct.Undeclared* nonnull %ref) unnamed_addr +// NULL-INVALID-LABEL: define void @_ZN1AC2ER10Undeclared(%struct.A* %this, %struct.Undeclared* nonnull %ref) unnamed_addr +// NULL-VALID-LABEL: define void @_ZN1AC2ER10Undeclared(%struct.A* %this, %struct.Undeclared* %ref) unnamed_addr // CHECK: call void @_ZN6MemberC1Ei( -// CHECK-LABEL: define void @_ZN1AC1ER10Undeclared(%struct.A* %this, %struct.Undeclared* nonnull %ref) unnamed_addr +// NULL-INVALID-LABEL: define void @_ZN1AC1ER10Undeclared(%struct.A* %this, %struct.Undeclared* nonnull %ref) unnamed_addr +// NULL-VALID-LABEL: define void @_ZN1AC1ER10Undeclared(%struct.A* %this, %struct.Undeclared* %ref) unnamed_addr // CHECK: call void @_ZN1AC2ER10Undeclared( A::A(ValueClass v) : mem(v.y - v.x) {} @@ -43,11 +46,13 @@ struct B : A { B::B(struct Undeclared &ref) : A(ref), mem(1) {} -// CHECK-LABEL: define void @_ZN1BC2ER10Undeclared(%struct.B* %this, %struct.Undeclared* nonnull %ref) unnamed_addr +// NULL-INVALID-LABEL: define void @_ZN1BC2ER10Undeclared(%struct.B* %this, %struct.Undeclared* nonnull %ref) unnamed_addr +// NULL-VALID-LABEL: define void @_ZN1BC2ER10Undeclared(%struct.B* %this, %struct.Undeclared* %ref) unnamed_addr // CHECK: call void @_ZN1AC2ER10Undeclared( // CHECK: call void @_ZN6MemberC1Ei( -// CHECK-LABEL: define void @_ZN1BC1ER10Undeclared(%struct.B* %this, %struct.Undeclared* nonnull %ref) unnamed_addr +// NULL-INVALID-LABEL: define void @_ZN1BC1ER10Undeclared(%struct.B* %this, %struct.Undeclared* nonnull %ref) unnamed_addr +// NULL-VALID-LABEL: define void @_ZN1BC1ER10Undeclared(%struct.B* %this, %struct.Undeclared* %ref) unnamed_addr // CHECK: call void @_ZN1BC2ER10Undeclared( diff --git a/test/CodeGenCXX/copy-constructor-elim.cpp b/test/CodeGenCXX/copy-constructor-elim.cpp index 4abe456e4b29d..7ba231071e76d 100644 --- a/test/CodeGenCXX/copy-constructor-elim.cpp +++ b/test/CodeGenCXX/copy-constructor-elim.cpp @@ -56,4 +56,4 @@ extern "C" V f() { return gv1; } // Make sure that we obey the destination's alignment requirements when emitting // the copy. // CHECK-LABEL: define {{.*}} @f( -// CHECK: call void @llvm.memcpy.p0i8.p0i8.{{i64|i32}}({{.*}}, i8* bitcast (%struct.V* @gv1 to i8*), {{i64|i32}} 4, i32 4, i1 false) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.{{i64|i32}}({{.*}}align 4{{.*}}, i8* align 8 bitcast (%struct.V* @gv1 to i8*), {{i64|i32}} 4, i1 false) diff --git a/test/CodeGenCXX/copy-constructor-synthesis-2.cpp b/test/CodeGenCXX/copy-constructor-synthesis-2.cpp index 9d7e18e80f673..7940101c0cfbd 100644 --- a/test/CodeGenCXX/copy-constructor-synthesis-2.cpp +++ b/test/CodeGenCXX/copy-constructor-synthesis-2.cpp @@ -10,15 +10,15 @@ extern PR23373 pr23373_a; PR23373 pr23373_b(pr23373_a); // CHECK-LABEL: define {{.*}} @__cxx_global_var_init( -// CHECK: call void @llvm.memcpy.p0i8.p0i8.{{i32|i64}}({{.*}} @pr23373_b{{.*}}, {{.*}} @pr23373_a{{.*}}, [[W:i32|i64]] 4, i32 4, i1 false) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.{{i32|i64}}({{.*}}align 4{{.*}}@pr23373_b{{.*}}, {{.*}}align 4{{.*}} @pr23373_a{{.*}}, [[W:i32|i64]] 4, i1 false) PR23373 pr23373_f() { return pr23373_a; } // CHECK-LABEL: define {{.*}} @_Z9pr23373_fv( -// CHECK: call void @llvm.memcpy.p0i8.p0i8.[[W]]({{.*}}, [[W]] 4, i32 4, i1 false) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.[[W]]({{.*}}align 4{{.*}}align 4{{.*}}, [[W]] 4, i1 false) void pr23373_g(PR23373 &a, PR23373 &b) { a = b; } // CHECK-LABEL: define {{.*}} @_Z9pr23373_g -// CHECK: call void @llvm.memcpy.p0i8.p0i8.[[W]]({{.*}}, [[W]] 4, i32 4, i1 false) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.[[W]]({{.*}}align 4{{.*}}align 4{{.*}}, [[W]] 4, i1 false) struct A { virtual void a(); }; A x(A& y) { return y; } diff --git a/test/CodeGenCXX/copy-constructor-synthesis.cpp b/test/CodeGenCXX/copy-constructor-synthesis.cpp index 5a2cc1440f742..4fdd8a35c4ded 100644 --- a/test/CodeGenCXX/copy-constructor-synthesis.cpp +++ b/test/CodeGenCXX/copy-constructor-synthesis.cpp @@ -143,7 +143,7 @@ void f(B b1) { // CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds [[A]], [[A]]* [[OTHER]], i32 0, i32 1 // CHECK-NEXT: [[T4:%.*]] = bitcast i16* [[T0]] to i8* // CHECK-NEXT: [[T5:%.*]] = bitcast i16* [[T2]] to i8* -// CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[T4]], i8* [[T5]], i64 8, i32 8, i1 false) +// CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[T4]], i8* align 8 [[T5]], i64 8, i1 false) // CHECK-NEXT: ret [[A]]* [[THIS]] // CHECK-LABEL: define linkonce_odr void @_ZN6PR66281BC2ERKS0_(%"struct.PR6628::B"* %this, %"struct.PR6628::B"* dereferenceable({{[0-9]+}})) unnamed_addr @@ -172,7 +172,7 @@ void f(B b1) { // CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds [[A]], [[A]]* [[OTHER]], i32 0, i32 1 // CHECK-NEXT: [[T4:%.*]] = bitcast i16* [[T0]] to i8* // CHECK-NEXT: [[T5:%.*]] = bitcast i16* [[T2]] to i8* -// CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[T4]], i8* [[T5]], i64 8, i32 8, i1 false) +// CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[T4]], i8* align 8 [[T5]], i64 8, i1 false) // CHECK-NEXT: ret void } diff --git a/test/CodeGenCXX/ctor-dtor-alias.cpp b/test/CodeGenCXX/ctor-dtor-alias.cpp index 6826ee5796caf..4715111a1439e 100644 --- a/test/CodeGenCXX/ctor-dtor-alias.cpp +++ b/test/CodeGenCXX/ctor-dtor-alias.cpp @@ -1,5 +1,7 @@ -// RUN: %clang_cc1 %s -triple i686-linux -emit-llvm -o - -mconstructor-aliases | FileCheck --check-prefix=NOOPT %s - +// RUN: %clang_cc1 %s -triple i686-linux -emit-llvm -o - -mconstructor-aliases > %t +// RUN: FileCheck --check-prefix=NOOPT1 --input-file=%t %s +// RUN: FileCheck --check-prefix=NOOPT2 --input-file=%t %s +// RUN: FileCheck --check-prefix=NOOPT3 --input-file=%t %s // RUN: %clang_cc1 %s -triple i686-linux -emit-llvm -o - -mconstructor-aliases -O1 -disable-llvm-passes > %t // RUN: FileCheck --check-prefix=CHECK1 --input-file=%t %s // RUN: FileCheck --check-prefix=CHECK2 --input-file=%t %s @@ -11,16 +13,23 @@ // RUN: %clang_cc1 %s -triple i686-pc-windows-gnu -emit-llvm -o - -mconstructor-aliases -O1 -disable-llvm-passes | FileCheck --check-prefix=COFF %s namespace test1 { -// Test that we produce the apropriate comdats when creating aliases to +// Test that we produce the appropriate comdats when creating aliases to // weak_odr constructors and destructors. -// CHECK1: @_ZN5test16foobarIvEC1Ev = weak_odr alias void {{.*}} @_ZN5test16foobarIvEC2Ev -// CHECK1: @_ZN5test16foobarIvED1Ev = weak_odr alias void (%"struct.test1::foobar"*), void (%"struct.test1::foobar"*)* @_ZN5test16foobarIvED2Ev +// CHECK1: @_ZN5test16foobarIvEC1Ev = weak_odr unnamed_addr alias void {{.*}} @_ZN5test16foobarIvEC2Ev +// CHECK1: @_ZN5test16foobarIvED1Ev = weak_odr unnamed_addr alias void (%"struct.test1::foobar"*), void (%"struct.test1::foobar"*)* @_ZN5test16foobarIvED2Ev // CHECK1: define weak_odr void @_ZN5test16foobarIvEC2Ev({{.*}} comdat($_ZN5test16foobarIvEC5Ev) // CHECK1: define weak_odr void @_ZN5test16foobarIvED2Ev({{.*}} comdat($_ZN5test16foobarIvED5Ev) // CHECK1: define weak_odr void @_ZN5test16foobarIvED0Ev({{.*}} comdat($_ZN5test16foobarIvED5Ev) // CHECK1-NOT: comdat +// This should happen regardless of the opt level. +// NOOPT1: @_ZN5test16foobarIvEC1Ev = weak_odr unnamed_addr alias void {{.*}} @_ZN5test16foobarIvEC2Ev +// NOOPT1: @_ZN5test16foobarIvED1Ev = weak_odr unnamed_addr alias void (%"struct.test1::foobar"*), void (%"struct.test1::foobar"*)* @_ZN5test16foobarIvED2Ev +// NOOPT1: define weak_odr void @_ZN5test16foobarIvEC2Ev({{.*}} comdat($_ZN5test16foobarIvEC5Ev) +// NOOPT1: define weak_odr void @_ZN5test16foobarIvED2Ev({{.*}} comdat($_ZN5test16foobarIvED5Ev) +// NOOPT1: define weak_odr void @_ZN5test16foobarIvED0Ev({{.*}} comdat($_ZN5test16foobarIvED5Ev) + // COFF doesn't support comdats with arbitrary names (C5/D5). // COFF: define weak_odr {{.*}} void @_ZN5test16foobarIvEC2Ev({{.*}} comdat align // COFF: define weak_odr {{.*}} void @_ZN5test16foobarIvEC1Ev({{.*}} comdat align @@ -37,12 +46,17 @@ template struct foobar<void>; } namespace test2 { -// test that when the destrucor is linkonce_odr we just replace every use of +// test that when the destructor is linkonce_odr we just replace every use of // C1 with C2. // CHECK1: define internal void @__cxx_global_var_init() // CHECK1: call void @_ZN5test26foobarIvEC2Ev // CHECK1: define linkonce_odr void @_ZN5test26foobarIvEC2Ev({{.*}} comdat align + +// At -O0, we should still emit the complete constructor. +// NOOPT1: define internal void @__cxx_global_var_init() +// NOOPT1: call void @_ZN5test26foobarIvEC1Ev +// NOOPT1: define linkonce_odr void @_ZN5test26foobarIvEC1Ev({{.*}} comdat align void g(); template <typename T> struct foobar { foobar() { g(); } @@ -57,6 +71,11 @@ namespace test3 { // CHECK1: define internal void @__cxx_global_var_init.1() // CHECK1: call i32 @__cxa_atexit{{.*}}_ZN5test312_GLOBAL__N_11AD2Ev // CHECK1: define internal void @_ZN5test312_GLOBAL__N_11AD2Ev( + +// We can use an alias for internal symbols at -O0. +// NOOPT2: _ZN5test312_GLOBAL__N_11BD1Ev = internal unnamed_addr alias void {{.*}} @_ZN5test312_GLOBAL__N_11BD2Ev +// NOOPT2: define internal void @__cxx_global_var_init.1() +// NOOPT2: call i32 @__cxa_atexit{{.*}}_ZN5test312_GLOBAL__N_11BD1Ev namespace { struct A { ~A() {} @@ -77,11 +96,12 @@ namespace test4 { // CHECK1: call i32 @__cxa_atexit{{.*}}_ZN5test41AD2Ev // CHECK1: define linkonce_odr void @_ZN5test41AD2Ev({{.*}} comdat align - // test that we don't do this optimization at -O0 so that the debugger can - // see both destructors. - // NOOPT: define internal void @__cxx_global_var_init.2() - // NOOPT: call i32 @__cxa_atexit{{.*}}@_ZN5test41BD2Ev - // NOOPT: define linkonce_odr void @_ZN5test41BD2Ev({{.*}} comdat align + // Test that we don't do this optimization at -O0 and call the complete + // destructor for B instead. This enables the debugger to see both + // destructors. + // NOOPT2: define internal void @__cxx_global_var_init.2() + // NOOPT2: call i32 @__cxa_atexit{{.*}}@_ZN5test41BD1Ev + // NOOPT2: define linkonce_odr void @_ZN5test41BD1Ev({{.*}} comdat align struct A { virtual ~A() {} }; @@ -129,6 +149,11 @@ namespace test7 { // out if we should). // pr17875. // CHECK3: define void @_ZN5test71BD2Ev + + // At -O0, we should emit both destructors, the complete can be an alias to + // the base one. + // NOOPT3: @_ZN5test71BD1Ev = unnamed_addr alias void {{.*}} @_ZN5test71BD2Ev + // NOOPT3: define void @_ZN5test71BD2Ev template <typename> struct A { ~A() {} }; @@ -141,7 +166,7 @@ namespace test7 { namespace test8 { // Test that we replace ~zed with ~bar which is an alias to ~foo. - // CHECK4: @_ZN5test83barD2Ev = alias {{.*}} @_ZN5test83fooD2Ev + // CHECK4: @_ZN5test83barD2Ev = unnamed_addr alias {{.*}} @_ZN5test83fooD2Ev // CHECK4: define internal void @__cxx_global_var_init.5() // CHECK4: call i32 @__cxa_atexit({{.*}}@_ZN5test83barD2Ev struct foo { @@ -232,8 +257,8 @@ struct foo : public bar { ~foo(); }; foo::~foo() {} -// CHECK6: @_ZN6test113fooD2Ev = alias {{.*}} @_ZN6test113barD2Ev -// CHECK6: @_ZN6test113fooD1Ev = alias {{.*}} @_ZN6test113fooD2Ev +// CHECK6: @_ZN6test113fooD2Ev = unnamed_addr alias {{.*}} @_ZN6test113barD2Ev +// CHECK6: @_ZN6test113fooD1Ev = unnamed_addr alias {{.*}} @_ZN6test113fooD2Ev } namespace test12 { @@ -243,6 +268,6 @@ struct foo { }; template class foo<1>; -// CHECK6: @_ZN6test123fooILi1EED1Ev = weak_odr alias {{.*}} @_ZN6test123fooILi1EED2Ev +// CHECK6: @_ZN6test123fooILi1EED1Ev = weak_odr unnamed_addr alias {{.*}} @_ZN6test123fooILi1EED2Ev // CHECK6: define weak_odr void @_ZN6test123fooILi1EED2Ev({{.*}}) {{.*}} comdat($_ZN6test123fooILi1EED5Ev) } diff --git a/test/CodeGenCXX/cxx0x-delegating-ctors.cpp b/test/CodeGenCXX/cxx0x-delegating-ctors.cpp index dcc055696e4dd..614983d4fc596 100644 --- a/test/CodeGenCXX/cxx0x-delegating-ctors.cpp +++ b/test/CodeGenCXX/cxx0x-delegating-ctors.cpp @@ -66,7 +66,7 @@ namespace PR12890 { X::X(int) : X() {} } // CHECK: define {{.*}} @_ZN7PR128901XC1Ei(%"class.PR12890::X"* %this, i32) -// CHECK: call void @llvm.memset.p0i8.{{i32|i64}}(i8* {{.*}}, i8 0, {{i32|i64}} 4, i32 4, i1 false) +// CHECK: call void @llvm.memset.p0i8.{{i32|i64}}(i8* align 4 {{.*}}, i8 0, {{i32|i64}} 4, i1 false) namespace PR14588 { void other(); diff --git a/test/CodeGenCXX/cxx0x-initializer-array.cpp b/test/CodeGenCXX/cxx0x-initializer-array.cpp index de10aee67f13e..4a7e452304cc1 100644 --- a/test/CodeGenCXX/cxx0x-initializer-array.cpp +++ b/test/CodeGenCXX/cxx0x-initializer-array.cpp @@ -39,7 +39,7 @@ namespace ValueInitArrayOfMemPtr { // CHECK: store i32 -1, Agg2 b = { n }; - // CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %{{.*}}, i8* bitcast ([3 x i32]* @[[THREE_NULL_MEMPTRS]] to i8*), i32 12, i32 4, i1 false) + // CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %{{.*}}, i8* align 4 bitcast ([3 x i32]* @[[THREE_NULL_MEMPTRS]] to i8*), i32 12, i1 false) } // Test dynamic initialization. diff --git a/test/CodeGenCXX/cxx0x-initializer-references.cpp b/test/CodeGenCXX/cxx0x-initializer-references.cpp index 318c8ea0d7703..595d27ca2e834 100644 --- a/test/CodeGenCXX/cxx0x-initializer-references.cpp +++ b/test/CodeGenCXX/cxx0x-initializer-references.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -S -triple armv7-none-eabi -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -std=c++11 -S -triple armv7-none-eabi -fmerge-all-constants -emit-llvm -o - %s | FileCheck %s namespace reference { struct A { diff --git a/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp b/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp index 67215ef48fb38..e3c7e26afa817 100644 --- a/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp +++ b/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -std=c++11 -triple x86_64-none-linux-gnu -emit-llvm -o - %s | FileCheck -check-prefixes=X86,CHECK %s -// RUN: %clang_cc1 -std=c++11 -triple amdgcn-amd-amdhsa-amdgiz -DNO_TLS -emit-llvm -o - %s | FileCheck -check-prefixes=AMD,CHECK %s +// RUN: %clang_cc1 -std=c++11 -triple x86_64-none-linux-gnu -fmerge-all-constants -emit-llvm -o - %s | FileCheck -check-prefixes=X86,CHECK %s +// RUN: %clang_cc1 -std=c++11 -triple amdgcn-amd-amdhsa -DNO_TLS -fmerge-all-constants -emit-llvm -o - %s | FileCheck -check-prefixes=AMDGCN,CHECK %s namespace std { typedef decltype(sizeof(int)) size_t; @@ -49,8 +49,8 @@ struct wantslist1 { }; // X86: @_ZGR15globalInitList1_ = internal constant [3 x i32] [i32 1, i32 2, i32 3] // X86: @globalInitList1 = global %{{[^ ]+}} { i32* getelementptr inbounds ([3 x i32], [3 x i32]* @_ZGR15globalInitList1_, i32 0, i32 0), i{{32|64}} 3 } -// AMD: @_ZGR15globalInitList1_ = internal addrspace(1) constant [3 x i32] [i32 1, i32 2, i32 3] -// AMD: @globalInitList1 = addrspace(1) global %{{[^ ]+}} { i32* addrspacecast (i32 addrspace(1)* getelementptr inbounds ([3 x i32], [3 x i32] addrspace(1)* @_ZGR15globalInitList1_, i32 0, i32 0) to i32*), i{{32|64}} 3 } +// AMDGCN: @_ZGR15globalInitList1_ = internal addrspace(1) constant [3 x i32] [i32 1, i32 2, i32 3] +// AMDGCN: @globalInitList1 = addrspace(1) global %{{[^ ]+}} { i32* addrspacecast (i32 addrspace(1)* getelementptr inbounds ([3 x i32], [3 x i32] addrspace(1)* @_ZGR15globalInitList1_, i32 0, i32 0) to i32*), i{{32|64}} 3 } std::initializer_list<int> globalInitList1 = {1, 2, 3}; #ifndef NO_TLS @@ -67,28 +67,28 @@ std::initializer_list<int> thread_local x = {1, 2, 3, 4}; // X86: @globalInitList2 = global %{{[^ ]+}} zeroinitializer // X86: @_ZGR15globalInitList2_ = internal global [2 x %[[WITHARG:[^ ]*]]] zeroinitializer -// AMD: @globalInitList2 = addrspace(1) global %{{[^ ]+}} zeroinitializer -// AMD: @_ZGR15globalInitList2_ = internal addrspace(1) global [2 x %[[WITHARG:[^ ]*]]] zeroinitializer +// AMDGCN: @globalInitList2 = addrspace(1) global %{{[^ ]+}} zeroinitializer +// AMDGCN: @_ZGR15globalInitList2_ = internal addrspace(1) global [2 x %[[WITHARG:[^ ]*]]] zeroinitializer // X86: @_ZN15partly_constant1kE = global i32 0, align 4 // X86: @_ZN15partly_constant2ilE = global {{.*}} null, align 8 -// X86: @[[PARTLY_CONSTANT_OUTER:_ZGRN15partly_constant2ilE.*]] = internal global {{.*}} zeroinitializer, align 8 -// X86: @[[PARTLY_CONSTANT_INNER:_ZGRN15partly_constant2ilE.*]] = internal global [3 x {{.*}}] zeroinitializer, align 8 -// X86: @[[PARTLY_CONSTANT_FIRST:_ZGRN15partly_constant2ilE.*]] = internal constant [3 x i32] [i32 1, i32 2, i32 3], align 4 -// X86: @[[PARTLY_CONSTANT_SECOND:_ZGRN15partly_constant2ilE.*]] = internal global [2 x i32] zeroinitializer, align 4 -// X86: @[[PARTLY_CONSTANT_THIRD:_ZGRN15partly_constant2ilE.*]] = internal constant [4 x i32] [i32 5, i32 6, i32 7, i32 8], align 4 -// AMD: @_ZN15partly_constant1kE = addrspace(1) global i32 0, align 4 -// AMD: @_ZN15partly_constant2ilE = addrspace(2) global {{.*}} null, align 8 -// AMD: @[[PARTLY_CONSTANT_OUTER:_ZGRN15partly_constant2ilE.*]] = internal addrspace(2) global {{.*}} zeroinitializer, align 8 -// AMD: @[[PARTLY_CONSTANT_INNER:_ZGRN15partly_constant2ilE.*]] = internal addrspace(2) global [3 x {{.*}}] zeroinitializer, align 8 -// AMD: @[[PARTLY_CONSTANT_FIRST:_ZGRN15partly_constant2ilE.*]] = internal addrspace(2) constant [3 x i32] [i32 1, i32 2, i32 3], align 4 -// AMD: @[[PARTLY_CONSTANT_SECOND:_ZGRN15partly_constant2ilE.*]] = internal addrspace(2) global [2 x i32] zeroinitializer, align 4 -// AMD: @[[PARTLY_CONSTANT_THIRD:_ZGRN15partly_constant2ilE.*]] = internal addrspace(2) constant [4 x i32] [i32 5, i32 6, i32 7, i32 8], align 4 +// X86: @[[PARTLY_CONSTANT_OUTER:_ZGRN15partly_constant2ilE_]] = internal global {{.*}} zeroinitializer, align 8 +// X86: @[[PARTLY_CONSTANT_INNER:_ZGRN15partly_constant2ilE0_]] = internal global [3 x {{.*}}] zeroinitializer, align 8 +// X86: @[[PARTLY_CONSTANT_FIRST:_ZGRN15partly_constant2ilE1_]] = internal constant [3 x i32] [i32 1, i32 2, i32 3], align 4 +// X86: @[[PARTLY_CONSTANT_SECOND:_ZGRN15partly_constant2ilE2_]] = internal global [2 x i32] zeroinitializer, align 4 +// X86: @[[PARTLY_CONSTANT_THIRD:_ZGRN15partly_constant2ilE3_]] = internal constant [4 x i32] [i32 5, i32 6, i32 7, i32 8], align 4 +// AMDGCN: @_ZN15partly_constant1kE = addrspace(1) global i32 0, align 4 +// AMDGCN: @_ZN15partly_constant2ilE = addrspace(4) global {{.*}} null, align 8 +// AMDGCN: @[[PARTLY_CONSTANT_OUTER:_ZGRN15partly_constant2ilE_]] = internal addrspace(4) global {{.*}} zeroinitializer, align 8 +// AMDGCN: @[[PARTLY_CONSTANT_INNER:_ZGRN15partly_constant2ilE0_]] = internal addrspace(4) global [3 x {{.*}}] zeroinitializer, align 8 +// AMDGCN: @[[PARTLY_CONSTANT_FIRST:_ZGRN15partly_constant2ilE1_]] = internal addrspace(4) constant [3 x i32] [i32 1, i32 2, i32 3], align 4 +// AMDGCN: @[[PARTLY_CONSTANT_SECOND:_ZGRN15partly_constant2ilE2_]] = internal addrspace(4) global [2 x i32] zeroinitializer, align 4 +// AMDGCN: @[[PARTLY_CONSTANT_THIRD:_ZGRN15partly_constant2ilE3_]] = internal addrspace(4) constant [4 x i32] [i32 5, i32 6, i32 7, i32 8], align 4 // X86: @[[REFTMP1:.*]] = private constant [2 x i32] [i32 42, i32 43], align 4 // X86: @[[REFTMP2:.*]] = private constant [3 x %{{.*}}] [%{{.*}} { i32 1 }, %{{.*}} { i32 2 }, %{{.*}} { i32 3 }], align 4 -// AMD: @[[REFTMP1:.*]] = private addrspace(2) constant [2 x i32] [i32 42, i32 43], align 4 -// AMD: @[[REFTMP2:.*]] = private addrspace(2) constant [3 x %{{.*}}] [%{{.*}} { i32 1 }, %{{.*}} { i32 2 }, %{{.*}} { i32 3 }], align 4 +// AMDGCN: @[[REFTMP1:.*]] = private addrspace(4) constant [2 x i32] [i32 42, i32 43], align 4 +// AMDGCN: @[[REFTMP2:.*]] = private addrspace(4) constant [3 x %{{.*}}] [%{{.*}} { i32 1 }, %{{.*}} { i32 2 }, %{{.*}} { i32 3 }], align 4 // CHECK: appending global @@ -101,15 +101,15 @@ std::initializer_list<int> thread_local x = {1, 2, 3, 4}; // CHECK-LABEL: define internal void @__cxx_global_var_init // X86: call void @_ZN8witharg1C1ERK10destroyme1(%[[WITHARG]]* getelementptr inbounds ([2 x %[[WITHARG]]], [2 x %[[WITHARG]]]* @_ZGR15globalInitList2_, i{{32|64}} 0, i{{32|64}} 0 // X86: call void @_ZN8witharg1C1ERK10destroyme1(%[[WITHARG]]* getelementptr inbounds ([2 x %[[WITHARG]]], [2 x %[[WITHARG]]]* @_ZGR15globalInitList2_, i{{32|64}} 0, i{{32|64}} 1 -// AMD: call void @_ZN8witharg1C1ERK10destroyme1(%[[WITHARG]]* getelementptr inbounds ([2 x %[[WITHARG]]], [2 x %[[WITHARG]]]* addrspacecast ({{[^@]+}} @_ZGR15globalInitList2_ {{[^)]+}}), i{{32|64}} 0, i{{32|64}} 0 -// AMD: call void @_ZN8witharg1C1ERK10destroyme1(%[[WITHARG]]* getelementptr inbounds ([2 x %[[WITHARG]]], [2 x %[[WITHARG]]]* addrspacecast ({{[^@]+}} @_ZGR15globalInitList2_ {{[^)]+}}), i{{32|64}} 0, i{{32|64}} 1 +// AMDGCN: call void @_ZN8witharg1C1ERK10destroyme1(%[[WITHARG]]* getelementptr inbounds ([2 x %[[WITHARG]]], [2 x %[[WITHARG]]]* addrspacecast ({{[^@]+}} @_ZGR15globalInitList2_ {{[^)]+}}), i{{32|64}} 0, i{{32|64}} 0 +// AMDGCN: call void @_ZN8witharg1C1ERK10destroyme1(%[[WITHARG]]* getelementptr inbounds ([2 x %[[WITHARG]]], [2 x %[[WITHARG]]]* addrspacecast ({{[^@]+}} @_ZGR15globalInitList2_ {{[^)]+}}), i{{32|64}} 0, i{{32|64}} 1 // CHECK: call i32 @__cxa_atexit // X86: store %[[WITHARG]]* getelementptr inbounds ([2 x %[[WITHARG]]], [2 x %[[WITHARG]]]* @_ZGR15globalInitList2_, i64 0, i64 0), // X86: %[[WITHARG]]** getelementptr inbounds (%{{.*}}, %{{.*}}* @globalInitList2, i32 0, i32 0), align 8 // X86: store i64 2, i64* getelementptr inbounds (%{{.*}}, %{{.*}}* @globalInitList2, i32 0, i32 1), align 8 -// AMD: store %[[WITHARG]]* getelementptr inbounds ([2 x %[[WITHARG]]], [2 x %[[WITHARG]]]* addrspacecast ({{[^@]+}} @_ZGR15globalInitList2_ {{[^)]+}}), i64 0, i64 0), -// AMD: %[[WITHARG]]** getelementptr inbounds (%{{.*}}, %{{.*}}* addrspacecast ({{[^@]+}} @globalInitList2 {{[^)]+}}), i32 0, i32 0), align 8 -// AMD: store i64 2, i64* getelementptr inbounds (%{{.*}}, %{{.*}}* addrspacecast ({{[^@]+}} @globalInitList2 {{[^)]+}}), i32 0, i32 1), align 8 +// AMDGCN: store %[[WITHARG]]* getelementptr inbounds ([2 x %[[WITHARG]]], [2 x %[[WITHARG]]]* addrspacecast ({{[^@]+}} @_ZGR15globalInitList2_ {{[^)]+}}), i64 0, i64 0), +// AMDGCN: %[[WITHARG]]** getelementptr inbounds (%{{.*}}, %{{.*}}* addrspacecast ({{[^@]+}} @globalInitList2 {{[^)]+}}), i32 0, i32 0), align 8 +// AMDGCN: store i64 2, i64* getelementptr inbounds (%{{.*}}, %{{.*}}* addrspacecast ({{[^@]+}} @globalInitList2 {{[^)]+}}), i32 0, i32 1), align 8 // CHECK: call void @_ZN10destroyme1D1Ev // CHECK-NEXT: call void @_ZN10destroyme1D1Ev // CHECK-NEXT: ret void @@ -121,8 +121,8 @@ void fn1(int i) { // CHECK-LABEL: define void @_Z3fn1i // temporary array // X86: [[array:%[^ ]+]] = alloca [3 x i32] - // AMD: [[alloca:%[^ ]+]] = alloca [3 x i32], align 4, addrspace(5) - // AMD: [[array:%[^ ]+]] = addrspacecast [3 x i32] addrspace(5)* [[alloca]] to [3 x i32]* + // AMDGCN: [[alloca:%[^ ]+]] = alloca [3 x i32], align 4, addrspace(5) + // AMDGCN: [[array:%[^ ]+]] = addrspacecast [3 x i32] addrspace(5)* [[alloca]] to [3 x i32]* // CHECK: getelementptr inbounds [3 x i32], [3 x i32]* [[array]], i{{32|64}} 0 // CHECK-NEXT: store i32 1, i32* // CHECK-NEXT: getelementptr @@ -236,36 +236,6 @@ void fn9() { // CHECK: ret void } -struct haslist1 { - std::initializer_list<int> il; - haslist1(int i); -}; - -// CHECK-LABEL: define void @_ZN8haslist1C2Ei -haslist1::haslist1(int i) -// CHECK: alloca [3 x i32] -// CHECK: store i32 % -// CHECK: store i32 2 -// CHECK: store i32 3 - : il{i, 2, 3} -{ - destroyme2 dm2; -} - -struct haslist2 { - std::initializer_list<destroyme1> il; - haslist2(); -}; - -// CHECK-LABEL: define void @_ZN8haslist2C2Ev -haslist2::haslist2() - : il{destroyme1(), destroyme1()} -{ - destroyme2 dm2; - // CHECK: call void @_ZN10destroyme2D1Ev - // CHECK: call void @_ZN10destroyme1D1Ev -} - void fn10(int i) { // CHECK-LABEL: define void @_Z4fn10i // CHECK: alloca [3 x i32] @@ -405,7 +375,7 @@ namespace partly_constant { // CHECK-NOT: @[[PARTLY_CONSTANT_THIRD]], // CHECK: store i32* getelementptr inbounds ({{.*}}, {{.*}}* {{.*}}@[[PARTLY_CONSTANT_THIRD]]{{.*}}, i64 0, i64 0), // CHECK: i32** getelementptr inbounds ({{.*}}, {{.*}}* {{.*}}@[[PARTLY_CONSTANT_INNER]]{{.*}}, i64 0, i64 2, i32 0) - // CHECK: store i64 4, i64* getelementptr inbounds ({{.*}}, {{.*}}* {{.*}}@_ZGRN15partly_constant2ilE4_{{.*}}, i64 0, i64 2, i32 1) + // CHECK: store i64 4, i64* getelementptr inbounds ({{.*}}, {{.*}}* {{.*}}@[[PARTLY_CONSTANT_INNER]]{{.*}}, i64 0, i64 2, i32 1) // CHECK-NOT: @[[PARTLY_CONSTANT_THIRD]], // // Outer init list. @@ -518,12 +488,12 @@ namespace B19773010 { // CHECK-LABEL: @_ZN9B197730102f1Ev testcase a{{"", ENUM_CONSTANT}}; // X86: store %"struct.B19773010::pair"* getelementptr inbounds ([1 x %"struct.B19773010::pair"], [1 x %"struct.B19773010::pair"]* bitcast ([1 x { i8*, i32 }]* @.ref.tmp{{.*}} to [1 x %"struct.B19773010::pair"]*), i64 0, i64 0), %"struct.B19773010::pair"** %{{.*}}, align 8 - // AMD: store %"struct.B19773010::pair"* getelementptr inbounds ([1 x %"struct.B19773010::pair"], [1 x %"struct.B19773010::pair"]* addrspacecast{{.*}} bitcast ([1 x { i8*, i32 }] addrspace(2)* @.ref.tmp{{.*}} to [1 x %"struct.B19773010::pair"] addrspace(2)*){{.*}}, i64 0, i64 0), %"struct.B19773010::pair"** %{{.*}}, align 8 + // AMDGCN: store %"struct.B19773010::pair"* getelementptr inbounds ([1 x %"struct.B19773010::pair"], [1 x %"struct.B19773010::pair"]* addrspacecast{{.*}} bitcast ([1 x { i8*, i32 }] addrspace(4)* @.ref.tmp{{.*}} to [1 x %"struct.B19773010::pair"] addrspace(4)*){{.*}}, i64 0, i64 0), %"struct.B19773010::pair"** %{{.*}}, align 8 } void f2() { // CHECK-LABEL: @_ZN9B197730102f2Ev // X86: store %"struct.B19773010::pair"* getelementptr inbounds ([1 x %"struct.B19773010::pair"], [1 x %"struct.B19773010::pair"]* bitcast ([1 x { i8*, i32 }]* @_ZGRZN9B197730102f2EvE1p_ to [1 x %"struct.B19773010::pair"]*), i64 0, i64 0), %"struct.B19773010::pair"** getelementptr inbounds ([2 x %"class.std::initializer_list.10"], [2 x %"class.std::initializer_list.10"]* @_ZZN9B197730102f2EvE1p, i64 0, i64 1, i32 0), align 16 - // AMD: store %"struct.B19773010::pair"* getelementptr inbounds ([1 x %"struct.B19773010::pair"], [1 x %"struct.B19773010::pair"]* addrspacecast{{.*}} bitcast ([1 x { i8*, i32 }] addrspace(1)* @_ZGRZN9B197730102f2EvE1p_ to [1 x %"struct.B19773010::pair"] addrspace(1)*){{.*}}, i64 0, i64 0), %"struct.B19773010::pair"** getelementptr inbounds ([2 x %"class.std::initializer_list.10"], [2 x %"class.std::initializer_list.10"]* addrspacecast{{.*}}@_ZZN9B197730102f2EvE1p{{.*}}, i64 0, i64 1, i32 0), align 8 + // AMDGCN: store %"struct.B19773010::pair"* getelementptr inbounds ([1 x %"struct.B19773010::pair"], [1 x %"struct.B19773010::pair"]* addrspacecast{{.*}} bitcast ([1 x { i8*, i32 }] addrspace(1)* @_ZGRZN9B197730102f2EvE1p_ to [1 x %"struct.B19773010::pair"] addrspace(1)*){{.*}}, i64 0, i64 0), %"struct.B19773010::pair"** getelementptr inbounds ([2 x %"class.std::initializer_list.10"], [2 x %"class.std::initializer_list.10"]* addrspacecast{{.*}}@_ZZN9B197730102f2EvE1p{{.*}}, i64 0, i64 1, i32 0), align 8 static std::initializer_list<pair<const char *, E>> a, p[2] = {a, {{"", ENUM_CONSTANT}}}; } diff --git a/test/CodeGenCXX/cxx11-initializer-aggregate.cpp b/test/CodeGenCXX/cxx11-initializer-aggregate.cpp index 8bf35966f5b99..325607f69fb5d 100644 --- a/test/CodeGenCXX/cxx11-initializer-aggregate.cpp +++ b/test/CodeGenCXX/cxx11-initializer-aggregate.cpp @@ -11,6 +11,42 @@ namespace NonAggregateCopyInAggregateInit { // PR32044 struct C { A &&p; } c{{1}}; } +namespace NearlyZeroInit { + // CHECK-DAG: @_ZN14NearlyZeroInit1aE = global {{.*}} <{ i32 1, i32 2, i32 3, [120 x i32] zeroinitializer }> + int a[123] = {1, 2, 3}; + // CHECK-DAG: @_ZN14NearlyZeroInit1bE = global {{.*}} { i32 1, <{ i32, [2147483647 x i32] }> <{ i32 2, [2147483647 x i32] zeroinitializer }> } + struct B { int n; int arr[1024 * 1024 * 1024 * 2u]; } b = {1, {2}}; +} + +namespace PR37560 { + union U { + char x; + int a; + }; + // FIXME: [dcl.init]p2, the padding bits of the union object should be + // initialized to 0, not undef, which would allow us to collapse the tail + // of these arrays to zeroinitializer. + // CHECK-DAG: @_ZN7PR375601cE = global <{ { i8, [3 x i8] } }> <{ { i8, [3 x i8] } { i8 0, [3 x i8] undef } }> + U c[1] = {}; + // CHECK-DAG: @_ZN7PR375601dE = global {{.*}} <{ { i8, [3 x i8] } { i8 97, [3 x i8] undef }, %"{{[^"]*}}" { i32 123 }, { i8, [3 x i8] } { i8 98, [3 x i8] undef }, { i8, [3 x i8] } { i8 0, [3 x i8] undef }, + U d[16] = {'a', {.a = 123}, 'b'}; + // CHECK-DAG: @_ZN7PR375601eE = global {{.*}} <{ %"{{[^"]*}}" { i32 123 }, %"{{[^"]*}}" { i32 456 }, { i8, [3 x i8] } { i8 0, [3 x i8] undef }, + U e[16] = {{.a = 123}, {.a = 456}}; + + union V { + int a; + char x; + }; + // CHECK-DAG: @_ZN7PR375601fE = global [1 x %"{{[^"]*}}"] zeroinitializer + V f[1] = {}; + // CHECK-DAG: @_ZN7PR375601gE = global {{.*}} <{ { i8, [3 x i8] } { i8 97, [3 x i8] undef }, %"{{[^"]*}}" { i32 123 }, { i8, [3 x i8] } { i8 98, [3 x i8] undef }, [13 x %"{{[^"]*}}"] zeroinitializer }> + V g[16] = {{.x = 'a'}, {.a = 123}, {.x = 'b'}}; + // CHECK-DAG: @_ZN7PR375601hE = global {{.*}} <{ %"{{[^"]*}}" { i32 123 }, %"{{[^"]*}}" { i32 456 }, [14 x %"{{[^"]*}}"] zeroinitializer }> + V h[16] = {{.a = 123}, {.a = 456}}; + // CHECK-DAG: @_ZN7PR375601iE = global [4 x %"{{[^"]*}}"] [%"{{[^"]*}}" { i32 123 }, %"{{[^"]*}}" { i32 456 }, %"{{[^"]*}}" zeroinitializer, %"{{[^"]*}}" zeroinitializer] + V i[4] = {{.a = 123}, {.a = 456}}; +} + // CHECK-LABEL: define {{.*}}@_Z3fn1i( int fn1(int x) { // CHECK: %[[INITLIST:.*]] = alloca %struct.A @@ -51,3 +87,35 @@ namespace NonTrivialInit { // meaningful. B b[30] = {}; } + +namespace ZeroInit { + enum { Zero, One }; + constexpr int zero() { return 0; } + constexpr int *null() { return nullptr; } + struct Filler { + int x; + Filler(); + }; + struct S1 { + int x; + }; + + // These declarations, if implemented elementwise, require huge + // amout of memory and compiler time. + unsigned char data_1[1024 * 1024 * 1024 * 2u] = { 0 }; + unsigned char data_2[1024 * 1024 * 1024 * 2u] = { Zero }; + unsigned char data_3[1024][1024][1024] = {{{0}}}; + unsigned char data_4[1024 * 1024 * 1024 * 2u] = { zero() }; + int *data_5[1024 * 1024 * 512] = { nullptr }; + int *data_6[1024 * 1024 * 512] = { null() }; + struct S1 data_7[1024 * 1024 * 512] = {{0}}; + char data_8[1000 * 1000 * 1000] = {}; + int (&&data_9)[1000 * 1000 * 1000] = {0}; + unsigned char data_10[1024 * 1024 * 1024 * 2u] = { 1 }; + unsigned char data_11[1024 * 1024 * 1024 * 2u] = { One }; + unsigned char data_12[1024][1024][1024] = {{{1}}}; + + // This variable must be initialized elementwise. + Filler data_e1[1024] = {}; + // CHECK: getelementptr inbounds {{.*}} @_ZN8ZeroInit7data_e1E +} diff --git a/test/CodeGenCXX/cxx11-initializer-array-new.cpp b/test/CodeGenCXX/cxx11-initializer-array-new.cpp index 59f96031fc40a..6e242124fea00 100644 --- a/test/CodeGenCXX/cxx11-initializer-array-new.cpp +++ b/test/CodeGenCXX/cxx11-initializer-array-new.cpp @@ -154,7 +154,7 @@ void *r = new T[n][3]{ { 1, 2, 3 }, { 4, 5, 6 } }; // // CHECK: %[[SIZE:.*]] = sub i64 %{{.*}}, 24 // CHECK: %[[REST:.*]] = bitcast %[[T]]* %[[T_2_AS_T]] to i8* -// CHECK: call void @llvm.memset.p0i8.i64(i8* %[[REST]], i8 0, i64 %[[SIZE]], i32 4, i1 false) +// CHECK: call void @llvm.memset.p0i8.i64(i8* align 4 %[[REST]], i8 0, i64 %[[SIZE]], i1 false) // // CHECK: } diff --git a/test/CodeGenCXX/cxx11-thread-local.cpp b/test/CodeGenCXX/cxx11-thread-local.cpp index 3231a76ba9208..70f5a47fd3b8c 100644 --- a/test/CodeGenCXX/cxx11-thread-local.cpp +++ b/test/CodeGenCXX/cxx11-thread-local.cpp @@ -166,7 +166,8 @@ int f() { // DARWIN: call cxx_fast_tlscc void @_ZTHN1XIiE1mE() // CHECK: ret {{.*}}* @_ZN1XIiE1mE -// CHECK: define internal {{.*}} @[[VF_M_INIT]]() +// LINUX: define internal void @[[VF_M_INIT]]() +// DARWIN: define internal cxx_fast_tlscc void @[[VF_M_INIT]]() // LINUX-SAME: comdat($_ZN1VIfE1mE) // DARWIN-NOT: comdat // CHECK: load i8, i8* bitcast (i64* @_ZGVN1VIfE1mE to i8*) @@ -178,7 +179,8 @@ int f() { // CHECK: store i64 1, i64* @_ZGVN1VIfE1mE // CHECK: br label -// CHECK: define internal {{.*}} @[[XF_M_INIT]]() +// LINUX: define internal void @[[XF_M_INIT]]() +// DARWIN: define internal cxx_fast_tlscc void @[[XF_M_INIT]]() // LINUX-SAME: comdat($_ZN1XIfE1mE) // DARWIN-NOT: comdat // CHECK: load i8, i8* bitcast (i64* @_ZGVN1XIfE1mE to i8*) @@ -268,7 +270,8 @@ void set_anon_i() { // LINUX-LABEL: define internal i32* @_ZTWN12_GLOBAL__N_16anon_iE() // DARWIN-LABEL: define internal cxx_fast_tlscc i32* @_ZTWN12_GLOBAL__N_16anon_iE() -// CHECK: define internal {{.*}} @[[V_M_INIT]]() +// LINUX: define internal void @[[V_M_INIT]]() +// DARWIN: define internal cxx_fast_tlscc void @[[V_M_INIT]]() // LINUX-SAME: comdat($_ZN1VIiE1mE) // DARWIN-NOT: comdat // CHECK: load i8, i8* bitcast (i64* @_ZGVN1VIiE1mE to i8*) @@ -280,7 +283,8 @@ void set_anon_i() { // CHECK: store i64 1, i64* @_ZGVN1VIiE1mE // CHECK: br label -// CHECK: define internal {{.*}} @[[X_M_INIT]]() +// LINUX: define internal void @[[X_M_INIT]]() +// DARWIN: define internal cxx_fast_tlscc void @[[X_M_INIT]]() // LINUX-SAME: comdat($_ZN1XIiE1mE) // DARWIN-NOT: comdat // CHECK: load i8, i8* bitcast (i64* @_ZGVN1XIiE1mE to i8*) diff --git a/test/CodeGenCXX/cxx1z-aligned-allocation.cpp b/test/CodeGenCXX/cxx1z-aligned-allocation.cpp index 4c579978cb96b..2e2bfc5b941ba 100644 --- a/test/CodeGenCXX/cxx1z-aligned-allocation.cpp +++ b/test/CodeGenCXX/cxx1z-aligned-allocation.cpp @@ -29,10 +29,10 @@ struct OVERALIGNED A { A(); int n[128]; }; // CHECK-LABEL: define {{.*}} @_Z2a0v() // CHECK: %[[ALLOC:.*]] = call i8* @_ZnwmSt11align_val_t(i64 512, i64 32) // CHECK: call void @_ZdlPvSt11align_val_t(i8* %[[ALLOC]], i64 32) -// CHECK-MS-LABEL: define {{.*}} @"\01?a0@@YAPEAXXZ"() -// CHECK-MS: %[[ALLOC:.*]] = call i8* @"\01??2@YAPEAX_KW4align_val_t@std@@@Z"(i64 512, i64 32) +// CHECK-MS-LABEL: define {{.*}} @"?a0@@YAPEAXXZ"() +// CHECK-MS: %[[ALLOC:.*]] = call i8* @"??2@YAPEAX_KW4align_val_t@std@@@Z"(i64 512, i64 32) // CHECK-MS: cleanuppad -// CHECK-MS: call void @"\01??3@YAXPEAXW4align_val_t@std@@@Z"(i8* %[[ALLOC]], i64 32) +// CHECK-MS: call void @"??3@YAXPEAXW4align_val_t@std@@@Z"(i8* %[[ALLOC]], i64 32) void *a0() { return new A; } // FIXME: Why don't we call the sized array deallocation overload in this case? @@ -44,13 +44,13 @@ void *a0() { return new A; } // CHECK-NOT: store // CHECK: invoke void @_ZN1AC1Ev( // CHECK: call void @_ZdaPvSt11align_val_t(i8* %[[ALLOC]], i64 32) -// CHECK-MS-LABEL: define {{.*}} @"\01?a1@@YAPEAXJ@Z"( -// CHECK-MS: %[[ALLOC:.*]] = call i8* @"\01??_U@YAPEAX_KW4align_val_t@std@@@Z"(i64 %{{.*}}, i64 32) +// CHECK-MS-LABEL: define {{.*}} @"?a1@@YAPEAXJ@Z"( +// CHECK-MS: %[[ALLOC:.*]] = call i8* @"??_U@YAPEAX_KW4align_val_t@std@@@Z"(i64 %{{.*}}, i64 32) // No array cookie. // CHECK-MS-NOT: store -// CHECK-MS: invoke %struct.A* @"\01??0A@@QEAA@XZ"( +// CHECK-MS: invoke %struct.A* @"??0A@@QEAA@XZ"( // CHECK-MS: cleanuppad -// CHECK-MS: call void @"\01??_V@YAXPEAXW4align_val_t@std@@@Z"(i8* %[[ALLOC]], i64 32) +// CHECK-MS: call void @"??_V@YAXPEAXW4align_val_t@std@@@Z"(i8* %[[ALLOC]], i64 32) void *a1(long n) { return new A[n]; } // CHECK-LABEL: define {{.*}} @_Z2a2P1A( diff --git a/test/CodeGenCXX/cxx1z-eval-order.cpp b/test/CodeGenCXX/cxx1z-eval-order.cpp index 1106719a4748f..04c1b50f497e8 100644 --- a/test/CodeGenCXX/cxx1z-eval-order.cpp +++ b/test/CodeGenCXX/cxx1z-eval-order.cpp @@ -56,13 +56,13 @@ void (*get_f())(A); void postfix_before_args() { // CHECK: call {{.*}}@{{.*}}get_f{{.*}}( // CHECK-ITANIUM: call {{.*}}@_ZN1AC1Ev( - // CHECK-WINDOWS: call {{.*}}@"\01??0A@@Q{{AE|EAA}}@XZ"( + // CHECK-WINDOWS: call {{.*}}@"??0A@@Q{{AE|EAA}}@XZ"( // CHECK: call {{.*}}%{{.*}}( get_f()(A{}); // CHECK: call {{.*}}@{{.*}}side_effect{{.*}}( // CHECK-ITANIUM: call {{.*}}@_ZN1AC1Ev( - // CHECK-WINDOWS: call {{.*}}@"\01??0A@@Q{{AE|EAA}}@XZ"( + // CHECK-WINDOWS: call {{.*}}@"??0A@@Q{{AE|EAA}}@XZ"( // CHECK: call {{.*}}@{{.*}}callee{{.*}}( (side_effect(), callee)(A{}); // CHECK: } @@ -126,7 +126,7 @@ void *operator new(decltype(sizeof(0)), C); void alloc_before_init() { struct Q { Q(A) {} }; // CHECK-ITANIUM: call {{.*}}@_Znw{{.*}}( - // CHECK-WINDOWS: call {{.*}}@"\01??2@YAP{{EAX_K|AXI}}@Z"( + // CHECK-WINDOWS: call {{.*}}@"??2@YAP{{EAX_K|AXI}}@Z"( // CHECK: call {{.*}}@{{.*}}make_a{{.*}}( delete new Q(make_a()); diff --git a/test/CodeGenCXX/cxx1z-initializer-aggregate.cpp b/test/CodeGenCXX/cxx1z-initializer-aggregate.cpp index 9110e49f93a1a..f59ec51136fef 100644 --- a/test/CodeGenCXX/cxx1z-initializer-aggregate.cpp +++ b/test/CodeGenCXX/cxx1z-initializer-aggregate.cpp @@ -112,3 +112,21 @@ namespace Dynamic { // A_CLEANUP: // CHECK: call void @_ZN7Dynamic1AD1Ev({{.*}} @_ZN7Dynamic2d3E } + +namespace Instantiated1 { + struct A { A(); }; + struct B : A { using A::A; }; + template<int> B v({}); + template B v<0>; + // CHECK-LABEL: define {{.*}}global_var_init{{.*}} comdat($_ZN13Instantiated11vILi0EEE) { + // CHECK: call void @_ZN13Instantiated11BC1Ev(%{{.*}}* @_ZN13Instantiated11vILi0EEE) +} + +namespace Instantiated2 { + struct A { A(); }; + struct B : A {}; + template<int> B v({}); + template B v<0>; + // CHECK-LABEL: define {{.*}}global_var_init{{.*}} comdat($_ZN13Instantiated21vILi0EEE) { + // CHECK: call void @_ZN13Instantiated21AC2Ev( +} diff --git a/test/CodeGenCXX/cxx1z-inline-variables.cpp b/test/CodeGenCXX/cxx1z-inline-variables.cpp index 2d16acd8a8c23..938ebbbeb3abe 100644 --- a/test/CodeGenCXX/cxx1z-inline-variables.cpp +++ b/test/CodeGenCXX/cxx1z-inline-variables.cpp @@ -58,14 +58,22 @@ template<typename T> struct X { static int a; static inline int b; static int c; + static const int d; + static int e; }; // CHECK: @_ZN1XIiE1aE = linkonce_odr global i32 10 // CHECK: @_ZN1XIiE1bE = global i32 20 // CHECK-NOT: @_ZN1XIiE1cE +// CHECK: @_ZN1XIiE1dE = linkonce_odr constant i32 40 +// CHECK: @_ZN1XIiE1eE = linkonce_odr global i32 50 template<> inline int X<int>::a = 10; int &use3 = X<int>::a; template<> int X<int>::b = 20; template<> inline int X<int>::c = 30; +template<typename T> constexpr int X<T>::d = 40; +template<typename T> inline int X<T>::e = 50; +const int *use_x_int_d = &X<int>::d; +const int *use_x_int_e = &X<int>::e; template<typename T> struct Y; template<> struct Y<int> { @@ -103,3 +111,29 @@ int e = d<int>; // CHECK-NOT: __cxa_guard_acquire(i64* @_ZGV1b) // CHECK: call i32 @_Z1fv // CHECK-NOT: __cxa_guard_release(i64* @_ZGV1b) + +namespace PR35599 { +struct Marker1 {}; +struct Marker2 {}; + +template <typename> +struct Foo { + struct Bar { Bar(); }; + inline static Bar bar; +}; + +void run() { + // All we want here are ODR uses. Anything that requires that the type is + // complete is uninteresting. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-value" + Foo<Marker1>::bar; +#pragma clang diagnostic pop + static_cast<void>(Foo<Marker2>::bar); +} + +// CHECK-LABEL: define {{.*}}global_var_init{{.*}}comdat +// CHECK: call void @_ZN7PR355993FooINS_7Marker1EE3BarC1Ev +// CHECK-LABEL: define {{.*}}global_var_init{{.*}}comdat +// CHECK: call void @_ZN7PR355993FooINS_7Marker2EE3BarC1Ev +} diff --git a/test/CodeGenCXX/cxx1z-lambda-star-this.cpp b/test/CodeGenCXX/cxx1z-lambda-star-this.cpp index a7e4aadbd573f..114791c6558b3 100644 --- a/test/CodeGenCXX/cxx1z-lambda-star-this.cpp +++ b/test/CodeGenCXX/cxx1z-lambda-star-this.cpp @@ -10,13 +10,13 @@ namespace ns1 { int X = A{}.foo()(); } //end ns1 -//CHECK: @"\01?foo@A@@QAE?A?<auto>@@XZ"(%struct.A* %this, %class.anon* noalias sret %[[A_LAMBDA_RETVAL:.*]]) +//CHECK: @"?foo@A@@QAE?A?<auto>@@XZ"(%struct.A* %this, %class.anon* noalias sret %[[A_LAMBDA_RETVAL:.*]]) // get the first object with the closure type, which is of type 'struct.A' //CHECK: %[[I0:.+]] = getelementptr inbounds %[[A_LAMBDA]], %[[A_LAMBDA]]* %[[A_LAMBDA_RETVAL]], i32 0, i32 0 //CHECK: %[[I1:.+]] = bitcast %struct.A* %[[I0]] to i8* //CHECK: %[[I2:.+]] = bitcast %struct.A* %this1 to i8* // copy the contents ... -//CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[I1]], i8* %[[I2]], i32 8, i32 8, i1 false) +//CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %[[I1]], i8* align 8 %[[I2]], i32 8, i1 false) struct B { double b = 222; @@ -26,6 +26,6 @@ struct B { namespace ns2 { int X = B{}.bar()(); } -//CHECK: @"\01?bar@B@@QAE?A?<auto>@@XZ"(%struct.B* %this, %class.anon.0* noalias sret %agg.result) +//CHECK: @"?bar@B@@QAE?A?<auto>@@XZ"(%struct.B* %this, %class.anon.0* noalias sret %agg.result) //CHECK: %[[I20:.+]] = getelementptr inbounds %class.anon.0, %class.anon.0* %agg.result, i32 0, i32 0 //CHECK: store %struct.B* %this1, %struct.B** %[[I20]], align 4 diff --git a/test/CodeGenCXX/cxx2a-compare.cpp b/test/CodeGenCXX/cxx2a-compare.cpp new file mode 100644 index 0000000000000..ef6bb5556e225 --- /dev/null +++ b/test/CodeGenCXX/cxx2a-compare.cpp @@ -0,0 +1,188 @@ +// RUN: %clang_cc1 -std=c++2a -emit-llvm %s -o - -triple %itanium_abi_triple | \ +// RUN: FileCheck %s \ +// RUN: '-DWE="class.std::__1::weak_equality"' \ +// RUN: '-DSO="class.std::__1::strong_ordering"' \ +// RUN: '-DSE="class.std::__1::strong_equality"' \ +// RUN: '-DPO="class.std::__1::partial_ordering"' \ +// RUN: -DEQ=0 -DLT=-1 -DGT=1 -DUNORD=-127 -DNE=1 + +#include "Inputs/std-compare.h" + +// Ensure we don't emit definitions for the global variables +// since the builtins shouldn't ODR use them. +// CHECK-NOT: constant %[[SO]] +// CHECK-NOT: constant %[[SE]] +// CHECK-NOT: constant %[[WE]] +// CHECK-NOT: constant %[[PO]] + +// CHECK-LABEL: @_Z11test_signedii +auto test_signed(int x, int y) { + // CHECK: %[[DEST:retval|agg.result]] + // CHECK: %cmp.lt = icmp slt i32 %0, %1 + // CHECK: %sel.lt = select i1 %cmp.lt, i8 [[LT]], i8 [[GT]] + // CHECK: %cmp.eq = icmp eq i32 %0, %1 + // CHECK: %sel.eq = select i1 %cmp.eq, i8 [[EQ]], i8 %sel.lt + // CHECK: %__value_ = getelementptr inbounds %[[SO]], %[[SO]]* %[[DEST]] + // CHECK: store i8 %sel.eq, i8* %__value_, align 1 + // CHECK: ret + return x <=> y; +} + +// CHECK-LABEL: @_Z13test_unsignedjj +auto test_unsigned(unsigned x, unsigned y) { + // CHECK: %[[DEST:retval|agg.result]] + // CHECK: %cmp.lt = icmp ult i32 %0, %1 + // CHECK: %sel.lt = select i1 %cmp.lt, i8 [[LT]], i8 [[GT]] + // CHECK: %cmp.eq = icmp eq i32 %0, %1 + // CHECK: %sel.eq = select i1 %cmp.eq, i8 [[EQ]], i8 %sel.lt + // CHECK: %__value_ = getelementptr inbounds %[[SO]], %[[SO]]* %[[DEST]] + // CHECK: store i8 %sel.eq, i8* %__value_ + // CHECK: ret + return x <=> y; +} + +// CHECK-LABEL: @_Z10float_testdd +auto float_test(double x, double y) { + // CHECK: %[[DEST:retval|agg.result]] + // CHECK: %cmp.eq = fcmp oeq double %0, %1 + // CHECK: %sel.eq = select i1 %cmp.eq, i8 [[EQ]], i8 [[UNORD]] + // CHECK: %cmp.gt = fcmp ogt double %0, %1 + // CHECK: %sel.gt = select i1 %cmp.gt, i8 [[GT]], i8 %sel.eq + // CHECK: %cmp.lt = fcmp olt double %0, %1 + // CHECK: %sel.lt = select i1 %cmp.lt, i8 [[LT]], i8 %sel.gt + // CHECK: %__value_ = getelementptr inbounds %[[PO]], %[[PO]]* %[[DEST]] + // CHECK: store i8 %sel.lt, i8* %__value_ + // CHECK: ret + return x <=> y; +} + +// CHECK-LABEL: @_Z8ptr_testPiS_ +auto ptr_test(int *x, int *y) { + // CHECK: %[[DEST:retval|agg.result]] + // CHECK: %cmp.lt = icmp ult i32* %0, %1 + // CHECK: %sel.lt = select i1 %cmp.lt, i8 [[LT]], i8 [[GT]] + // CHECK: %cmp.eq = icmp eq i32* %0, %1 + // CHECK: %sel.eq = select i1 %cmp.eq, i8 [[EQ]], i8 %sel.lt + // CHECK: %__value_ = getelementptr inbounds %[[SO]], %[[SO]]* %[[DEST]] + // CHECK: store i8 %sel.eq, i8* %__value_, align 1 + // CHECK: ret + return x <=> y; +} + +struct MemPtr {}; +using MemPtrT = void (MemPtr::*)(); +using MemDataT = int(MemPtr::*); + +// CHECK-LABEL: @_Z12mem_ptr_testM6MemPtrFvvES1_ +auto mem_ptr_test(MemPtrT x, MemPtrT y) { + // CHECK: %[[DEST:retval|agg.result]] + // CHECK: %cmp.ptr = icmp eq [[TY:i[0-9]+]] %lhs.memptr.ptr, %rhs.memptr.ptr + // CHECK: %cmp.ptr.null = icmp eq [[TY]] %lhs.memptr.ptr, 0 + // CHECK: %cmp.adj = icmp eq [[TY]] %lhs.memptr.adj, %rhs.memptr.adj + // CHECK: %[[OR:.*]] = or i1 + // CHECK-SAME %cmp.adj + // CHECK: %memptr.eq = and i1 %cmp.ptr, %[[OR]] + // CHECK: %sel.eq = select i1 %memptr.eq, i8 [[EQ]], i8 [[NE]] + // CHECK: %__value_ = getelementptr inbounds %[[SE]], %[[SE]]* %[[DEST]] + // CHECK: store i8 %sel.eq, i8* %__value_, align 1 + // CHECK: ret + return x <=> y; +} + +// CHECK-LABEL: @_Z13mem_data_testM6MemPtriS0_ +auto mem_data_test(MemDataT x, MemDataT y) { + // CHECK: %[[DEST:retval|agg.result]] + // CHECK: %[[CMP:.*]] = icmp eq i{{[0-9]+}} %0, %1 + // CHECK: %sel.eq = select i1 %[[CMP]], i8 [[EQ]], i8 [[NE]] + // CHECK: %__value_ = getelementptr inbounds %[[SE]], %[[SE]]* %[[DEST]] + // CHECK: store i8 %sel.eq, i8* %__value_, align 1 + return x <=> y; +} + +// CHECK-LABEL: @_Z13test_constantv +auto test_constant() { + // CHECK: %[[DEST:retval|agg.result]] + // CHECK-NOT: icmp + // CHECK: %__value_ = getelementptr inbounds %[[SO]], %[[SO]]* %[[DEST]] + // CHECK-NEXT: store i8 -1, i8* %__value_ + // CHECK: ret + const int x = 42; + const int y = 101; + return x <=> y; +} + +// CHECK-LABEL: @_Z16test_nullptr_objPiDn +auto test_nullptr_obj(int* x, decltype(nullptr) y) { + // CHECK: %[[DEST:retval|agg.result]] + // CHECK: %cmp.eq = icmp eq i32* %0, null + // CHECK: %sel.eq = select i1 %cmp.eq, i8 [[EQ]], i8 [[NE]] + // CHECK: %__value_ = getelementptr inbounds %[[SE]], %[[SE]]* %[[DEST]] + // CHECK: store i8 %sel.eq, i8* %__value_, align 1 + return x <=> y; +} + +// CHECK-LABEL: @_Z18unscoped_enum_testijxy +void unscoped_enum_test(int i, unsigned u, long long l, unsigned long long ul) { + enum EnumA : int { A }; + enum EnumB : unsigned { B }; + // CHECK: %[[I:.*]] = load {{.*}} %i.addr + // CHECK: icmp slt i32 {{.*}} %[[I]] + (void)(A <=> i); + + // CHECK: %[[U:.*]] = load {{.*}} %u.addr + // CHECK: icmp ult i32 {{.*}} %[[U]] + (void)(A <=> u); + + // CHECK: %[[L:.*]] = load {{.*}} %l.addr + // CHECK: icmp slt i64 {{.*}} %[[L]] + (void)(A <=> l); + + // CHECK: %[[U2:.*]] = load {{.*}} %u.addr + // CHECK: icmp ult i32 {{.*}} %[[U2]] + (void)(B <=> u); + + // CHECK: %[[UL:.*]] = load {{.*}} %ul.addr + // CHECK: icmp ult i64 {{.*}} %[[UL]] + (void)(B <=> ul); +} + +namespace NullptrTest { +using nullptr_t = decltype(nullptr); + +// CHECK-LABEL: @_ZN11NullptrTest4testEDnDn( +auto test(nullptr_t x, nullptr_t y) { + // CHECK: %[[DEST:retval|agg.result]] + // CHECK-NOT: select + // CHECK: %__value_ = getelementptr inbounds %[[SE]], %[[SE]]* %[[DEST]] + // CHECK-NEXT: store i8 [[EQ]], i8* %__value_ + // CHECK: ret + return x <=> y; +} +} // namespace NullptrTest + +namespace ComplexTest { + +auto test_float(_Complex float x, _Complex float y) { + // CHECK: %[[DEST:retval|agg.result]] + // CHECK: %cmp.eq.r = fcmp oeq float %x.real, %y.real + // CHECK: %cmp.eq.i = fcmp oeq float %x.imag, %y.imag + // CHECK: %and.eq = and i1 %cmp.eq.r, %cmp.eq.i + // CHECK: %sel.eq = select i1 %and.eq, i8 [[EQ]], i8 [[NE]] + // CHECK: %__value_ = getelementptr inbounds %[[WE]], %[[WE]]* %[[DEST]] + // CHECK: store i8 %sel.eq, i8* %__value_, align 1 + return x <=> y; +} + +// CHECK-LABEL: @_ZN11ComplexTest8test_intECiS0_( +auto test_int(_Complex int x, _Complex int y) { + // CHECK: %[[DEST:retval|agg.result]] + // CHECK: %cmp.eq.r = icmp eq i32 %x.real, %y.real + // CHECK: %cmp.eq.i = icmp eq i32 %x.imag, %y.imag + // CHECK: %and.eq = and i1 %cmp.eq.r, %cmp.eq.i + // CHECK: %sel.eq = select i1 %and.eq, i8 [[EQ]], i8 [[NE]] + // CHECK: %__value_ = getelementptr inbounds %[[SE]], %[[SE]]* %[[DEST]] + // CHECK: store i8 %sel.eq, i8* %__value_, align 1 + return x <=> y; +} + +} // namespace ComplexTest diff --git a/test/CodeGenCXX/cxx2a-destroying-delete.cpp b/test/CodeGenCXX/cxx2a-destroying-delete.cpp index 2e4d40715e153..60c5970cb94f4 100644 --- a/test/CodeGenCXX/cxx2a-destroying-delete.cpp +++ b/test/CodeGenCXX/cxx2a-destroying-delete.cpp @@ -21,7 +21,7 @@ void delete_A(A *a) { delete a; } // Ensure that we call the destroying delete and not the destructor. // CHECK-NOT: call // CHECK-ITANIUM: call void @_ZN1AdlEPS_St19destroying_delete_t(%{{.*}}* %[[a]]) -// CHECK-MSABI: call void @"\01??3A@@SAXPEAU0@Udestroying_delete_t@std@@@Z"(%{{.*}}* %[[a]], i8 +// CHECK-MSABI: call void @"??3A@@SAXPEAU0@Udestroying_delete_t@std@@@Z"(%{{.*}}* %[[a]], i8 // CHECK-NOT: call // CHECK: } @@ -65,7 +65,7 @@ void delete_C(C *c) { delete c; } // // CHECK-NOT: call // CHECK-ITANIUM: call void @_ZN1AdlEPS_St19destroying_delete_t(%{{.*}}* %[[a]]) -// CHECK-MSABI: call void @"\01??3A@@SAXPEAU0@Udestroying_delete_t@std@@@Z"(%{{.*}}* %[[a]], i8 +// CHECK-MSABI: call void @"??3A@@SAXPEAU0@Udestroying_delete_t@std@@@Z"(%{{.*}}* %[[a]], i8 // CHECK-NOT: call // CHECK: } @@ -78,15 +78,15 @@ void delete_D(D *d) { delete d; } // CHECK: br i1 // // CHECK-NOT: call -// CHECK: %[[VTABLE:.*]] = load -// CHECK: %[[DTOR:.*]] = load -// // For MS, we don't add a new vtable slot to the primary vtable for the virtual // destructor. Instead we cast to the VDel base class. // CHECK-MSABI: bitcast {{.*}} %[[d]] // CHECK-MSABI-NEXT: getelementptr {{.*}}, i64 8 // CHECK-MSABI-NEXT: %[[d:.*]] = bitcast i8* // +// CHECK: %[[VTABLE:.*]] = load +// CHECK: %[[DTOR:.*]] = load +// // CHECK: call {{void|i8\*}} %[[DTOR]](%{{.*}}* %[[d]] // CHECK-MSABI-SAME: , i32 1) // CHECK-NOT: call @@ -100,7 +100,7 @@ void delete_G(G *g) { delete g; } // CHECK-LABEL: define {{.*}}delete_G // CHECK-NOT: call // CHECK-ITANIUM: call void @_ZN1FdlEPS_St19destroying_delete_tmSt11align_val_t(%{{.*}}* %[[a]], i64 32, i64 16) -// CHECK-MSABI: call void @"\01??3F@@SAXPEAU0@Udestroying_delete_t@std@@_KW4align_val_t@2@@Z"(%{{.*}}* %[[a]], i8 {{[^,]*}}, i64 32, i64 16) +// CHECK-MSABI: call void @"??3F@@SAXPEAU0@Udestroying_delete_t@std@@_KW4align_val_t@2@@Z"(%{{.*}}* %[[a]], i8 {{[^,]*}}, i64 32, i64 16) // CHECK-NOT: call // CHECK: } @@ -116,7 +116,7 @@ H::~H() { call_in_dtor(); } // CHECK-ITANIUM-NOT: call // CHECK-ITANIUM: } -// CHECK-MSABI: define {{.*}} @"\01??_GH@@UEAAPEAXI@Z"( +// CHECK-MSABI: define {{.*}} @"??_GH@@UEAAPEAXI@Z"( // CHECK-MSABI-NOT: call{{ }} // CHECK-MSABI: load i32 // CHECK-MSABI: icmp eq i32 {{.*}}, 0 @@ -125,10 +125,10 @@ H::~H() { call_in_dtor(); } // CHECK-MSABI-NOT: call{{ }} // CHECK-MSABI: getelementptr {{.*}}, i64 24 // CHECK-MSABI-NOT: call{{ }} -// CHECK-MSABI: call void @"\01??3F@@SAXPEAU0@Udestroying_delete_t@std@@_KW4align_val_t@2@@Z"({{.*}}, i64 48, i64 16) +// CHECK-MSABI: call void @"??3F@@SAXPEAU0@Udestroying_delete_t@std@@_KW4align_val_t@2@@Z"({{.*}}, i64 48, i64 16) // CHECK-MSABI: br label %[[RETURN:.*]] // -// CHECK-MSABI: call void @"\01??_DH@@QEAAXXZ"( +// CHECK-MSABI: call void @"??1H@@UEAA@XZ"( // CHECK-MSABI: br label %[[RETURN]] // // CHECK-MSABI: } @@ -143,7 +143,7 @@ I::~I() { call_in_dtor(); } // CHECK-ITANIUM-NOT: call // CHECK-ITANIUM: } -// CHECK-MSABI: define {{.*}} @"\01??_GI@@UEAAPEAXI@Z"( +// CHECK-MSABI: define {{.*}} @"??_GI@@UEAAPEAXI@Z"( // CHECK-MSABI-NOT: call{{ }} // CHECK-MSABI: load i32 // CHECK-MSABI: icmp eq i32 {{.*}}, 0 @@ -152,10 +152,10 @@ I::~I() { call_in_dtor(); } // CHECK-MSABI-NOT: call{{ }} // CHECK-MSABI: getelementptr {{.*}}, i64 24 // CHECK-MSABI-NOT: call{{ }} -// CHECK-MSABI: call void @"\01??3F@@SAXPEAU0@Udestroying_delete_t@std@@_KW4align_val_t@2@@Z"({{.*}}, i64 96, i64 32) +// CHECK-MSABI: call void @"??3F@@SAXPEAU0@Udestroying_delete_t@std@@_KW4align_val_t@2@@Z"({{.*}}, i64 96, i64 32) // CHECK-MSABI: br label %[[RETURN:.*]] // -// CHECK-MSABI: call void @"\01??_DI@@QEAAXXZ"( +// CHECK-MSABI: call void @"??1I@@UEAA@XZ"( // CHECK-MSABI: br label %[[RETURN]] // // CHECK-MSABI: } diff --git a/test/CodeGenCXX/debug-info-access.cpp b/test/CodeGenCXX/debug-info-access.cpp index 82f29ea4d38af..44d6b4da17a36 100644 --- a/test/CodeGenCXX/debug-info-access.cpp +++ b/test/CodeGenCXX/debug-info-access.cpp @@ -10,7 +10,7 @@ struct A { }; -// CHECK: !DIDerivedType(tag: DW_TAG_inheritance,{{.*}} baseType: ![[A]],{{.*}} flags: DIFlagPublic) +// CHECK: !DIDerivedType(tag: DW_TAG_inheritance,{{.*}} baseType: ![[A]],{{.*}} flags: DIFlagPublic, extraData: i32 0) class B : public A { public: // CHECK-DAG: !DISubprogram(name: "pub",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPublic | DIFlagPrototyped, diff --git a/test/CodeGenCXX/debug-info-class-nolimit.cpp b/test/CodeGenCXX/debug-info-class-nolimit.cpp index 0b3b38dd17b10..b184b9e08da7f 100644 --- a/test/CodeGenCXX/debug-info-class-nolimit.cpp +++ b/test/CodeGenCXX/debug-info-class-nolimit.cpp @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin -debug-info-kind=standalone -o - -emit-llvm %s | FileCheck %s // We had a bug in -fstandalone-debug where UnicodeString would not be completed -// when it was required to be complete. This orginally manifested as an +// when it was required to be complete. This originally manifested as an // assertion in CodeView emission on Windows with some dllexport stuff, but it's // more general than that. diff --git a/test/CodeGenCXX/debug-info-codeview-unnamed.cpp b/test/CodeGenCXX/debug-info-codeview-unnamed.cpp new file mode 100644 index 0000000000000..dd4cc9cb47873 --- /dev/null +++ b/test/CodeGenCXX/debug-info-codeview-unnamed.cpp @@ -0,0 +1,108 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -debug-info-kind=limited -S -emit-llvm -std=c++11 -o - %s | FileCheck --check-prefix LINUX %s +// RUN: %clang_cc1 -triple x86_64-windows-msvc -debug-info-kind=limited -gcodeview -S -emit-llvm -std=c++11 -o - %s | FileCheck --check-prefix MSVC %s + +int main(int argc, char* argv[], char* arge[]) { + // + // In CodeView, the LF_MFUNCTION entry for "bar()" refers to the forward + // reference of the unnamed struct. Visual Studio requires a unique + // identifier to match the LF_STRUCTURE forward reference to the definition. + // + struct { void bar() {} } one; + // + // LINUX: !{{[0-9]+}} = !DILocalVariable(name: "one" + // LINUX-SAME: type: [[TYPE_OF_ONE:![0-9]+]] + // LINUX-SAME: ) + // LINUX: [[TYPE_OF_ONE]] = distinct !DICompositeType( + // LINUX-SAME: tag: DW_TAG_structure_type + // LINUX-NOT: name: + // LINUX-NOT: identifier: + // LINUX-SAME: ) + // + // MSVC: !{{[0-9]+}} = !DILocalVariable(name: "one" + // MSVC-SAME: type: [[TYPE_OF_ONE:![0-9]+]] + // MSVC-SAME: ) + // MSVC: [[TYPE_OF_ONE]] = distinct !DICompositeType + // MSVC-SAME: tag: DW_TAG_structure_type + // MSVC-SAME: name: "<unnamed-type-one>" + // MSVC-SAME: identifier: ".?AU<unnamed-type-one>@?1??main@@9@" + // MSVC-SAME: ) + + + // In CodeView, the LF_POINTER entry for "ptr2unnamed" refers to the forward + // reference of the unnamed struct. Visual Studio requires a unique + // identifier to match the LF_STRUCTURE forward reference to the definition. + // + struct { int bar; } two = { 42 }; + int decltype(two)::*ptr2unnamed = &decltype(two)::bar; + // + // LINUX: !{{[0-9]+}} = !DILocalVariable(name: "two" + // LINUX-SAME: type: [[TYPE_OF_TWO:![0-9]+]] + // LINUX-SAME: ) + // LINUX: [[TYPE_OF_TWO]] = distinct !DICompositeType( + // LINUX-SAME: tag: DW_TAG_structure_type + // LINUX-NOT: name: + // LINUX-NOT: identifier: + // LINUX-SAME: ) + // + // MSVC: !{{[0-9]+}} = !DILocalVariable(name: "two" + // MSVC-SAME: type: [[TYPE_OF_TWO:![0-9]+]] + // MSVC-SAME: ) + // MSVC: [[TYPE_OF_TWO]] = distinct !DICompositeType + // MSVC-SAME: tag: DW_TAG_structure_type + // MSVC-SAME: name: "<unnamed-type-two>" + // MSVC-SAME: identifier: ".?AU<unnamed-type-two>@?2??main@@9@" + // MSVC-SAME: ) + + + // In DWARF, named structures which are not externally visibile do not + // require an identifier. In CodeView, named structures are given an + // identifier. + // + struct named { int bar; int named::* p2mem; } three = { 42, &named::bar }; + // + // LINUX: !{{[0-9]+}} = !DILocalVariable(name: "three" + // LINUX-SAME: type: [[TYPE_OF_THREE:![0-9]+]] + // LINUX-SAME: ) + // LINUX: [[TYPE_OF_THREE]] = distinct !DICompositeType( + // LINUX-SAME: tag: DW_TAG_structure_type + // LINUX-SAME: name: "named" + // LINUX-NOT: identifier: + // LINUX-SAME: ) + // + // MSVC: !{{[0-9]+}} = !DILocalVariable(name: "three" + // MSVC-SAME: type: [[TYPE_OF_THREE:![0-9]+]] + // MSVC-SAME: ) + // MSVC: [[TYPE_OF_THREE]] = distinct !DICompositeType + // MSVC-SAME: tag: DW_TAG_structure_type + // MSVC-SAME: name: "named" + // MSVC-SAME: identifier: ".?AUnamed@?1??main@@9@" + // MSVC-SAME: ) + + + // In CodeView, the LF_MFUNCTION entry for the lambda "operator()" routine + // refers to the forward reference of the unnamed LF_CLASS for the lambda. + // Visual Studio requires a unique identifier to match the forward reference + // of the LF_CLASS to its definition. + // + auto four = [argc](int i) -> int { return argc == i ? 1 : 0; }; + // + // LINUX: !{{[0-9]+}} = !DILocalVariable(name: "four" + // LINUX-SAME: type: [[TYPE_OF_FOUR:![0-9]+]] + // LINUX-SAME: ) + // LINUX: [[TYPE_OF_FOUR]] = distinct !DICompositeType( + // LINUX-SAME: tag: DW_TAG_class_type + // LINUX-NOT: name: + // LINUX-NOT: identifier: + // LINUX-SAME: ) + // + // MSVC: !{{[0-9]+}} = !DILocalVariable(name: "four" + // MSVC-SAME: type: [[TYPE_OF_FOUR:![0-9]+]] + // MSVC-SAME: ) + // MSVC: [[TYPE_OF_FOUR]] = distinct !DICompositeType + // MSVC-SAME: tag: DW_TAG_class_type + // MSVC-NOT: name: + // MSVC-SAME: identifier: ".?AV<lambda_0>@?0??main@@9@" + // MSVC-SAME: ) + + return 0; +} diff --git a/test/CodeGenCXX/debug-info-codeview-var-templates.cpp b/test/CodeGenCXX/debug-info-codeview-var-templates.cpp new file mode 100644 index 0000000000000..0470c133688cb --- /dev/null +++ b/test/CodeGenCXX/debug-info-codeview-var-templates.cpp @@ -0,0 +1,35 @@ +// RUN: %clang_cc1 %s -std=c++14 -triple=i686-pc-windows-msvc -debug-info-kind=limited -gcodeview -emit-llvm -o - | FileCheck %s + +// Don't emit static data member debug info for variable templates. +// PR38004 + +struct TestImplicit { + template <typename T> + static const __SIZE_TYPE__ size_var = sizeof(T); +}; +int instantiate_test1() { return TestImplicit::size_var<int> + TestImplicit::size_var<TestImplicit>; } +TestImplicit gv1; + +// CHECK: ![[empty:[0-9]+]] = !{} + +// CHECK: ![[A:[^ ]*]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "TestImplicit", +// CHECK-SAME: elements: ![[empty]] + +template <typename T> bool vtpl; +struct TestSpecialization { + template <typename T, typename U> static const auto sdm = vtpl<T>; + template <> static const auto sdm<int, int> = false; +} gv2; + +// CHECK: ![[A:[^ ]*]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "TestSpecialization", +// CHECK-SAME: elements: ![[empty]] + +template <class> bool a; +template <typename> struct b; +struct TestPartial { + template <typename... e> static auto d = a<e...>; + template <typename... e> static auto d<b<e...>> = d<e...>; +} c; + +// CHECK: ![[A:[^ ]*]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "TestPartial", +// CHECK-SAME: elements: ![[empty]] diff --git a/test/CodeGenCXX/debug-info-composite-cc.cpp b/test/CodeGenCXX/debug-info-composite-cc.cpp new file mode 100644 index 0000000000000..d4d4046105e14 --- /dev/null +++ b/test/CodeGenCXX/debug-info-composite-cc.cpp @@ -0,0 +1,50 @@ +// RUN: %clang_cc1 -emit-llvm -debug-info-kind=standalone -triple %itanium_abi_triple %s -o - | FileCheck %s + +// Not trivially copyable because of the explicit destructor. +// CHECK-DAG: !DICompositeType({{.*}}, name: "RefDtor",{{.*}}flags: DIFlagTypePassByReference +struct RefDtor { + int i; + ~RefDtor() {} +} refDtor; + +// Not trivially copyable because of the explicit copy constructor. +// CHECK-DAG: !DICompositeType({{.*}}, name: "RefCopy",{{.*}}flags: DIFlagTypePassByReference +struct RefCopy { + int i; + RefCopy() = default; + RefCopy(RefCopy &Copy) {} +} refCopy; + +// POD-like type even though it defines a destructor. +// CHECK-DAG: !DICompositeType({{.*}}, name: "Podlike", {{.*}}flags: DIFlagTypePassByValue +struct Podlike { + int i; + Podlike() = default; + Podlike(Podlike &&Move) = default; + ~Podlike() = default; +} podlike; + + +// This is a POD type. +// CHECK-DAG: !DICompositeType({{.*}}, name: "Pod",{{.*}}flags: DIFlagTypePassByValue +struct Pod { + int i; +} pod; + +// This is definitely not a POD type. +// CHECK-DAG: !DICompositeType({{.*}}, name: "Complex",{{.*}}flags: DIFlagTypePassByReference +struct Complex { + Complex() {} + Complex(Complex &Copy) : i(Copy.i) {}; + int i; +} complex; + +// This type is manually marked as trivial_abi. +// CHECK-DAG: !DICompositeType({{.*}}, name: "Marked",{{.*}}flags: DIFlagTypePassByValue +struct __attribute__((trivial_abi)) Marked { + int *p; + Marked(); + ~Marked(); + Marked(const Marked &) noexcept; + Marked &operator=(const Marked &); +} marked; diff --git a/test/CodeGenCXX/debug-info-enum-class.cpp b/test/CodeGenCXX/debug-info-enum-class.cpp index b615d5b09626f..e857bb1959133 100644 --- a/test/CodeGenCXX/debug-info-enum-class.cpp +++ b/test/CodeGenCXX/debug-info-enum-class.cpp @@ -15,7 +15,7 @@ D d; // CHECK-SAME: baseType: ![[INT:[0-9]+]] // CHECK-SAME: size: 32 // CHECK-NOT: offset: -// CHECK-NOT: flags: +// CHECK-SAME: flags: DIFlagFixedEnum // CHECK-SAME: ){{$}} // CHECK: ![[INT]] = !DIBasicType(name: "int" // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "B" @@ -23,12 +23,12 @@ D d; // CHECK-SAME: baseType: ![[ULONG:[0-9]+]] // CHECK-SAME: size: 64 // CHECK-NOT: offset: -// CHECK-NOT: flags: +// CHECK-SAME: flags: DIFlagFixedEnum // CHECK-SAME: ){{$}} // CHECK: ![[ULONG]] = !DIBasicType(name: "long unsigned int" // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "C" // CHECK-SAME: line: 5 -// CHECK-NOT: baseType: +// CHECK-SAME: baseType: ![[ULONG:[0-9]+]] // CHECK-SAME: size: 32 // CHECK-NOT: offset: // CHECK-NOT: flags: diff --git a/test/CodeGenCXX/debug-info-enum.cpp b/test/CodeGenCXX/debug-info-enum.cpp index 8f54f9d712247..447edba446dc2 100644 --- a/test/CodeGenCXX/debug-info-enum.cpp +++ b/test/CodeGenCXX/debug-info-enum.cpp @@ -11,7 +11,7 @@ namespace test1 { // CHECK-SAME: identifier: "_ZTSN5test11eE" // CHECK: [[TEST1]] = !DINamespace(name: "test1" // CHECK: [[TEST1_ENUMS]] = !{[[TEST1_E:![0-9]*]]} -// CHECK: [[TEST1_E]] = !DIEnumerator(name: "E", value: 0) +// CHECK: [[TEST1_E]] = !DIEnumerator(name: "E", value: 0, isUnsigned: true) enum e { E }; void foo() { int v = E; diff --git a/test/CodeGenCXX/debug-info-line-if.cpp b/test/CodeGenCXX/debug-info-line-if.cpp index 41770b1356194..7e6cdb2eb9d81 100644 --- a/test/CodeGenCXX/debug-info-line-if.cpp +++ b/test/CodeGenCXX/debug-info-line-if.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -debug-info-kind=limited -std=c++11 -S -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -debug-info-kind=limited -std=c++11 -S -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s // PR19864 extern int v[2]; int a = 0, b = 0; diff --git a/test/CodeGenCXX/debug-info-ms-dtor-thunks.cpp b/test/CodeGenCXX/debug-info-ms-dtor-thunks.cpp index f876267eb5d69..d6fdee62d6772 100644 --- a/test/CodeGenCXX/debug-info-ms-dtor-thunks.cpp +++ b/test/CodeGenCXX/debug-info-ms-dtor-thunks.cpp @@ -4,11 +4,11 @@ struct __declspec(dllexport) S { virtual ~S(); }; struct __declspec(dllexport) T { virtual ~T(); }; struct __declspec(dllexport) U : S, T { virtual ~U(); }; -// CHECK-LABEL: define {{.*}} @"\01??_GS@@UAEPAXI@Z" -// CHECK: call x86_thiscallcc void @"\01??_DS@@QAEXXZ"(%struct.S* %this1){{.*}}!dbg !{{[0-9]+}} +// CHECK-LABEL: define {{.*}} @"??_GS@@UAEPAXI@Z" +// CHECK: call x86_thiscallcc void @"??1S@@UAE@XZ"(%struct.S* %this1){{.*}}!dbg !{{[0-9]+}} -// CHECK-LABEL: define {{.*}} @"\01??_GT@@UAEPAXI@Z" -// CHECK: call x86_thiscallcc void @"\01??_DT@@QAEXXZ"(%struct.T* %this1){{.*}}!dbg !{{[0-9]+}} +// CHECK-LABEL: define {{.*}} @"??_GT@@UAEPAXI@Z" +// CHECK: call x86_thiscallcc void @"??1T@@UAE@XZ"(%struct.T* %this1){{.*}}!dbg !{{[0-9]+}} -// CHECK-LABEL: define {{.*}} @"\01??_GU@@UAEPAXI@Z" -// CHECK: call x86_thiscallcc void @"\01??_DU@@QAEXXZ"(%struct.U* %this1){{.*}}!dbg !{{[0-9]+}} +// CHECK-LABEL: define {{.*}} @"??_GU@@UAEPAXI@Z" +// CHECK: call x86_thiscallcc void @"??1U@@UAE@XZ"(%struct.U* %this1){{.*}}!dbg !{{[0-9]+}} diff --git a/test/CodeGenCXX/debug-info-ms-vbase.cpp b/test/CodeGenCXX/debug-info-ms-vbase.cpp index 3de3a751cba1a..04c9a6d2ba74e 100644 --- a/test/CodeGenCXX/debug-info-ms-vbase.cpp +++ b/test/CodeGenCXX/debug-info-ms-vbase.cpp @@ -8,7 +8,7 @@ // CHECK: ![[elements]] = !{![[NoPrimaryBase_base:[0-9]+]]} // CHECK: ![[NoPrimaryBase_base]] = !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[NoPrimaryBase]], -// CHECK-SAME: baseType: ![[HasVirtualMethod:[0-9]+]], offset: 4, flags: DIFlagVirtual) +// CHECK-SAME: baseType: ![[HasVirtualMethod:[0-9]+]], offset: 4, flags: DIFlagVirtual, extraData: i32 0) // CHECK: ![[HasVirtualMethod]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "HasVirtualMethod" @@ -18,11 +18,11 @@ // CHECK: ![[elements]] = !{![[SecondaryVTable_base:[0-9]+]], ![[HasVirtualMethod_base:[0-9]+]], ![[vshape:[0-9]+]]} // CHECK: ![[SecondaryVTable_base]] = !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[HasPrimaryBase]], -// CHECK-SAME: baseType: ![[SecondaryVTable:[0-9]+]], offset: 4, flags: DIFlagVirtual) +// CHECK-SAME: baseType: ![[SecondaryVTable:[0-9]+]], offset: 4, flags: DIFlagVirtual, extraData: i32 4) // CHECK: ![[SecondaryVTable]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "SecondaryVTable" -// CHECK: ![[HasVirtualMethod_base]] = !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[HasPrimaryBase]], baseType: ![[HasVirtualMethod]]) +// CHECK: ![[HasVirtualMethod_base]] = !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[HasPrimaryBase]], baseType: ![[HasVirtualMethod]], extraData: i32 0) // CHECK: ![[HasIndirectVirtualBase:[0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "HasIndirectVirtualBase" // CHECK-SAME: elements: ![[elements:[0-9]+]] @@ -41,7 +41,7 @@ // CHECK: ![[elements]] = !{![[POD_base:[0-9]+]]} // CHECK: ![[POD_base]] = !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[DynamicNoVFPtr]], -// CHECK-SAME: baseType: ![[POD:[0-9]+]], offset: 4, flags: DIFlagVirtual) +// CHECK-SAME: baseType: ![[POD:[0-9]+]], offset: 4, flags: DIFlagVirtual, extraData: i32 0) // CHECK: ![[POD]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "POD" diff --git a/test/CodeGenCXX/debug-info-range-for-var-names.cpp b/test/CodeGenCXX/debug-info-range-for-var-names.cpp new file mode 100644 index 0000000000000..6cd70fe0820dc --- /dev/null +++ b/test/CodeGenCXX/debug-info-range-for-var-names.cpp @@ -0,0 +1,35 @@ +// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s + +struct vec { + using itr = int*; + itr begin() { return nullptr; } + itr end() { return nullptr; } +}; + +void test() { + vec as, bs, cs; + + for (auto a : as) + for (auto b : bs) + for (auto c : cs) { + } +} + +// CHECK: call void @llvm.dbg.declare(metadata %struct.vec** {{.*}}, metadata ![[RANGE1:[0-9]+]] +// CHECK: call void @llvm.dbg.declare(metadata i32** {{.*}}, metadata ![[BEGIN1:[0-9]+]] +// CHECK: call void @llvm.dbg.declare(metadata i32** {{.*}}, metadata ![[END1:[0-9]+]] +// CHECK: call void @llvm.dbg.declare(metadata %struct.vec** {{.*}}, metadata ![[RANGE2:[0-9]+]] +// CHECK: call void @llvm.dbg.declare(metadata i32** {{.*}}, metadata ![[BEGIN2:[0-9]+]] +// CHECK: call void @llvm.dbg.declare(metadata i32** {{.*}}, metadata ![[END2:[0-9]+]] +// CHECK: call void @llvm.dbg.declare(metadata %struct.vec** {{.*}}, metadata ![[RANGE3:[0-9]+]] +// CHECK: call void @llvm.dbg.declare(metadata i32** {{.*}}, metadata ![[BEGIN3:[0-9]+]] +// CHECK: call void @llvm.dbg.declare(metadata i32** {{.*}}, metadata ![[END3:[0-9]+]] +// CHECK: ![[RANGE1]] = !DILocalVariable(name: "__range1", +// CHECK: ![[BEGIN1]] = !DILocalVariable(name: "__begin1", +// CHECK: ![[END1]] = !DILocalVariable(name: "__end1", +// CHECK: ![[RANGE2]] = !DILocalVariable(name: "__range2", +// CHECK: ![[BEGIN2]] = !DILocalVariable(name: "__begin2", +// CHECK: ![[END2]] = !DILocalVariable(name: "__end2", +// CHECK: ![[RANGE3]] = !DILocalVariable(name: "__range3", +// CHECK: ![[BEGIN3]] = !DILocalVariable(name: "__begin3", +// CHECK: ![[END3]] = !DILocalVariable(name: "__end3", diff --git a/test/CodeGenCXX/debug-info-scope.cpp b/test/CodeGenCXX/debug-info-scope.cpp index e81eccc5168f2..1124282697492 100644 --- a/test/CodeGenCXX/debug-info-scope.cpp +++ b/test/CodeGenCXX/debug-info-scope.cpp @@ -58,7 +58,7 @@ void func() { } int x[] = {1, 2}; - // CHECK: = !DILocalVariable(name: "__range" + // CHECK: = !DILocalVariable(name: "__range1" // CHECK-SAME: scope: [[RANGE_FOR:![0-9]*]] // CHECK-NOT: line: // CHECK-SAME: ){{$}} diff --git a/test/CodeGenCXX/debug-info-static-member.cpp b/test/CodeGenCXX/debug-info-static-member.cpp index 3537754ced760..702d1f87e752c 100644 --- a/test/CodeGenCXX/debug-info-static-member.cpp +++ b/test/CodeGenCXX/debug-info-static-member.cpp @@ -3,9 +3,9 @@ // RUN: %clangxx -target x86_64-unknown-unknown -g -std=c++11 %s -emit-llvm -S -o - | FileCheck %s // PR14471 -// CHECK: @_ZN1C1aE = global i32 4, align 4, !dbg [[A:![0-9]+]] -// CHECK: @_ZN1C1bE = global i32 2, align 4, !dbg [[B:![0-9]+]] -// CHECK: @_ZN1C1cE = global i32 1, align 4, !dbg [[C:![0-9]+]] +// CHECK: @_ZN1C1aE = dso_local global i32 4, align 4, !dbg [[A:![0-9]+]] +// CHECK: @_ZN1C1bE = dso_local global i32 2, align 4, !dbg [[B:![0-9]+]] +// CHECK: @_ZN1C1cE = dso_local global i32 1, align 4, !dbg [[C:![0-9]+]] enum X { Y diff --git a/test/CodeGenCXX/debug-info-template.cpp b/test/CodeGenCXX/debug-info-template.cpp index 0c34145162159..4b330a0b0a118 100644 --- a/test/CodeGenCXX/debug-info-template.cpp +++ b/test/CodeGenCXX/debug-info-template.cpp @@ -1,8 +1,8 @@ // RUN: %clang -S -emit-llvm -target x86_64-unknown_unknown -g %s -o - -std=c++11 | FileCheck %s -// CHECK: @tci = global %"struct.TC<unsigned int, 2, &glb, &foo::e, &foo::f, &foo::g, 1, 2, 3>::nested" zeroinitializer, align 1, !dbg [[TCI:![0-9]+]] -// CHECK: @tcn = global %struct.TC zeroinitializer, align 1, !dbg [[TCN:![0-9]+]] -// CHECK: @nn = global %struct.NN zeroinitializer, align 1, !dbg [[NN:![0-9]+]] +// CHECK: @tci = dso_local global %"struct.TC<unsigned int, 2, &glb, &foo::e, &foo::f, &foo::g, 1, 2, 3>::nested" zeroinitializer, align 1, !dbg [[TCI:![0-9]+]] +// CHECK: @tcn = dso_local global %struct.TC zeroinitializer, align 1, !dbg [[TCN:![0-9]+]] +// CHECK: @nn = dso_local global %struct.NN zeroinitializer, align 1, !dbg [[NN:![0-9]+]] // CHECK: !DICompileUnit( // CHECK: [[EMPTY:![0-9]*]] = !{} diff --git a/test/CodeGenCXX/debug-info-thunk-msabi.cpp b/test/CodeGenCXX/debug-info-thunk-msabi.cpp index 5c705ac0ac134..565992ad2a3d2 100644 --- a/test/CodeGenCXX/debug-info-thunk-msabi.cpp +++ b/test/CodeGenCXX/debug-info-thunk-msabi.cpp @@ -3,10 +3,10 @@ class __declspec(dllexport) A { A(int * = new int) {} }; -// CHECK: define {{.*}}void @"\01??_FA@@AAEXXZ" +// CHECK: define {{.*}}void @"??_FA@@AAEXXZ" // CHECK-SAME: !dbg ![[SP:[0-9]+]] // CHECK-NOT: {{ret }} -// CHECK: call x86_thiscallcc %class.A* @"\01??0A@@AAE@PAH@Z" +// CHECK: call x86_thiscallcc %class.A* @"??0A@@AAE@PAH@Z" // CHECK-SAME: !dbg ![[DBG:[0-9]+]] // CHECK: ret void, !dbg // diff --git a/test/CodeGenCXX/debug-info-thunk.cpp b/test/CodeGenCXX/debug-info-thunk.cpp index f7d16f493256e..56dec93f6b391 100644 --- a/test/CodeGenCXX/debug-info-thunk.cpp +++ b/test/CodeGenCXX/debug-info-thunk.cpp @@ -1,29 +1,277 @@ -// RUN: %clang_cc1 %s -triple %itanium_abi_triple -debug-info-kind=limited -S -emit-llvm -o - | FileCheck %s - -struct A { - virtual void f(); -}; - -struct B { - virtual void f(); -}; - -struct C : A, B { - virtual void f(); -}; - -void C::f() { } -// CHECK: define {{.*}}void @_ZThn{{[48]}}_N1C1fEv -// CHECK-SAME: !dbg ![[SP:[0-9]+]] -// CHECK-NOT: {{ret }} -// CHECK: = load{{.*}} !dbg ![[DBG:[0-9]+]] -// CHECK-NOT: {{ret }} -// CHECK: ret void, !dbg ![[DBG]] +// RUN: %clang_cc1 %s -triple=x86_64-pc-windows-msvc -debug-info-kind=limited -S -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -triple %itanium_abi_triple -debug-info-kind=limited -S -emit-llvm -o - | FileCheck %s -check-prefix=ITANIUM // -// CHECK: ![[SP]] = distinct !DISubprogram(linkageName: "_ZThn{{[48]}}_N1C1fEv" -// CHECK-SAME: line: 15 -// CHECK-SAME: isDefinition: true -// CHECK-SAME: DIFlagArtificial -// CHECK-SAME: ){{$}} +// Validate we emit a "DIFlagThunk" flag on DISubprogram entries for thunks. +// This flag is used for emitting S_THUNK32 symbols for CodeView debugging. // -// CHECK: ![[DBG]] = !DILocation(line: 0 +// NOTE: +// Because thunks are compiler generated and don't exist in the source, this +// test is dependent upon the linkage name to identify the thunk. Any changes +// in the name mangling may require this test to be updated. +// +// NOTE: +// The FileCheck directives below use CHECK-DAG because the thunks may not be +// emitted in source order. +// + +namespace Test1 { + struct A { + virtual void f(); + }; + + struct B { + virtual void f(); + }; + + struct C : A, B { + virtual void c(); + + virtual void f(); + }; + +// CHECK-DAG: DISubprogram{{.*}}linkageName: "?f@C@Test1@@W7EAAXXZ"{{.*}} flags: {{.*}}DIFlagThunk + void C::f() { } +} + +namespace Test2 { + struct V1 { }; + struct V2 : virtual V1 { }; + + struct A { + virtual V1 *f(); + }; + + struct B : A { + virtual void b(); + + virtual V2 *f(); + }; + +// CHECK-DAG: DISubprogram{{.*}}linkageName: "?f@B@Test2@@QEAAPEAUV1@2@XZ"{{.*}} flags: {{.*}}DIFlagThunk + V2 *B::f() { return 0; } +} + +namespace Test3 { + struct A { + virtual void f(); + }; + + struct B { + virtual void f(); + }; + + struct __attribute__((visibility("protected"))) C : A, B { + virtual void c(); + + virtual void f(); + }; + +// CHECK-DAG: DISubprogram{{.*}}linkageName: "?f@C@Test3@@W7EAAXXZ"{{.*}} flags: {{.*}}DIFlagThunk + void C::f() { } +} + +namespace Test4 { + struct A { + virtual void f(); + }; + + struct B { + virtual void f(); + }; + + namespace { + struct C : A, B { + virtual void c(); + virtual void f(); + }; + } + void C::c() {} +// CHECK-DAG: DISubprogram{{.*}}linkageName: "?f@C@?A@Test4@@W7EAAXXZ"{{.*}} flags: {{.*}}DIFlagThunk + void C::f() {} + + // Force C::f to be used. + void f() { + C c; + c.f(); + } +} + +namespace Test5 { + struct X { + X(); + X(const X&); + X &operator=(const X&); + ~X(); + }; + + struct P { + P(); + P(const P&); + ~P(); + X first; + X second; + }; + + P getP(); + + struct Base1 { + int i; + + virtual X f() { return X(); } + }; + + struct Base2 { + float real; + + virtual X f() { return X(); } + }; + + struct Thunks : Base1, Base2 { + long l; + + virtual X f(); + }; + +// CHECK-DAG: DISubprogram{{.*}}linkageName: "?f@Thunks@Test5@@WBA@EAA?AUX@2@XZ"{{.*}} flags: {{.*}}DIFlagThunk + X Thunks::f() { return X(); } +} + +namespace Test6 { + struct X { + X(); + X(const X&); + X &operator=(const X&); + ~X(); + }; + + struct Small { short s; }; + struct Large { + char array[1024]; + }; + + class A { + protected: + virtual void foo() = 0; + }; + + class B : public A { + protected: + virtual void bar() = 0; + }; + + class C : public A { + protected: + virtual void baz(X, X&, _Complex float, Small, Small&, Large) = 0; + }; + + class D : public B, + public C { +// CHECK-DAG: DISubprogram{{.*}}linkageName: "?foo@D@Test6@@G7EAAXXZ"{{.*}} flags: {{.*}}DIFlagThunk + void foo() {} + void bar() {} + void baz(X, X&, _Complex float, Small, Small&, Large); + }; + + void D::baz(X, X&, _Complex float, Small, Small&, Large) { } + + void testD() { D d; } +} + +namespace Test7 { + struct A { virtual void foo(); }; + struct B { virtual void foo(); }; +// CHECK-DAG: DISubprogram{{.*}}linkageName: "?foo@C@Test7@@W7EAAXXZ"{{.*}} flags: {{.*}}DIFlagThunk + struct C : A, B { void foo() {} }; + + // Test later. + void test() { + C c; + } +} + +namespace Test8 { + struct A { virtual A* f(); }; + struct B : virtual A { virtual A* f(); }; + struct C : B { virtual C* f(); }; +// CHECK-DAG: DISubprogram{{.*}}linkageName: "?f@C@Test8@@QEAAPEAUA@2@XZ"{{.*}} flags: {{.*}}DIFlagThunk + C* C::f() { return 0; } +} + +namespace Test9 { + struct B1 { + virtual B1 &foo1(); + }; + struct Pad1 { + virtual ~Pad1(); + }; + struct Proxy1 : Pad1, B1 { + virtual ~Proxy1(); + }; + struct D : virtual Proxy1 { + virtual ~D(); + virtual D &foo1(); + }; +// CHECK-DAG: DISubprogram{{.*}}linkageName: "?foo1@D@Test9@@$4PPPPPPPE@A@EAAAEAUB1@2@XZ"{{.*}} flags: {{.*}}DIFlagThunk +// CHECK-DAG: DISubprogram{{.*}}linkageName: "?foo1@D@Test9@@$4PPPPPPPE@A@EAAAEAU12@XZ"{{.*}} flags: {{.*}}DIFlagThunk + D& D::foo1() { + return *this; + } +} + +namespace Test10 { + class A { + virtual void f(); + }; + class B { + virtual void f(); + }; + class C : public A, public B { + virtual void f(); + }; +// CHECK-DAG: DISubprogram{{.*}}linkageName: "?f@C@Test10@@G7EAAXXZ"{{.*}} flags: {{.*}}DIFlagThunk + void C::f() { + } +} + +namespace Test11 { + class A { + public: + virtual void f(); + }; + + void test() { +// CHECK-DAG: DISubprogram{{.*}}linkageName: "??_9A@Test11@@$BA@AA"{{.*}} flags: {{.*}}DIFlagThunk + void (A::*p)() = &A::f; + } +} + +namespace Test12 { + struct A { + virtual void f(); + }; + + struct B { + virtual void f(); + }; + + struct C : A, B { + virtual void f(); + }; + + void C::f() { } + // ITANIUM: define {{.*}}void @_ZThn{{[48]}}_N6Test121C1fEv + // ITANIUM-SAME: !dbg ![[SP:[0-9]+]] + // ITANIUM-NOT: {{ret }} + // ITANIUM: = load{{.*}} !dbg ![[DBG:[0-9]+]] + // ITANIUM-NOT: {{ret }} + // ITANIUM: ret void, !dbg ![[DBG]] + // + // ITANIUM: ![[SP]] = distinct !DISubprogram(linkageName: "_ZThn{{[48]}}_N6Test121C1fEv" + // ITANIUM-SAME: line: 261 + // ITANIUM-SAME: isDefinition: true + // ITANIUM-SAME: DIFlagArtificial + // ITANIUM-SAME: DIFlagThunk + // ITANIUM-SAME: ){{$}} + // + // ITANIUM: ![[DBG]] = !DILocation(line: 0 +} diff --git a/test/CodeGenCXX/debug-info-vla.cpp b/test/CodeGenCXX/debug-info-vla.cpp index 88f3a3f55dab9..6c35f301f968e 100644 --- a/test/CodeGenCXX/debug-info-vla.cpp +++ b/test/CodeGenCXX/debug-info-vla.cpp @@ -1,4 +1,4 @@ -// RUN: %clang -target x86_64-unknown-unknown -fverbose-asm -g -O0 -S -emit-llvm %s -o - -std=c++11 | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -std=c++11 -triple x86_64-unknown-unknown %s -o - | FileCheck %s void f(int m) { @@ -13,8 +13,10 @@ int (*fp)(int[][*]) = nullptr; // CHECK: [[ELEM_TYPE]] = !{[[NOCOUNT:.*]]} // CHECK: [[NOCOUNT]] = !DISubrange(count: -1) // +// CHECK: [[VAR:![0-9]+]] = !DILocalVariable(name: "__vla_expr", {{.*}}flags: DIFlagArtificial // CHECK: !DICompositeType(tag: DW_TAG_array_type, // CHECK-NOT: size: // CHECK-SAME: elements: [[ELEM_TYPE:![0-9]+]] -// CHECK: [[ELEM_TYPE]] = !{[[THREE:.*]], [[NOCOUNT]]} +// CHECK: [[ELEM_TYPE]] = !{[[THREE:.*]], [[VARRANGE:![0-9]+]]} // CHECK: [[THREE]] = !DISubrange(count: 3) +// CHECK: [[VARRANGE]] = !DISubrange(count: [[VAR]]) diff --git a/test/CodeGenCXX/debug-info-windows-dtor.cpp b/test/CodeGenCXX/debug-info-windows-dtor.cpp index 8eb744a61bc78..0b3d7e17e3faa 100644 --- a/test/CodeGenCXX/debug-info-windows-dtor.cpp +++ b/test/CodeGenCXX/debug-info-windows-dtor.cpp @@ -14,8 +14,8 @@ struct AB: A, B { template struct AB<int>; -// CHECK: define {{.*}}@"\01??_E?$AB@H@@W3AEPAXI@Z"({{.*}} !dbg [[THUNK_VEC_DEL_DTOR:![0-9]*]] -// CHECK: call {{.*}}@"\01??_G?$AB@H@@UAEPAXI@Z"({{.*}}) #{{[0-9]*}}, !dbg [[THUNK_LOC:![0-9]*]] +// CHECK: define {{.*}}@"??_E?$AB@H@@W3AEPAXI@Z"({{.*}} !dbg [[THUNK_VEC_DEL_DTOR:![0-9]*]] +// CHECK: call {{.*}}@"??_G?$AB@H@@UAEPAXI@Z"({{.*}}) #{{[0-9]*}}, !dbg [[THUNK_LOC:![0-9]*]] // CHECK: define // CHECK: [[THUNK_VEC_DEL_DTOR]] = distinct !DISubprogram diff --git a/test/CodeGenCXX/delayed-template-parsing.cpp b/test/CodeGenCXX/delayed-template-parsing.cpp index c5f4486415440..c0e9425d5184e 100644 --- a/test/CodeGenCXX/delayed-template-parsing.cpp +++ b/test/CodeGenCXX/delayed-template-parsing.cpp @@ -11,8 +11,8 @@ namespace ClassScopeSpecialization { void call() { Type T; -// CHECK: call {{.*}} @"\01??$Foo@$0A@@Type@ClassScopeSpecialization@@QAEXXZ" -// X64: call {{.*}} @"\01??$Foo@$0A@@Type@ClassScopeSpecialization@@QEAAXXZ" +// CHECK: call {{.*}} @"??$Foo@$0A@@Type@ClassScopeSpecialization@@QAEXXZ" +// X64: call {{.*}} @"??$Foo@$0A@@Type@ClassScopeSpecialization@@QEAAXXZ" T.Foo<0>(); } } diff --git a/test/CodeGenCXX/derived-cast.cpp b/test/CodeGenCXX/derived-cast.cpp new file mode 100644 index 0000000000000..bf2b258c5e9f8 --- /dev/null +++ b/test/CodeGenCXX/derived-cast.cpp @@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s + +class A { + int a; +}; + +class B { + int b; +public: + A *getAsA(); +}; + +class X : public A, public B { + int x; +}; + +// PR35909 - https://bugs.llvm.org/show_bug.cgi?id=35909 + +A *B::getAsA() { + return static_cast<X*>(this); + + // CHECK-LABEL: define %class.A* @_ZN1B6getAsAEv + // CHECK: %[[THIS:.*]] = load %class.B*, %class.B** + // CHECK-NEXT: %[[BC:.*]] = bitcast %class.B* %[[THIS]] to i8* + // CHECK-NEXT: getelementptr inbounds i8, i8* %[[BC]], i64 -4 +} + diff --git a/test/CodeGenCXX/destructors.cpp b/test/CodeGenCXX/destructors.cpp index 180e82de9fffb..ba8333b00dd6c 100644 --- a/test/CodeGenCXX/destructors.cpp +++ b/test/CodeGenCXX/destructors.cpp @@ -96,7 +96,7 @@ namespace test0 { // complete destructor alias tested above -// CHECK2-LABEL: @_ZN5test01AD1Ev = alias {{.*}} @_ZN5test01AD2Ev +// CHECK2-LABEL: @_ZN5test01AD1Ev = unnamed_addr alias {{.*}} @_ZN5test01AD2Ev // CHECK2-LABEL: define void @_ZN5test01AD2Ev(%"struct.test0::A"* %this) unnamed_addr // CHECK2: invoke void @_ZN5test06MemberD1Ev // CHECK2: unwind label [[MEM_UNWIND:%[a-zA-Z0-9.]+]] @@ -104,7 +104,7 @@ namespace test0 { // CHECK2: unwind label [[BASE_UNWIND:%[a-zA-Z0-9.]+]] // In C++11, the destructors are often known not to throw. -// CHECK2v11-LABEL: @_ZN5test01AD1Ev = alias {{.*}} @_ZN5test01AD2Ev +// CHECK2v11-LABEL: @_ZN5test01AD1Ev = unnamed_addr alias {{.*}} @_ZN5test01AD2Ev // CHECK2v11-LABEL: define void @_ZN5test01AD2Ev(%"struct.test0::A"* %this) unnamed_addr // CHECK2v11: call void @_ZN5test06MemberD1Ev // CHECK2v11: call void @_ZN5test04BaseD2Ev @@ -153,15 +153,15 @@ namespace test1 { struct M : A { ~M(); }; M::~M() {} - // CHECK3: @_ZN5test11MD2Ev = alias {{.*}} @_ZN5test11AD2Ev + // CHECK3: @_ZN5test11MD2Ev = unnamed_addr alias {{.*}} @_ZN5test11AD2Ev struct N : A, Empty { ~N(); }; N::~N() {} - // CHECK3: @_ZN5test11ND2Ev = alias {{.*}} @_ZN5test11AD2Ev + // CHECK3: @_ZN5test11ND2Ev = unnamed_addr alias {{.*}} @_ZN5test11AD2Ev struct O : Empty, A { ~O(); }; O::~O() {} - // CHECK3: @_ZN5test11OD2Ev = alias {{.*}} @_ZN5test11AD2Ev + // CHECK3: @_ZN5test11OD2Ev = unnamed_addr alias {{.*}} @_ZN5test11AD2Ev struct P : NonEmpty, A { ~P(); }; P::~P() {} // CHECK3-LABEL: define void @_ZN5test11PD2Ev(%"struct.test1::P"* %this) unnamed_addr @@ -174,7 +174,7 @@ namespace test1 { struct S : A { ~S(); int x; }; S::~S() {} - // CHECK4: @_ZN5test11SD2Ev = alias {{.*}}, bitcast {{.*}} @_ZN5test11AD2Ev + // CHECK4: @_ZN5test11SD2Ev = unnamed_addr alias {{.*}}, bitcast {{.*}} @_ZN5test11AD2Ev struct T : A { ~T(); B x; }; T::~T() {} // CHECK4-LABEL: define void @_ZN5test11TD2Ev(%"struct.test1::T"* %this) unnamed_addr diff --git a/test/CodeGenCXX/devirtualize-ms-dtor.cpp b/test/CodeGenCXX/devirtualize-ms-dtor.cpp new file mode 100644 index 0000000000000..d999b0c2dc405 --- /dev/null +++ b/test/CodeGenCXX/devirtualize-ms-dtor.cpp @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -std=c++11 -triple x86_64-windows-msvc %s -emit-llvm -o - | FileCheck %s + +// If we de-virtualize ~Foo, we still need to call ??1Foo, not ??_DFoo. + +struct Base { + virtual ~Base(); +}; +struct Foo final : Base { +}; +void f(Foo *p) { + p->~Foo(); +} + +// CHECK-LABEL: define{{.*}} void @"?f@@YAXPEAUFoo@@@Z"(%struct.Foo* %p) +// CHECK: call void @"??1Foo@@UEAA@XZ" +// CHECK: ret void diff --git a/test/CodeGenCXX/discard-name-values.cpp b/test/CodeGenCXX/discard-name-values.cpp index 49cb7d2fc0587..d4d7527c28561 100644 --- a/test/CodeGenCXX/discard-name-values.cpp +++ b/test/CodeGenCXX/discard-name-values.cpp @@ -1,10 +1,29 @@ -// RUN: %clang_cc1 -emit-llvm -triple=armv7-apple-darwin -emit-llvm -std=c++11 %s -o - -O1 | FileCheck %s -// RUN: %clang_cc1 -emit-llvm -triple=armv7-apple-darwin -emit-llvm -std=c++11 %s -o - -O1 -discard-value-names | FileCheck %s --check-prefix=DISCARDVALUE +// RUN: %clang_cc1 -emit-llvm -triple=armv7-apple-darwin -std=c++11 %s -o - -O1 \ +// RUN: | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -triple=armv7-apple-darwin -std=c++11 %s -o - -O1 \ +// RUN: -discard-value-names | FileCheck %s --check-prefix=DISCARDVALUE -int foo(int bar) { - return bar; -} +extern "C" void branch(); + +bool test(bool pred) { + // DISCARDVALUE: br i1 %0, label %2, label %3 + // CHECK: br i1 %pred, label %if.then, label %if.end + + if (pred) { + // DISCARDVALUE: ; <label>:2: + // DISCARDVALUE-NEXT: tail call void @branch() + // DISCARDVALUE-NEXT: br label %3 -// CHECK: ret i32 %bar -// DISCARDVALUE: ret i32 %0 + // CHECK: if.then: + // CHECK-NEXT: tail call void @branch() + // CHECK-NEXT: br label %if.end + branch(); + } + // DISCARDVALUE: ; <label>:3: + // DISCARDVALUE-NEXT: ret i1 %0 + + // CHECK: if.end: + // CHECK-NEXT: ret i1 %pred + return pred; +} diff --git a/test/CodeGenCXX/dllexport-alias.cpp b/test/CodeGenCXX/dllexport-alias.cpp index a3dc61edde5db..7eec9cf78388c 100644 --- a/test/CodeGenCXX/dllexport-alias.cpp +++ b/test/CodeGenCXX/dllexport-alias.cpp @@ -14,5 +14,5 @@ A::A() {} A::~A() {} -// CHECK: @_ZN1AC1Ev = dllexport alias void (%class.A*), void (%class.A*)* @_ZN1AC2Ev -// CHECK: @_ZN1AD1Ev = dllexport alias void (%class.A*), void (%class.A*)* @_ZN1AD2Ev +// CHECK: @_ZN1AC1Ev = dso_local dllexport unnamed_addr alias void (%class.A*), void (%class.A*)* @_ZN1AC2Ev +// CHECK: @_ZN1AD1Ev = dso_local dllexport unnamed_addr alias void (%class.A*), void (%class.A*)* @_ZN1AD2Ev diff --git a/test/CodeGenCXX/dllexport-ctor-closure.cpp b/test/CodeGenCXX/dllexport-ctor-closure.cpp index 4fae7e10e8b6c..72d674dae7c0c 100644 --- a/test/CodeGenCXX/dllexport-ctor-closure.cpp +++ b/test/CodeGenCXX/dllexport-ctor-closure.cpp @@ -5,11 +5,11 @@ struct CtorWithClosure { __declspec(dllexport) CtorWithClosure(...) {} -// CHECK-LABEL: define weak_odr dllexport x86_thiscallcc void @"\01??_FCtorWithClosure@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat +// CHECK-LABEL: define weak_odr dso_local dllexport x86_thiscallcc void @"??_FCtorWithClosure@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat // CHECK: %[[this_addr:.*]] = alloca %struct.CtorWithClosure*, align 4 // CHECK: store %struct.CtorWithClosure* %this, %struct.CtorWithClosure** %[[this_addr]], align 4 // CHECK: %[[this:.*]] = load %struct.CtorWithClosure*, %struct.CtorWithClosure** %[[this_addr]] -// CHECK: call %struct.CtorWithClosure* (%struct.CtorWithClosure*, ...) @"\01??0CtorWithClosure@@QAA@ZZ"(%struct.CtorWithClosure* %[[this]]) +// CHECK: call %struct.CtorWithClosure* (%struct.CtorWithClosure*, ...) @"??0CtorWithClosure@@QAA@ZZ"(%struct.CtorWithClosure* %[[this]]) // CHECK: ret void }; @@ -17,7 +17,7 @@ struct CtorWithClosureOutOfLine { __declspec(dllexport) CtorWithClosureOutOfLine(...); }; CtorWithClosureOutOfLine::CtorWithClosureOutOfLine(...) {} -// CHECK-LABEL: define weak_odr dllexport x86_thiscallcc void @"\01??_FCtorWithClosureOutOfLine@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat +// CHECK-LABEL: define weak_odr dso_local dllexport x86_thiscallcc void @"??_FCtorWithClosureOutOfLine@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat #define DELETE_IMPLICIT_MEMBERS(ClassName) \ ClassName(ClassName &&) = delete; \ @@ -28,11 +28,11 @@ CtorWithClosureOutOfLine::CtorWithClosureOutOfLine(...) {} struct __declspec(dllexport) ClassWithClosure { DELETE_IMPLICIT_MEMBERS(ClassWithClosure); ClassWithClosure(...) {} -// CHECK-LABEL: define weak_odr dllexport x86_thiscallcc void @"\01??_FClassWithClosure@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat +// CHECK-LABEL: define weak_odr dso_local dllexport x86_thiscallcc void @"??_FClassWithClosure@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat // CHECK: %[[this_addr:.*]] = alloca %struct.ClassWithClosure*, align 4 // CHECK: store %struct.ClassWithClosure* %this, %struct.ClassWithClosure** %[[this_addr]], align 4 // CHECK: %[[this:.*]] = load %struct.ClassWithClosure*, %struct.ClassWithClosure** %[[this_addr]] -// CHECK: call %struct.ClassWithClosure* (%struct.ClassWithClosure*, ...) @"\01??0ClassWithClosure@@QAA@ZZ"(%struct.ClassWithClosure* %[[this]]) +// CHECK: call %struct.ClassWithClosure* (%struct.ClassWithClosure*, ...) @"??0ClassWithClosure@@QAA@ZZ"(%struct.ClassWithClosure* %[[this]]) // CHECK: ret void }; @@ -44,11 +44,11 @@ template struct __declspec(dllexport) TemplateWithClosure<char>; extern template struct TemplateWithClosure<int>; template struct __declspec(dllexport) TemplateWithClosure<int>; -// CHECK-LABEL: define weak_odr dllexport x86_thiscallcc void @"\01??_F?$TemplateWithClosure@D@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat -// CHECK: call {{.*}} @"\01??0?$TemplateWithClosure@D@@QAE@H@Z"({{.*}}, i32 1) +// CHECK-LABEL: define weak_odr dso_local dllexport x86_thiscallcc void @"??_F?$TemplateWithClosure@D@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat +// CHECK: call {{.*}} @"??0?$TemplateWithClosure@D@@QAE@H@Z"({{.*}}, i32 1) -// CHECK-LABEL: define weak_odr dllexport x86_thiscallcc void @"\01??_F?$TemplateWithClosure@H@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat -// CHECK: call {{.*}} @"\01??0?$TemplateWithClosure@H@@QAE@H@Z"({{.*}}, i32 4) +// CHECK-LABEL: define weak_odr dso_local dllexport x86_thiscallcc void @"??_F?$TemplateWithClosure@H@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat +// CHECK: call {{.*}} @"??0?$TemplateWithClosure@H@@QAE@H@Z"({{.*}}, i32 4) struct __declspec(dllexport) NestedOuter { DELETE_IMPLICIT_MEMBERS(NestedOuter); @@ -59,8 +59,8 @@ struct __declspec(dllexport) NestedOuter { }; }; -// CHECK-LABEL: define weak_odr dllexport x86_thiscallcc void @"\01??_FNestedOuter@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat -// CHECK-LABEL: define weak_odr dllexport x86_thiscallcc void @"\01??_FNestedInner@NestedOuter@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat +// CHECK-LABEL: define weak_odr dso_local dllexport x86_thiscallcc void @"??_FNestedOuter@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat +// CHECK-LABEL: define weak_odr dso_local dllexport x86_thiscallcc void @"??_FNestedInner@NestedOuter@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat struct HasDtor { ~HasDtor(); @@ -76,7 +76,7 @@ struct __declspec(dllexport) CtorClosureOutOfLine { }; CtorClosureOutOfLine::CtorClosureOutOfLine(const HasImplicitDtor2 &v) {} -// CHECK-LABEL: define weak_odr dllexport x86_thiscallcc void @"\01??_FCtorClosureInline@@QAEXXZ" -// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @"\01??1HasImplicitDtor1@@QAE@XZ" -// CHECK-LABEL: define weak_odr dllexport x86_thiscallcc void @"\01??_FCtorClosureOutOfLine@@QAEXXZ" -// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @"\01??1HasImplicitDtor2@@QAE@XZ" +// CHECK-LABEL: define weak_odr dso_local dllexport x86_thiscallcc void @"??_FCtorClosureInline@@QAEXXZ" +// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"??1HasImplicitDtor1@@QAE@XZ" +// CHECK-LABEL: define weak_odr dso_local dllexport x86_thiscallcc void @"??_FCtorClosureOutOfLine@@QAEXXZ" +// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"??1HasImplicitDtor2@@QAE@XZ" diff --git a/test/CodeGenCXX/dllexport-dtor-thunks.cpp b/test/CodeGenCXX/dllexport-dtor-thunks.cpp index 52f9901620fab..bda126eba855d 100644 --- a/test/CodeGenCXX/dllexport-dtor-thunks.cpp +++ b/test/CodeGenCXX/dllexport-dtor-thunks.cpp @@ -5,6 +5,6 @@ struct __declspec(dllexport) B { virtual ~B(); }; struct __declspec(dllexport) C : A, B { virtual ~C(); }; C::~C() {} +// CHECK: define dso_local dllexport void @"??1C@@UEAA@XZ" // This thunk should *not* be dllexport. -// CHECK: define linkonce_odr i8* @"\01??_EC@@W7EAAPEAXI@Z" -// CHECK: define dllexport void @"\01??1C@@UEAA@XZ" +// CHECK: define linkonce_odr dso_local i8* @"??_EC@@W7EAAPEAXI@Z" diff --git a/test/CodeGenCXX/dllexport-members.cpp b/test/CodeGenCXX/dllexport-members.cpp index 1c56251328d64..b0275384022ea 100644 --- a/test/CodeGenCXX/dllexport-members.cpp +++ b/test/CodeGenCXX/dllexport-members.cpp @@ -26,101 +26,101 @@ extern "C" void free(void* p); struct ExportMembers { struct Nested; - // M32-DAG: define dllexport x86_thiscallcc void @"\01?normalDef@ExportMembers@@QAEXXZ"(%struct.ExportMembers* %this) - // M64-DAG: define dllexport void @"\01?normalDef@ExportMembers@@QEAAXXZ"(%struct.ExportMembers* %this) - // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?normalInclass@ExportMembers@@QAEXXZ"(%struct.ExportMembers* %this) - // M64-DAG: define weak_odr dllexport void @"\01?normalInclass@ExportMembers@@QEAAXXZ"(%struct.ExportMembers* %this) - // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?normalInlineDef@ExportMembers@@QAEXXZ"(%struct.ExportMembers* %this) - // M64-DAG: define weak_odr dllexport void @"\01?normalInlineDef@ExportMembers@@QEAAXXZ"(%struct.ExportMembers* %this) - // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?normalInlineDecl@ExportMembers@@QAEXXZ"(%struct.ExportMembers* %this) - // M64-DAG: define weak_odr dllexport void @"\01?normalInlineDecl@ExportMembers@@QEAAXXZ"(%struct.ExportMembers* %this) - // G32-DAG: define dllexport x86_thiscallcc void @_ZN13ExportMembers9normalDefEv(%struct.ExportMembers* %this) - // G64-DAG: define dllexport void @_ZN13ExportMembers9normalDefEv(%struct.ExportMembers* %this) - // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers13normalInclassEv(%struct.ExportMembers* %this) - // G64-DAG: define weak_odr dllexport void @_ZN13ExportMembers13normalInclassEv(%struct.ExportMembers* %this) - // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers15normalInlineDefEv(%struct.ExportMembers* %this) - // G64-DAG: define weak_odr dllexport void @_ZN13ExportMembers15normalInlineDefEv(%struct.ExportMembers* %this) - // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers16normalInlineDeclEv(%struct.ExportMembers* %this) - // G64-DAG: define weak_odr dllexport void @_ZN13ExportMembers16normalInlineDeclEv(%struct.ExportMembers* %this) - // M32-DAG: define linkonce_odr x86_thiscallcc void @"\01?referencedNonExportedInClass@ExportMembers@@QAEXXZ" + // M32-DAG: define dso_local dllexport x86_thiscallcc void @"?normalDef@ExportMembers@@QAEXXZ"(%struct.ExportMembers* %this) + // M64-DAG: define dso_local dllexport void @"?normalDef@ExportMembers@@QEAAXXZ"(%struct.ExportMembers* %this) + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?normalInclass@ExportMembers@@QAEXXZ"(%struct.ExportMembers* %this) + // M64-DAG: define weak_odr dso_local dllexport void @"?normalInclass@ExportMembers@@QEAAXXZ"(%struct.ExportMembers* %this) + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?normalInlineDef@ExportMembers@@QAEXXZ"(%struct.ExportMembers* %this) + // M64-DAG: define weak_odr dso_local dllexport void @"?normalInlineDef@ExportMembers@@QEAAXXZ"(%struct.ExportMembers* %this) + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?normalInlineDecl@ExportMembers@@QAEXXZ"(%struct.ExportMembers* %this) + // M64-DAG: define weak_odr dso_local dllexport void @"?normalInlineDecl@ExportMembers@@QEAAXXZ"(%struct.ExportMembers* %this) + // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers9normalDefEv(%struct.ExportMembers* %this) + // G64-DAG: define dso_local dllexport void @_ZN13ExportMembers9normalDefEv(%struct.ExportMembers* %this) + // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers13normalInclassEv(%struct.ExportMembers* %this) + // G64-DAG: define weak_odr dso_local dllexport void @_ZN13ExportMembers13normalInclassEv(%struct.ExportMembers* %this) + // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers15normalInlineDefEv(%struct.ExportMembers* %this) + // G64-DAG: define weak_odr dso_local dllexport void @_ZN13ExportMembers15normalInlineDefEv(%struct.ExportMembers* %this) + // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers16normalInlineDeclEv(%struct.ExportMembers* %this) + // G64-DAG: define weak_odr dso_local dllexport void @_ZN13ExportMembers16normalInlineDeclEv(%struct.ExportMembers* %this) + // M32-DAG: define linkonce_odr dso_local x86_thiscallcc void @"?referencedNonExportedInClass@ExportMembers@@QAEXXZ" __declspec(dllexport) void normalDef(); __declspec(dllexport) void normalInclass() { referencedNonExportedInClass(); } __declspec(dllexport) void normalInlineDef(); __declspec(dllexport) inline void normalInlineDecl(); void referencedNonExportedInClass() {} - // M32-DAG: define dllexport x86_thiscallcc void @"\01?virtualDef@ExportMembers@@UAEXXZ"(%struct.ExportMembers* %this) - // M64-DAG: define dllexport void @"\01?virtualDef@ExportMembers@@UEAAXXZ"(%struct.ExportMembers* %this) - // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?virtualInclass@ExportMembers@@UAEXXZ"(%struct.ExportMembers* %this) - // M64-DAG: define weak_odr dllexport void @"\01?virtualInclass@ExportMembers@@UEAAXXZ"(%struct.ExportMembers* %this) - // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?virtualInlineDef@ExportMembers@@UAEXXZ"(%struct.ExportMembers* %this) - // M64-DAG: define weak_odr dllexport void @"\01?virtualInlineDef@ExportMembers@@UEAAXXZ"(%struct.ExportMembers* %this) - // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?virtualInlineDecl@ExportMembers@@UAEXXZ"(%struct.ExportMembers* %this) - // M64-DAG: define weak_odr dllexport void @"\01?virtualInlineDecl@ExportMembers@@UEAAXXZ"(%struct.ExportMembers* %this) - // G32-DAG: define dllexport x86_thiscallcc void @_ZN13ExportMembers10virtualDefEv(%struct.ExportMembers* %this) - // G64-DAG: define dllexport void @_ZN13ExportMembers10virtualDefEv(%struct.ExportMembers* %this) - // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers14virtualInclassEv(%struct.ExportMembers* %this) - // G64-DAG: define weak_odr dllexport void @_ZN13ExportMembers14virtualInclassEv(%struct.ExportMembers* %this) - // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers16virtualInlineDefEv(%struct.ExportMembers* %this) - // G64-DAG: define weak_odr dllexport void @_ZN13ExportMembers16virtualInlineDefEv(%struct.ExportMembers* %this) - // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers17virtualInlineDeclEv(%struct.ExportMembers* %this) - // G64-DAG: define weak_odr dllexport void @_ZN13ExportMembers17virtualInlineDeclEv(%struct.ExportMembers* %this) + // M32-DAG: define dso_local dllexport x86_thiscallcc void @"?virtualDef@ExportMembers@@UAEXXZ"(%struct.ExportMembers* %this) + // M64-DAG: define dso_local dllexport void @"?virtualDef@ExportMembers@@UEAAXXZ"(%struct.ExportMembers* %this) + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?virtualInclass@ExportMembers@@UAEXXZ"(%struct.ExportMembers* %this) + // M64-DAG: define weak_odr dso_local dllexport void @"?virtualInclass@ExportMembers@@UEAAXXZ"(%struct.ExportMembers* %this) + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?virtualInlineDef@ExportMembers@@UAEXXZ"(%struct.ExportMembers* %this) + // M64-DAG: define weak_odr dso_local dllexport void @"?virtualInlineDef@ExportMembers@@UEAAXXZ"(%struct.ExportMembers* %this) + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?virtualInlineDecl@ExportMembers@@UAEXXZ"(%struct.ExportMembers* %this) + // M64-DAG: define weak_odr dso_local dllexport void @"?virtualInlineDecl@ExportMembers@@UEAAXXZ"(%struct.ExportMembers* %this) + // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers10virtualDefEv(%struct.ExportMembers* %this) + // G64-DAG: define dso_local dllexport void @_ZN13ExportMembers10virtualDefEv(%struct.ExportMembers* %this) + // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers14virtualInclassEv(%struct.ExportMembers* %this) + // G64-DAG: define weak_odr dso_local dllexport void @_ZN13ExportMembers14virtualInclassEv(%struct.ExportMembers* %this) + // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers16virtualInlineDefEv(%struct.ExportMembers* %this) + // G64-DAG: define weak_odr dso_local dllexport void @_ZN13ExportMembers16virtualInlineDefEv(%struct.ExportMembers* %this) + // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers17virtualInlineDeclEv(%struct.ExportMembers* %this) + // G64-DAG: define weak_odr dso_local dllexport void @_ZN13ExportMembers17virtualInlineDeclEv(%struct.ExportMembers* %this) __declspec(dllexport) virtual void virtualDef(); __declspec(dllexport) virtual void virtualInclass() {} __declspec(dllexport) virtual void virtualInlineDef(); __declspec(dllexport) virtual inline void virtualInlineDecl(); - // MSC-DAG: define dllexport void @"\01?staticDef@ExportMembers@@SAXXZ"() - // MSC-DAG: define weak_odr dllexport void @"\01?staticInclass@ExportMembers@@SAXXZ"() - // MSC-DAG: define weak_odr dllexport void @"\01?staticInlineDef@ExportMembers@@SAXXZ"() - // MSC-DAG: define weak_odr dllexport void @"\01?staticInlineDecl@ExportMembers@@SAXXZ"() - // GNU-DAG: define dllexport void @_ZN13ExportMembers9staticDefEv() - // GNU-DAG: define weak_odr dllexport void @_ZN13ExportMembers13staticInclassEv() - // GNU-DAG: define weak_odr dllexport void @_ZN13ExportMembers15staticInlineDefEv() - // GNU-DAG: define weak_odr dllexport void @_ZN13ExportMembers16staticInlineDeclEv() + // MSC-DAG: define dso_local dllexport void @"?staticDef@ExportMembers@@SAXXZ"() + // MSC-DAG: define weak_odr dso_local dllexport void @"?staticInclass@ExportMembers@@SAXXZ"() + // MSC-DAG: define weak_odr dso_local dllexport void @"?staticInlineDef@ExportMembers@@SAXXZ"() + // MSC-DAG: define weak_odr dso_local dllexport void @"?staticInlineDecl@ExportMembers@@SAXXZ"() + // GNU-DAG: define dso_local dllexport void @_ZN13ExportMembers9staticDefEv() + // GNU-DAG: define weak_odr dso_local dllexport void @_ZN13ExportMembers13staticInclassEv() + // GNU-DAG: define weak_odr dso_local dllexport void @_ZN13ExportMembers15staticInlineDefEv() + // GNU-DAG: define weak_odr dso_local dllexport void @_ZN13ExportMembers16staticInlineDeclEv() __declspec(dllexport) static void staticDef(); __declspec(dllexport) static void staticInclass() {} __declspec(dllexport) static void staticInlineDef(); __declspec(dllexport) static inline void staticInlineDecl(); - // M32-DAG: define dllexport x86_thiscallcc void @"\01?protectedDef@ExportMembers@@IAEXXZ"(%struct.ExportMembers* %this) - // M64-DAG: define dllexport void @"\01?protectedDef@ExportMembers@@IEAAXXZ"(%struct.ExportMembers* %this) - // G32-DAG: define dllexport x86_thiscallcc void @_ZN13ExportMembers12protectedDefEv(%struct.ExportMembers* %this) - // G64-DAG: define dllexport void @_ZN13ExportMembers12protectedDefEv(%struct.ExportMembers* %this) - // MSC-DAG: define dllexport void @"\01?protectedStaticDef@ExportMembers@@KAXXZ"() - // GNU-DAG: define dllexport void @_ZN13ExportMembers18protectedStaticDefEv() + // M32-DAG: define dso_local dllexport x86_thiscallcc void @"?protectedDef@ExportMembers@@IAEXXZ"(%struct.ExportMembers* %this) + // M64-DAG: define dso_local dllexport void @"?protectedDef@ExportMembers@@IEAAXXZ"(%struct.ExportMembers* %this) + // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers12protectedDefEv(%struct.ExportMembers* %this) + // G64-DAG: define dso_local dllexport void @_ZN13ExportMembers12protectedDefEv(%struct.ExportMembers* %this) + // MSC-DAG: define dso_local dllexport void @"?protectedStaticDef@ExportMembers@@KAXXZ"() + // GNU-DAG: define dso_local dllexport void @_ZN13ExportMembers18protectedStaticDefEv() protected: __declspec(dllexport) void protectedDef(); __declspec(dllexport) static void protectedStaticDef(); - // M32-DAG: define dllexport x86_thiscallcc void @"\01?privateDef@ExportMembers@@AAEXXZ"(%struct.ExportMembers* %this) - // M64-DAG: define dllexport void @"\01?privateDef@ExportMembers@@AEAAXXZ"(%struct.ExportMembers* %this) - // G32-DAG: define dllexport x86_thiscallcc void @_ZN13ExportMembers10privateDefEv(%struct.ExportMembers* %this) - // G64-DAG: define dllexport void @_ZN13ExportMembers10privateDefEv(%struct.ExportMembers* %this) - // MSC-DAG: define dllexport void @"\01?privateStaticDef@ExportMembers@@CAXXZ"() - // GNU-DAG: define dllexport void @_ZN13ExportMembers16privateStaticDefEv() + // M32-DAG: define dso_local dllexport x86_thiscallcc void @"?privateDef@ExportMembers@@AAEXXZ"(%struct.ExportMembers* %this) + // M64-DAG: define dso_local dllexport void @"?privateDef@ExportMembers@@AEAAXXZ"(%struct.ExportMembers* %this) + // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers10privateDefEv(%struct.ExportMembers* %this) + // G64-DAG: define dso_local dllexport void @_ZN13ExportMembers10privateDefEv(%struct.ExportMembers* %this) + // MSC-DAG: define dso_local dllexport void @"?privateStaticDef@ExportMembers@@CAXXZ"() + // GNU-DAG: define dso_local dllexport void @_ZN13ExportMembers16privateStaticDefEv() private: __declspec(dllexport) void privateDef(); __declspec(dllexport) static void privateStaticDef(); - // M32-DAG: define x86_thiscallcc void @"\01?ignored@ExportMembers@@QAEXXZ"(%struct.ExportMembers* %this) - // M64-DAG: define void @"\01?ignored@ExportMembers@@QEAAXXZ"(%struct.ExportMembers* %this) - // G32-DAG: define x86_thiscallcc void @_ZN13ExportMembers7ignoredEv(%struct.ExportMembers* %this) - // G64-DAG: define void @_ZN13ExportMembers7ignoredEv(%struct.ExportMembers* %this) + // M32-DAG: define dso_local x86_thiscallcc void @"?ignored@ExportMembers@@QAEXXZ"(%struct.ExportMembers* %this) + // M64-DAG: define dso_local void @"?ignored@ExportMembers@@QEAAXXZ"(%struct.ExportMembers* %this) + // G32-DAG: define dso_local x86_thiscallcc void @_ZN13ExportMembers7ignoredEv(%struct.ExportMembers* %this) + // G64-DAG: define dso_local void @_ZN13ExportMembers7ignoredEv(%struct.ExportMembers* %this) public: void ignored(); - // MSC-DAG: @"\01?StaticField@ExportMembers@@2HA" = dllexport global i32 1, align 4 - // MSC-DAG: @"\01?StaticConstField@ExportMembers@@2HB" = dllexport constant i32 1, align 4 - // MSC-DAG: @"\01?StaticConstFieldEqualInit@ExportMembers@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4 - // MSC-DAG: @"\01?StaticConstFieldBraceInit@ExportMembers@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4 - // MSC-DAG: @"\01?StaticConstFieldRefNotDef@ExportMembers@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4 - // MSC-DAG: @"\01?ConstexprField@ExportMembers@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4 - // GNU-DAG: @_ZN13ExportMembers11StaticFieldE = dllexport global i32 1, align 4 - // GNU-DAG: @_ZN13ExportMembers16StaticConstFieldE = dllexport constant i32 1, align 4 - // GNU-DAG: @_ZN13ExportMembers25StaticConstFieldEqualInitE = dllexport constant i32 1, align 4 - // GNU-DAG: @_ZN13ExportMembers25StaticConstFieldBraceInitE = dllexport constant i32 1, align 4 - // GNU-DAG: @_ZN13ExportMembers14ConstexprFieldE = dllexport constant i32 1, align 4 + // MSC-DAG: @"?StaticField@ExportMembers@@2HA" = dso_local dllexport global i32 1, align 4 + // MSC-DAG: @"?StaticConstField@ExportMembers@@2HB" = dso_local dllexport constant i32 1, align 4 + // MSC-DAG: @"?StaticConstFieldEqualInit@ExportMembers@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4 + // MSC-DAG: @"?StaticConstFieldBraceInit@ExportMembers@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4 + // MSC-DAG: @"?StaticConstFieldRefNotDef@ExportMembers@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4 + // MSC-DAG: @"?ConstexprField@ExportMembers@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4 + // GNU-DAG: @_ZN13ExportMembers11StaticFieldE = dso_local dllexport global i32 1, align 4 + // GNU-DAG: @_ZN13ExportMembers16StaticConstFieldE = dso_local dllexport constant i32 1, align 4 + // GNU-DAG: @_ZN13ExportMembers25StaticConstFieldEqualInitE = dso_local dllexport constant i32 1, align 4 + // GNU-DAG: @_ZN13ExportMembers25StaticConstFieldBraceInitE = dso_local dllexport constant i32 1, align 4 + // GNU-DAG: @_ZN13ExportMembers14ConstexprFieldE = dso_local dllexport constant i32 1, align 4 __declspec(dllexport) static int StaticField; __declspec(dllexport) static const int StaticConstField; __declspec(dllexport) static const int StaticConstFieldEqualInit = 1; @@ -154,99 +154,99 @@ constexpr int ExportMembers::ConstexprField; // Export individual members of a nested class. struct ExportMembers::Nested { - // M32-DAG: define dllexport x86_thiscallcc void @"\01?normalDef@Nested@ExportMembers@@QAEXXZ"(%"struct.ExportMembers::Nested"* %this) - // M64-DAG: define dllexport void @"\01?normalDef@Nested@ExportMembers@@QEAAXXZ"(%"struct.ExportMembers::Nested"* %this) - // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?normalInclass@Nested@ExportMembers@@QAEXXZ"(%"struct.ExportMembers::Nested"* %this) - // M64-DAG: define weak_odr dllexport void @"\01?normalInclass@Nested@ExportMembers@@QEAAXXZ"(%"struct.ExportMembers::Nested"* %this) - // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?normalInlineDef@Nested@ExportMembers@@QAEXXZ"(%"struct.ExportMembers::Nested"* %this) - // M64-DAG: define weak_odr dllexport void @"\01?normalInlineDef@Nested@ExportMembers@@QEAAXXZ"(%"struct.ExportMembers::Nested"* %this) - // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?normalInlineDecl@Nested@ExportMembers@@QAEXXZ"(%"struct.ExportMembers::Nested"* %this) - // M64-DAG: define weak_odr dllexport void @"\01?normalInlineDecl@Nested@ExportMembers@@QEAAXXZ"(%"struct.ExportMembers::Nested"* %this) - // G32-DAG: define dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested9normalDefEv(%"struct.ExportMembers::Nested"* %this) - // G64-DAG: define dllexport void @_ZN13ExportMembers6Nested9normalDefEv(%"struct.ExportMembers::Nested"* %this) - // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested13normalInclassEv(%"struct.ExportMembers::Nested"* %this) - // G64-DAG: define weak_odr dllexport void @_ZN13ExportMembers6Nested13normalInclassEv(%"struct.ExportMembers::Nested"* %this) - // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested15normalInlineDefEv(%"struct.ExportMembers::Nested"* %this) - // G64-DAG: define weak_odr dllexport void @_ZN13ExportMembers6Nested15normalInlineDefEv(%"struct.ExportMembers::Nested"* %this) - // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested16normalInlineDeclEv(%"struct.ExportMembers::Nested"* %this) - // G64-DAG: define weak_odr dllexport void @_ZN13ExportMembers6Nested16normalInlineDeclEv(%"struct.ExportMembers::Nested"* %this) + // M32-DAG: define dso_local dllexport x86_thiscallcc void @"?normalDef@Nested@ExportMembers@@QAEXXZ"(%"struct.ExportMembers::Nested"* %this) + // M64-DAG: define dso_local dllexport void @"?normalDef@Nested@ExportMembers@@QEAAXXZ"(%"struct.ExportMembers::Nested"* %this) + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?normalInclass@Nested@ExportMembers@@QAEXXZ"(%"struct.ExportMembers::Nested"* %this) + // M64-DAG: define weak_odr dso_local dllexport void @"?normalInclass@Nested@ExportMembers@@QEAAXXZ"(%"struct.ExportMembers::Nested"* %this) + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?normalInlineDef@Nested@ExportMembers@@QAEXXZ"(%"struct.ExportMembers::Nested"* %this) + // M64-DAG: define weak_odr dso_local dllexport void @"?normalInlineDef@Nested@ExportMembers@@QEAAXXZ"(%"struct.ExportMembers::Nested"* %this) + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?normalInlineDecl@Nested@ExportMembers@@QAEXXZ"(%"struct.ExportMembers::Nested"* %this) + // M64-DAG: define weak_odr dso_local dllexport void @"?normalInlineDecl@Nested@ExportMembers@@QEAAXXZ"(%"struct.ExportMembers::Nested"* %this) + // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested9normalDefEv(%"struct.ExportMembers::Nested"* %this) + // G64-DAG: define dso_local dllexport void @_ZN13ExportMembers6Nested9normalDefEv(%"struct.ExportMembers::Nested"* %this) + // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested13normalInclassEv(%"struct.ExportMembers::Nested"* %this) + // G64-DAG: define weak_odr dso_local dllexport void @_ZN13ExportMembers6Nested13normalInclassEv(%"struct.ExportMembers::Nested"* %this) + // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested15normalInlineDefEv(%"struct.ExportMembers::Nested"* %this) + // G64-DAG: define weak_odr dso_local dllexport void @_ZN13ExportMembers6Nested15normalInlineDefEv(%"struct.ExportMembers::Nested"* %this) + // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested16normalInlineDeclEv(%"struct.ExportMembers::Nested"* %this) + // G64-DAG: define weak_odr dso_local dllexport void @_ZN13ExportMembers6Nested16normalInlineDeclEv(%"struct.ExportMembers::Nested"* %this) __declspec(dllexport) void normalDef(); __declspec(dllexport) void normalInclass() {} __declspec(dllexport) void normalInlineDef(); __declspec(dllexport) inline void normalInlineDecl(); - // M32-DAG: define dllexport x86_thiscallcc void @"\01?virtualDef@Nested@ExportMembers@@UAEXXZ"(%"struct.ExportMembers::Nested"* %this) - // M64-DAG: define dllexport void @"\01?virtualDef@Nested@ExportMembers@@UEAAXXZ"(%"struct.ExportMembers::Nested"* %this) - // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?virtualInclass@Nested@ExportMembers@@UAEXXZ"(%"struct.ExportMembers::Nested"* %this) - // M64-DAG: define weak_odr dllexport void @"\01?virtualInclass@Nested@ExportMembers@@UEAAXXZ"(%"struct.ExportMembers::Nested"* %this) - // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?virtualInlineDef@Nested@ExportMembers@@UAEXXZ"(%"struct.ExportMembers::Nested"* %this) - // M64-DAG: define weak_odr dllexport void @"\01?virtualInlineDef@Nested@ExportMembers@@UEAAXXZ"(%"struct.ExportMembers::Nested"* %this) - // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?virtualInlineDecl@Nested@ExportMembers@@UAEXXZ"(%"struct.ExportMembers::Nested"* %this) - // M64-DAG: define weak_odr dllexport void @"\01?virtualInlineDecl@Nested@ExportMembers@@UEAAXXZ"(%"struct.ExportMembers::Nested"* %this) - // G32-DAG: define dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested10virtualDefEv(%"struct.ExportMembers::Nested"* %this) - // G64-DAG: define dllexport void @_ZN13ExportMembers6Nested10virtualDefEv(%"struct.ExportMembers::Nested"* %this) - // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested14virtualInclassEv(%"struct.ExportMembers::Nested"* %this) - // G64-DAG: define weak_odr dllexport void @_ZN13ExportMembers6Nested14virtualInclassEv(%"struct.ExportMembers::Nested"* %this) - // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested16virtualInlineDefEv(%"struct.ExportMembers::Nested"* %this) - // G64-DAG: define weak_odr dllexport void @_ZN13ExportMembers6Nested16virtualInlineDefEv(%"struct.ExportMembers::Nested"* %this) - // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested17virtualInlineDeclEv(%"struct.ExportMembers::Nested"* %this) - // G64-DAG: define weak_odr dllexport void @_ZN13ExportMembers6Nested17virtualInlineDeclEv(%"struct.ExportMembers::Nested"* %this) + // M32-DAG: define dso_local dllexport x86_thiscallcc void @"?virtualDef@Nested@ExportMembers@@UAEXXZ"(%"struct.ExportMembers::Nested"* %this) + // M64-DAG: define dso_local dllexport void @"?virtualDef@Nested@ExportMembers@@UEAAXXZ"(%"struct.ExportMembers::Nested"* %this) + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?virtualInclass@Nested@ExportMembers@@UAEXXZ"(%"struct.ExportMembers::Nested"* %this) + // M64-DAG: define weak_odr dso_local dllexport void @"?virtualInclass@Nested@ExportMembers@@UEAAXXZ"(%"struct.ExportMembers::Nested"* %this) + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?virtualInlineDef@Nested@ExportMembers@@UAEXXZ"(%"struct.ExportMembers::Nested"* %this) + // M64-DAG: define weak_odr dso_local dllexport void @"?virtualInlineDef@Nested@ExportMembers@@UEAAXXZ"(%"struct.ExportMembers::Nested"* %this) + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?virtualInlineDecl@Nested@ExportMembers@@UAEXXZ"(%"struct.ExportMembers::Nested"* %this) + // M64-DAG: define weak_odr dso_local dllexport void @"?virtualInlineDecl@Nested@ExportMembers@@UEAAXXZ"(%"struct.ExportMembers::Nested"* %this) + // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested10virtualDefEv(%"struct.ExportMembers::Nested"* %this) + // G64-DAG: define dso_local dllexport void @_ZN13ExportMembers6Nested10virtualDefEv(%"struct.ExportMembers::Nested"* %this) + // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested14virtualInclassEv(%"struct.ExportMembers::Nested"* %this) + // G64-DAG: define weak_odr dso_local dllexport void @_ZN13ExportMembers6Nested14virtualInclassEv(%"struct.ExportMembers::Nested"* %this) + // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested16virtualInlineDefEv(%"struct.ExportMembers::Nested"* %this) + // G64-DAG: define weak_odr dso_local dllexport void @_ZN13ExportMembers6Nested16virtualInlineDefEv(%"struct.ExportMembers::Nested"* %this) + // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested17virtualInlineDeclEv(%"struct.ExportMembers::Nested"* %this) + // G64-DAG: define weak_odr dso_local dllexport void @_ZN13ExportMembers6Nested17virtualInlineDeclEv(%"struct.ExportMembers::Nested"* %this) __declspec(dllexport) virtual void virtualDef(); __declspec(dllexport) virtual void virtualInclass() {} __declspec(dllexport) virtual void virtualInlineDef(); __declspec(dllexport) virtual inline void virtualInlineDecl(); - // MSC-DAG: define dllexport void @"\01?staticDef@Nested@ExportMembers@@SAXXZ"() - // MSC-DAG: define weak_odr dllexport void @"\01?staticInclass@Nested@ExportMembers@@SAXXZ"() - // MSC-DAG: define weak_odr dllexport void @"\01?staticInlineDef@Nested@ExportMembers@@SAXXZ"() - // MSC-DAG: define weak_odr dllexport void @"\01?staticInlineDecl@Nested@ExportMembers@@SAXXZ"() - // GNU-DAG: define dllexport void @_ZN13ExportMembers6Nested9staticDefEv() - // GNU-DAG: define weak_odr dllexport void @_ZN13ExportMembers6Nested13staticInclassEv() - // GNU-DAG: define weak_odr dllexport void @_ZN13ExportMembers6Nested15staticInlineDefEv() - // GNU-DAG: define weak_odr dllexport void @_ZN13ExportMembers6Nested16staticInlineDeclEv() + // MSC-DAG: define dso_local dllexport void @"?staticDef@Nested@ExportMembers@@SAXXZ"() + // MSC-DAG: define weak_odr dso_local dllexport void @"?staticInclass@Nested@ExportMembers@@SAXXZ"() + // MSC-DAG: define weak_odr dso_local dllexport void @"?staticInlineDef@Nested@ExportMembers@@SAXXZ"() + // MSC-DAG: define weak_odr dso_local dllexport void @"?staticInlineDecl@Nested@ExportMembers@@SAXXZ"() + // GNU-DAG: define dso_local dllexport void @_ZN13ExportMembers6Nested9staticDefEv() + // GNU-DAG: define weak_odr dso_local dllexport void @_ZN13ExportMembers6Nested13staticInclassEv() + // GNU-DAG: define weak_odr dso_local dllexport void @_ZN13ExportMembers6Nested15staticInlineDefEv() + // GNU-DAG: define weak_odr dso_local dllexport void @_ZN13ExportMembers6Nested16staticInlineDeclEv() __declspec(dllexport) static void staticDef(); __declspec(dllexport) static void staticInclass() {} __declspec(dllexport) static void staticInlineDef(); __declspec(dllexport) static inline void staticInlineDecl(); - // M32-DAG: define dllexport x86_thiscallcc void @"\01?protectedDef@Nested@ExportMembers@@IAEXXZ"(%"struct.ExportMembers::Nested"* %this) - // M64-DAG: define dllexport void @"\01?protectedDef@Nested@ExportMembers@@IEAAXXZ"(%"struct.ExportMembers::Nested"* %this) - // G32-DAG: define dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested12protectedDefEv(%"struct.ExportMembers::Nested"* %this) - // G64-DAG: define dllexport void @_ZN13ExportMembers6Nested12protectedDefEv(%"struct.ExportMembers::Nested"* %this) - // MSC-DAG: define dllexport void @"\01?protectedStaticDef@Nested@ExportMembers@@KAXXZ"() - // GNU-DAG: define dllexport void @_ZN13ExportMembers6Nested18protectedStaticDefEv() + // M32-DAG: define dso_local dllexport x86_thiscallcc void @"?protectedDef@Nested@ExportMembers@@IAEXXZ"(%"struct.ExportMembers::Nested"* %this) + // M64-DAG: define dso_local dllexport void @"?protectedDef@Nested@ExportMembers@@IEAAXXZ"(%"struct.ExportMembers::Nested"* %this) + // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested12protectedDefEv(%"struct.ExportMembers::Nested"* %this) + // G64-DAG: define dso_local dllexport void @_ZN13ExportMembers6Nested12protectedDefEv(%"struct.ExportMembers::Nested"* %this) + // MSC-DAG: define dso_local dllexport void @"?protectedStaticDef@Nested@ExportMembers@@KAXXZ"() + // GNU-DAG: define dso_local dllexport void @_ZN13ExportMembers6Nested18protectedStaticDefEv() protected: __declspec(dllexport) void protectedDef(); __declspec(dllexport) static void protectedStaticDef(); - // M32-DAG: define dllexport x86_thiscallcc void @"\01?privateDef@Nested@ExportMembers@@AAEXXZ"(%"struct.ExportMembers::Nested"* %this) - // M64-DAG: define dllexport void @"\01?privateDef@Nested@ExportMembers@@AEAAXXZ"(%"struct.ExportMembers::Nested"* %this) - // G32-DAG: define dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested10privateDefEv(%"struct.ExportMembers::Nested"* %this) - // G64-DAG: define dllexport void @_ZN13ExportMembers6Nested10privateDefEv(%"struct.ExportMembers::Nested"* %this) - // MSC-DAG: define dllexport void @"\01?privateStaticDef@Nested@ExportMembers@@CAXXZ"() - // GNU-DAG: define dllexport void @_ZN13ExportMembers6Nested16privateStaticDefEv() + // M32-DAG: define dso_local dllexport x86_thiscallcc void @"?privateDef@Nested@ExportMembers@@AAEXXZ"(%"struct.ExportMembers::Nested"* %this) + // M64-DAG: define dso_local dllexport void @"?privateDef@Nested@ExportMembers@@AEAAXXZ"(%"struct.ExportMembers::Nested"* %this) + // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested10privateDefEv(%"struct.ExportMembers::Nested"* %this) + // G64-DAG: define dso_local dllexport void @_ZN13ExportMembers6Nested10privateDefEv(%"struct.ExportMembers::Nested"* %this) + // MSC-DAG: define dso_local dllexport void @"?privateStaticDef@Nested@ExportMembers@@CAXXZ"() + // GNU-DAG: define dso_local dllexport void @_ZN13ExportMembers6Nested16privateStaticDefEv() private: __declspec(dllexport) void privateDef(); __declspec(dllexport) static void privateStaticDef(); - // M32-DAG: define x86_thiscallcc void @"\01?ignored@Nested@ExportMembers@@QAEXXZ"(%"struct.ExportMembers::Nested"* %this) - // M64-DAG: define void @"\01?ignored@Nested@ExportMembers@@QEAAXXZ"(%"struct.ExportMembers::Nested"* %this) - // G32-DAG: define x86_thiscallcc void @_ZN13ExportMembers6Nested7ignoredEv(%"struct.ExportMembers::Nested"* %this) - // G64-DAG: define void @_ZN13ExportMembers6Nested7ignoredEv(%"struct.ExportMembers::Nested"* %this) + // M32-DAG: define dso_local x86_thiscallcc void @"?ignored@Nested@ExportMembers@@QAEXXZ"(%"struct.ExportMembers::Nested"* %this) + // M64-DAG: define dso_local void @"?ignored@Nested@ExportMembers@@QEAAXXZ"(%"struct.ExportMembers::Nested"* %this) + // G32-DAG: define dso_local x86_thiscallcc void @_ZN13ExportMembers6Nested7ignoredEv(%"struct.ExportMembers::Nested"* %this) + // G64-DAG: define dso_local void @_ZN13ExportMembers6Nested7ignoredEv(%"struct.ExportMembers::Nested"* %this) public: void ignored(); - // MSC-DAG: @"\01?StaticField@Nested@ExportMembers@@2HA" = dllexport global i32 1, align 4 - // MSC-DAG: @"\01?StaticConstField@Nested@ExportMembers@@2HB" = dllexport constant i32 1, align 4 - // MSC-DAG: @"\01?StaticConstFieldEqualInit@Nested@ExportMembers@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4 - // MSC-DAG: @"\01?StaticConstFieldBraceInit@Nested@ExportMembers@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4 - // MSC-DAG: @"\01?StaticConstFieldRefNotDef@Nested@ExportMembers@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4 - // MSC-DAG: @"\01?ConstexprField@Nested@ExportMembers@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4 - // GNU-DAG: @_ZN13ExportMembers6Nested11StaticFieldE = dllexport global i32 1, align 4 - // GNU-DAG: @_ZN13ExportMembers6Nested16StaticConstFieldE = dllexport constant i32 1, align 4 - // GNU-DAG: @_ZN13ExportMembers6Nested25StaticConstFieldEqualInitE = dllexport constant i32 1, align 4 - // GNU-DAG: @_ZN13ExportMembers6Nested25StaticConstFieldBraceInitE = dllexport constant i32 1, align 4 - // GNU-DAG: @_ZN13ExportMembers6Nested14ConstexprFieldE = dllexport constant i32 1, align 4 + // MSC-DAG: @"?StaticField@Nested@ExportMembers@@2HA" = dso_local dllexport global i32 1, align 4 + // MSC-DAG: @"?StaticConstField@Nested@ExportMembers@@2HB" = dso_local dllexport constant i32 1, align 4 + // MSC-DAG: @"?StaticConstFieldEqualInit@Nested@ExportMembers@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4 + // MSC-DAG: @"?StaticConstFieldBraceInit@Nested@ExportMembers@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4 + // MSC-DAG: @"?StaticConstFieldRefNotDef@Nested@ExportMembers@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4 + // MSC-DAG: @"?ConstexprField@Nested@ExportMembers@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4 + // GNU-DAG: @_ZN13ExportMembers6Nested11StaticFieldE = dso_local dllexport global i32 1, align 4 + // GNU-DAG: @_ZN13ExportMembers6Nested16StaticConstFieldE = dso_local dllexport constant i32 1, align 4 + // GNU-DAG: @_ZN13ExportMembers6Nested25StaticConstFieldEqualInitE = dso_local dllexport constant i32 1, align 4 + // GNU-DAG: @_ZN13ExportMembers6Nested25StaticConstFieldBraceInitE = dso_local dllexport constant i32 1, align 4 + // GNU-DAG: @_ZN13ExportMembers6Nested14ConstexprFieldE = dso_local dllexport constant i32 1, align 4 __declspec(dllexport) static int StaticField; __declspec(dllexport) static const int StaticConstField; __declspec(dllexport) static const int StaticConstFieldEqualInit = 1; @@ -280,48 +280,48 @@ constexpr int ExportMembers::Nested::ConstexprField; // Export special member functions. struct ExportSpecials { - // M32-DAG: define dllexport x86_thiscallcc %struct.ExportSpecials* @"\01??0ExportSpecials@@QAE@XZ"(%struct.ExportSpecials* returned %this) - // M64-DAG: define dllexport %struct.ExportSpecials* @"\01??0ExportSpecials@@QEAA@XZ"(%struct.ExportSpecials* returned %this) - // G32-DAG: define dllexport x86_thiscallcc void @_ZN14ExportSpecialsC1Ev(%struct.ExportSpecials* %this) - // G64-DAG: define dllexport void @_ZN14ExportSpecialsC1Ev(%struct.ExportSpecials* %this) - // G32-DAG: define dllexport x86_thiscallcc void @_ZN14ExportSpecialsC2Ev(%struct.ExportSpecials* %this) - // G64-DAG: define dllexport void @_ZN14ExportSpecialsC2Ev(%struct.ExportSpecials* %this) + // M32-DAG: define dso_local dllexport x86_thiscallcc %struct.ExportSpecials* @"??0ExportSpecials@@QAE@XZ"(%struct.ExportSpecials* returned %this) + // M64-DAG: define dso_local dllexport %struct.ExportSpecials* @"??0ExportSpecials@@QEAA@XZ"(%struct.ExportSpecials* returned %this) + // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsC1Ev(%struct.ExportSpecials* %this) + // G64-DAG: define dso_local dllexport void @_ZN14ExportSpecialsC1Ev(%struct.ExportSpecials* %this) + // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsC2Ev(%struct.ExportSpecials* %this) + // G64-DAG: define dso_local dllexport void @_ZN14ExportSpecialsC2Ev(%struct.ExportSpecials* %this) __declspec(dllexport) ExportSpecials(); - // M32-DAG: define dllexport x86_thiscallcc void @"\01??1ExportSpecials@@QAE@XZ"(%struct.ExportSpecials* %this) - // M64-DAG: define dllexport void @"\01??1ExportSpecials@@QEAA@XZ"(%struct.ExportSpecials* %this) - // G32-DAG: define dllexport x86_thiscallcc void @_ZN14ExportSpecialsD1Ev(%struct.ExportSpecials* %this) - // G64-DAG: define dllexport void @_ZN14ExportSpecialsD1Ev(%struct.ExportSpecials* %this) - // G32-DAG: define dllexport x86_thiscallcc void @_ZN14ExportSpecialsD2Ev(%struct.ExportSpecials* %this) - // G64-DAG: define dllexport void @_ZN14ExportSpecialsD2Ev(%struct.ExportSpecials* %this) + // M32-DAG: define dso_local dllexport x86_thiscallcc void @"??1ExportSpecials@@QAE@XZ"(%struct.ExportSpecials* %this) + // M64-DAG: define dso_local dllexport void @"??1ExportSpecials@@QEAA@XZ"(%struct.ExportSpecials* %this) + // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsD1Ev(%struct.ExportSpecials* %this) + // G64-DAG: define dso_local dllexport void @_ZN14ExportSpecialsD1Ev(%struct.ExportSpecials* %this) + // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsD2Ev(%struct.ExportSpecials* %this) + // G64-DAG: define dso_local dllexport void @_ZN14ExportSpecialsD2Ev(%struct.ExportSpecials* %this) __declspec(dllexport) ~ExportSpecials(); - // M32-DAG: define dllexport x86_thiscallcc %struct.ExportSpecials* @"\01??0ExportSpecials@@QAE@ABU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) - // M64-DAG: define dllexport %struct.ExportSpecials* @"\01??0ExportSpecials@@QEAA@AEBU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) - // G32-DAG: define dllexport x86_thiscallcc void @_ZN14ExportSpecialsC1ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) - // G64-DAG: define dllexport void @_ZN14ExportSpecialsC1ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) - // G32-DAG: define dllexport x86_thiscallcc void @_ZN14ExportSpecialsC2ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) - // G64-DAG: define dllexport void @_ZN14ExportSpecialsC2ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) + // M32-DAG: define dso_local dllexport x86_thiscallcc %struct.ExportSpecials* @"??0ExportSpecials@@QAE@ABU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) + // M64-DAG: define dso_local dllexport %struct.ExportSpecials* @"??0ExportSpecials@@QEAA@AEBU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) + // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsC1ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) + // G64-DAG: define dso_local dllexport void @_ZN14ExportSpecialsC1ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) + // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsC2ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) + // G64-DAG: define dso_local dllexport void @_ZN14ExportSpecialsC2ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) __declspec(dllexport) ExportSpecials(const ExportSpecials&); - // M32-DAG: define dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"\01??4ExportSpecials@@QAEAAU0@ABU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) - // M64-DAG: define dllexport dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"\01??4ExportSpecials@@QEAAAEAU0@AEBU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) - // G32-DAG: define dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) - // G64-DAG: define dllexport dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) + // M32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"??4ExportSpecials@@QAEAAU0@ABU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) + // M64-DAG: define dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"??4ExportSpecials@@QEAAAEAU0@AEBU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) + // G32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) + // G64-DAG: define dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) __declspec(dllexport) ExportSpecials& operator=(const ExportSpecials&); - // M32-DAG: define dllexport x86_thiscallcc %struct.ExportSpecials* @"\01??0ExportSpecials@@QAE@$$QAU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) - // M64-DAG: define dllexport %struct.ExportSpecials* @"\01??0ExportSpecials@@QEAA@$$QEAU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) - // G32-DAG: define dllexport x86_thiscallcc void @_ZN14ExportSpecialsC1EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) - // G64-DAG: define dllexport void @_ZN14ExportSpecialsC1EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) - // G32-DAG: define dllexport x86_thiscallcc void @_ZN14ExportSpecialsC2EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) - // G64-DAG: define dllexport void @_ZN14ExportSpecialsC2EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) + // M32-DAG: define dso_local dllexport x86_thiscallcc %struct.ExportSpecials* @"??0ExportSpecials@@QAE@$$QAU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) + // M64-DAG: define dso_local dllexport %struct.ExportSpecials* @"??0ExportSpecials@@QEAA@$$QEAU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) + // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsC1EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) + // G64-DAG: define dso_local dllexport void @_ZN14ExportSpecialsC1EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) + // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsC2EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) + // G64-DAG: define dso_local dllexport void @_ZN14ExportSpecialsC2EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) __declspec(dllexport) ExportSpecials(ExportSpecials&&); - // M32-DAG: define dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"\01??4ExportSpecials@@QAEAAU0@$$QAU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) - // M64-DAG: define dllexport dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"\01??4ExportSpecials@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) - // G32-DAG: define dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSEOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) - // G64-DAG: define dllexport dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSEOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) + // M32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"??4ExportSpecials@@QAEAAU0@$$QAU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) + // M64-DAG: define dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"??4ExportSpecials@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) + // G32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSEOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) + // G64-DAG: define dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSEOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}})) __declspec(dllexport) ExportSpecials& operator=(ExportSpecials&&); }; ExportSpecials::ExportSpecials() {} @@ -334,40 +334,40 @@ ExportSpecials& ExportSpecials::operator=(ExportSpecials&&) { return *this; } // Export class with inline special member functions. struct ExportInlineSpecials { - // M32-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExportInlineSpecials* @"\01??0ExportInlineSpecials@@QAE@XZ"(%struct.ExportInlineSpecials* returned %this) - // M64-DAG: define weak_odr dllexport %struct.ExportInlineSpecials* @"\01??0ExportInlineSpecials@@QEAA@XZ"( - // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN20ExportInlineSpecialsC1Ev( - // G64-DAG: define weak_odr dllexport void @_ZN20ExportInlineSpecialsC1Ev( + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportInlineSpecials* @"??0ExportInlineSpecials@@QAE@XZ"(%struct.ExportInlineSpecials* returned %this) + // M64-DAG: define weak_odr dso_local dllexport %struct.ExportInlineSpecials* @"??0ExportInlineSpecials@@QEAA@XZ"( + // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN20ExportInlineSpecialsC1Ev( + // G64-DAG: define weak_odr dso_local dllexport void @_ZN20ExportInlineSpecialsC1Ev( __declspec(dllexport) ExportInlineSpecials() {} - // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??1ExportInlineSpecials@@QAE@XZ"( - // M64-DAG: define weak_odr dllexport void @"\01??1ExportInlineSpecials@@QEAA@XZ"( - // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN20ExportInlineSpecialsD1Ev( - // G64-DAG: define weak_odr dllexport void @_ZN20ExportInlineSpecialsD1Ev( + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"??1ExportInlineSpecials@@QAE@XZ"( + // M64-DAG: define weak_odr dso_local dllexport void @"??1ExportInlineSpecials@@QEAA@XZ"( + // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN20ExportInlineSpecialsD1Ev( + // G64-DAG: define weak_odr dso_local dllexport void @_ZN20ExportInlineSpecialsD1Ev( __declspec(dllexport) ~ExportInlineSpecials() {} - // M32-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExportInlineSpecials* @"\01??0ExportInlineSpecials@@QAE@ABU0@@Z"( - // M64-DAG: define weak_odr dllexport %struct.ExportInlineSpecials* @"\01??0ExportInlineSpecials@@QEAA@AEBU0@@Z"( - // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN20ExportInlineSpecialsC1ERKS_( - // G64-DAG: define weak_odr dllexport void @_ZN20ExportInlineSpecialsC1ERKS_( + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportInlineSpecials* @"??0ExportInlineSpecials@@QAE@ABU0@@Z"( + // M64-DAG: define weak_odr dso_local dllexport %struct.ExportInlineSpecials* @"??0ExportInlineSpecials@@QEAA@AEBU0@@Z"( + // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN20ExportInlineSpecialsC1ERKS_( + // G64-DAG: define weak_odr dso_local dllexport void @_ZN20ExportInlineSpecialsC1ERKS_( __declspec(dllexport) inline ExportInlineSpecials(const ExportInlineSpecials&); - // M32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @"\01??4ExportInlineSpecials@@QAEAAU0@ABU0@@Z"( - // M64-DAG: define weak_odr dllexport dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @"\01??4ExportInlineSpecials@@QEAAAEAU0@AEBU0@@Z"( - // G32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @_ZN20ExportInlineSpecialsaSERKS_( - // G64-DAG: define weak_odr dllexport dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @_ZN20ExportInlineSpecialsaSERKS_( + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @"??4ExportInlineSpecials@@QAEAAU0@ABU0@@Z"( + // M64-DAG: define weak_odr dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @"??4ExportInlineSpecials@@QEAAAEAU0@AEBU0@@Z"( + // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @_ZN20ExportInlineSpecialsaSERKS_( + // G64-DAG: define weak_odr dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @_ZN20ExportInlineSpecialsaSERKS_( __declspec(dllexport) ExportInlineSpecials& operator=(const ExportInlineSpecials&); - // M32-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExportInlineSpecials* @"\01??0ExportInlineSpecials@@QAE@$$QAU0@@Z"( - // M64-DAG: define weak_odr dllexport %struct.ExportInlineSpecials* @"\01??0ExportInlineSpecials@@QEAA@$$QEAU0@@Z"( - // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN20ExportInlineSpecialsC1EOS_( - // G64-DAG: define weak_odr dllexport void @_ZN20ExportInlineSpecialsC1EOS_( + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportInlineSpecials* @"??0ExportInlineSpecials@@QAE@$$QAU0@@Z"( + // M64-DAG: define weak_odr dso_local dllexport %struct.ExportInlineSpecials* @"??0ExportInlineSpecials@@QEAA@$$QEAU0@@Z"( + // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN20ExportInlineSpecialsC1EOS_( + // G64-DAG: define weak_odr dso_local dllexport void @_ZN20ExportInlineSpecialsC1EOS_( __declspec(dllexport) ExportInlineSpecials(ExportInlineSpecials&&) {} - // M32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @"\01??4ExportInlineSpecials@@QAEAAU0@$$QAU0@@Z"( - // M64-DAG: define weak_odr dllexport dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @"\01??4ExportInlineSpecials@@QEAAAEAU0@$$QEAU0@@Z"( - // G32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @_ZN20ExportInlineSpecialsaSEOS_( - // G64-DAG: define weak_odr dllexport dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @_ZN20ExportInlineSpecialsaSEOS_( + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @"??4ExportInlineSpecials@@QAEAAU0@$$QAU0@@Z"( + // M64-DAG: define weak_odr dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @"??4ExportInlineSpecials@@QEAAAEAU0@$$QEAU0@@Z"( + // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @_ZN20ExportInlineSpecialsaSEOS_( + // G64-DAG: define weak_odr dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @_ZN20ExportInlineSpecialsaSEOS_( __declspec(dllexport) ExportInlineSpecials& operator=(ExportInlineSpecials&&) { return *this; } }; ExportInlineSpecials::ExportInlineSpecials(const ExportInlineSpecials&) {} @@ -384,74 +384,74 @@ struct ExportDefaultedDefs { __declspec(dllexport) ExportDefaultedDefs& operator=(ExportDefaultedDefs&&); }; -// M32-DAG: define dllexport x86_thiscallcc %struct.ExportDefaultedDefs* @"\01??0ExportDefaultedDefs@@QAE@XZ"(%struct.ExportDefaultedDefs* returned %this) -// M64-DAG: define dllexport %struct.ExportDefaultedDefs* @"\01??0ExportDefaultedDefs@@QEAA@XZ"(%struct.ExportDefaultedDefs* returned %this) -// G32-DAG: define dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC1Ev(%struct.ExportDefaultedDefs* %this) -// G64-DAG: define dllexport void @_ZN19ExportDefaultedDefsC1Ev(%struct.ExportDefaultedDefs* %this) -// G32-DAG: define dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC2Ev(%struct.ExportDefaultedDefs* %this) -// G64-DAG: define dllexport void @_ZN19ExportDefaultedDefsC2Ev(%struct.ExportDefaultedDefs* %this) +// M32-DAG: define dso_local dllexport x86_thiscallcc %struct.ExportDefaultedDefs* @"??0ExportDefaultedDefs@@QAE@XZ"(%struct.ExportDefaultedDefs* returned %this) +// M64-DAG: define dso_local dllexport %struct.ExportDefaultedDefs* @"??0ExportDefaultedDefs@@QEAA@XZ"(%struct.ExportDefaultedDefs* returned %this) +// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC1Ev(%struct.ExportDefaultedDefs* %this) +// G64-DAG: define dso_local dllexport void @_ZN19ExportDefaultedDefsC1Ev(%struct.ExportDefaultedDefs* %this) +// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC2Ev(%struct.ExportDefaultedDefs* %this) +// G64-DAG: define dso_local dllexport void @_ZN19ExportDefaultedDefsC2Ev(%struct.ExportDefaultedDefs* %this) __declspec(dllexport) ExportDefaultedDefs::ExportDefaultedDefs() = default; -// M32-DAG: define dllexport x86_thiscallcc void @"\01??1ExportDefaultedDefs@@QAE@XZ"(%struct.ExportDefaultedDefs* %this) -// M64-DAG: define dllexport void @"\01??1ExportDefaultedDefs@@QEAA@XZ"(%struct.ExportDefaultedDefs* %this) -// G32-DAG: define dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsD1Ev(%struct.ExportDefaultedDefs* %this) -// G64-DAG: define dllexport void @_ZN19ExportDefaultedDefsD1Ev(%struct.ExportDefaultedDefs* %this) -// G32-DAG: define dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsD2Ev(%struct.ExportDefaultedDefs* %this) -// G64-DAG: define dllexport void @_ZN19ExportDefaultedDefsD2Ev(%struct.ExportDefaultedDefs* %this) +// M32-DAG: define dso_local dllexport x86_thiscallcc void @"??1ExportDefaultedDefs@@QAE@XZ"(%struct.ExportDefaultedDefs* %this) +// M64-DAG: define dso_local dllexport void @"??1ExportDefaultedDefs@@QEAA@XZ"(%struct.ExportDefaultedDefs* %this) +// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsD1Ev(%struct.ExportDefaultedDefs* %this) +// G64-DAG: define dso_local dllexport void @_ZN19ExportDefaultedDefsD1Ev(%struct.ExportDefaultedDefs* %this) +// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsD2Ev(%struct.ExportDefaultedDefs* %this) +// G64-DAG: define dso_local dllexport void @_ZN19ExportDefaultedDefsD2Ev(%struct.ExportDefaultedDefs* %this) ExportDefaultedDefs::~ExportDefaultedDefs() = default; -// M32-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExportDefaultedDefs* @"\01??0ExportDefaultedDefs@@QAE@ABU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) -// M64-DAG: define weak_odr dllexport %struct.ExportDefaultedDefs* @"\01??0ExportDefaultedDefs@@QEAA@AEBU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC1ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G64-DAG: define weak_odr dllexport void @_ZN19ExportDefaultedDefsC1ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC2ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G64-DAG: define weak_odr dllexport void @_ZN19ExportDefaultedDefsC2ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedDefs* @"??0ExportDefaultedDefs@@QAE@ABU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) +// M64-DAG: define weak_odr dso_local dllexport %struct.ExportDefaultedDefs* @"??0ExportDefaultedDefs@@QEAA@AEBU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC1ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G64-DAG: define weak_odr dso_local dllexport void @_ZN19ExportDefaultedDefsC1ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC2ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G64-DAG: define weak_odr dso_local dllexport void @_ZN19ExportDefaultedDefsC2ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) __declspec(dllexport) ExportDefaultedDefs::ExportDefaultedDefs(const ExportDefaultedDefs&) = default; -// M32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"\01??4ExportDefaultedDefs@@QAEAAU0@ABU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) -// M64-DAG: define weak_odr dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"\01??4ExportDefaultedDefs@@QEAAAEAU0@AEBU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G64-DAG: define weak_odr dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"??4ExportDefaultedDefs@@QAEAAU0@ABU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) +// M64-DAG: define weak_odr dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"??4ExportDefaultedDefs@@QEAAAEAU0@AEBU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G64-DAG: define weak_odr dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) inline ExportDefaultedDefs& ExportDefaultedDefs::operator=(const ExportDefaultedDefs&) = default; -// M32-DAG: define dllexport x86_thiscallcc %struct.ExportDefaultedDefs* @"\01??0ExportDefaultedDefs@@QAE@$$QAU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) -// M64-DAG: define dllexport %struct.ExportDefaultedDefs* @"\01??0ExportDefaultedDefs@@QEAA@$$QEAU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G32-DAG: define dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC1EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G64-DAG: define dllexport void @_ZN19ExportDefaultedDefsC1EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G32-DAG: define dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC2EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G64-DAG: define dllexport void @_ZN19ExportDefaultedDefsC2EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) +// M32-DAG: define dso_local dllexport x86_thiscallcc %struct.ExportDefaultedDefs* @"??0ExportDefaultedDefs@@QAE@$$QAU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) +// M64-DAG: define dso_local dllexport %struct.ExportDefaultedDefs* @"??0ExportDefaultedDefs@@QEAA@$$QEAU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC1EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G64-DAG: define dso_local dllexport void @_ZN19ExportDefaultedDefsC1EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC2EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G64-DAG: define dso_local dllexport void @_ZN19ExportDefaultedDefsC2EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) __declspec(dllexport) ExportDefaultedDefs::ExportDefaultedDefs(ExportDefaultedDefs&&) = default; -// M32-DAG: define dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"\01??4ExportDefaultedDefs@@QAEAAU0@$$QAU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) -// M64-DAG: define dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"\01??4ExportDefaultedDefs@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G32-DAG: define dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSEOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G64-DAG: define dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSEOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) +// M32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"??4ExportDefaultedDefs@@QAEAAU0@$$QAU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) +// M64-DAG: define dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"??4ExportDefaultedDefs@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSEOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G64-DAG: define dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSEOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}})) ExportDefaultedDefs& ExportDefaultedDefs::operator=(ExportDefaultedDefs&&) = default; // Export defaulted member function definitions declared inside class. struct ExportDefaultedInclassDefs { __declspec(dllexport) ExportDefaultedInclassDefs() = default; - // M32VS2013-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE@XZ"(%struct.ExportDefaultedInclassDefs* returned %this) - // M64VS2013-DAG: define weak_odr dllexport %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA@XZ"(%struct.ExportDefaultedInclassDefs* returned %this) - // M32VS2015-NOT: define weak_odr dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE@XZ"(%struct.ExportDefaultedInclassDefs* returned %this) - // M64VS2015-NOT: define weak_odr dllexport %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA@XZ"(%struct.ExportDefaultedInclassDefs* returned %this) + // M32VS2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QAE@XZ"(%struct.ExportDefaultedInclassDefs* returned %this) + // M64VS2013-DAG: define weak_odr dso_local dllexport %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QEAA@XZ"(%struct.ExportDefaultedInclassDefs* returned %this) + // M32VS2015-NOT: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QAE@XZ"(%struct.ExportDefaultedInclassDefs* returned %this) + // M64VS2015-NOT: define weak_odr dso_local dllexport %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QEAA@XZ"(%struct.ExportDefaultedInclassDefs* returned %this) __declspec(dllexport) ~ExportDefaultedInclassDefs() = default; - // M32VS2013-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??1ExportDefaultedInclassDefs@@QAE@XZ"(%struct.ExportDefaultedInclassDefs* %this) - // M64VS2013-DAG: define weak_odr dllexport void @"\01??1ExportDefaultedInclassDefs@@QEAA@XZ"(%struct.ExportDefaultedInclassDefs* %this) - // M32VS2015-NOT: define weak_odr dllexport x86_thiscallcc void @"\01??1ExportDefaultedInclassDefs@@QAE@XZ"(%struct.ExportDefaultedInclassDefs* %this) - // M64VS2015-NOT: define weak_odr dllexport void @"\01??1ExportDefaultedInclassDefs@@QEAA@XZ"(%struct.ExportDefaultedInclassDefs* %this) + // M32VS2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"??1ExportDefaultedInclassDefs@@QAE@XZ"(%struct.ExportDefaultedInclassDefs* %this) + // M64VS2013-DAG: define weak_odr dso_local dllexport void @"??1ExportDefaultedInclassDefs@@QEAA@XZ"(%struct.ExportDefaultedInclassDefs* %this) + // M32VS2015-NOT: define weak_odr dso_local dllexport x86_thiscallcc void @"??1ExportDefaultedInclassDefs@@QAE@XZ"(%struct.ExportDefaultedInclassDefs* %this) + // M64VS2015-NOT: define weak_odr dso_local dllexport void @"??1ExportDefaultedInclassDefs@@QEAA@XZ"(%struct.ExportDefaultedInclassDefs* %this) __declspec(dllexport) ExportDefaultedInclassDefs(const ExportDefaultedInclassDefs&) = default; - // M32VS2013-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE@ABU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) - // M64VS2013-DAG: define weak_odr dllexport %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA@AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) - // M32VS2015-NOT: define weak_odr dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE@ABU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) - // M64VS2015-NOT: define weak_odr dllexport %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA@AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) + // M32VS2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QAE@ABU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) + // M64VS2013-DAG: define weak_odr dso_local dllexport %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QEAA@AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) + // M32VS2015-NOT: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QAE@ABU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) + // M64VS2015-NOT: define weak_odr dso_local dllexport %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QEAA@AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) __declspec(dllexport) ExportDefaultedInclassDefs& operator=(const ExportDefaultedInclassDefs&) = default; - // M32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"\01??4ExportDefaultedInclassDefs@@QAEAAU0@ABU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) - // M64-DAG: define weak_odr dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"\01??4ExportDefaultedInclassDefs@@QEAAAEAU0@AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"??4ExportDefaultedInclassDefs@@QAEAAU0@ABU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) + // M64-DAG: define weak_odr dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"??4ExportDefaultedInclassDefs@@QEAAAEAU0@AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) }; @@ -463,28 +463,28 @@ struct ExportAlloc { __declspec(dllexport) void operator delete[](void*); }; -// M32-DAG: define dllexport i8* @"\01??2ExportAlloc@@SAPAXI@Z"(i32 %n) -// M64-DAG: define dllexport i8* @"\01??2ExportAlloc@@SAPEAX_K@Z"(i64 %n) -// G32-DAG: define dllexport i8* @_ZN11ExportAllocnwEj(i32 %n) -// G64-DAG: define dllexport i8* @_ZN11ExportAllocnwEy(i64 %n) +// M32-DAG: define dso_local dllexport i8* @"??2ExportAlloc@@SAPAXI@Z"(i32 %n) +// M64-DAG: define dso_local dllexport i8* @"??2ExportAlloc@@SAPEAX_K@Z"(i64 %n) +// G32-DAG: define dso_local dllexport i8* @_ZN11ExportAllocnwEj(i32 %n) +// G64-DAG: define dso_local dllexport i8* @_ZN11ExportAllocnwEy(i64 %n) void* ExportAlloc::operator new(__SIZE_TYPE__ n) { return malloc(n); } -// M32-DAG: define dllexport i8* @"\01??_UExportAlloc@@SAPAXI@Z"(i32 %n) -// M64-DAG: define dllexport i8* @"\01??_UExportAlloc@@SAPEAX_K@Z"(i64 %n) -// G32-DAG: define dllexport i8* @_ZN11ExportAllocnaEj(i32 %n) -// G64-DAG: define dllexport i8* @_ZN11ExportAllocnaEy(i64 %n) +// M32-DAG: define dso_local dllexport i8* @"??_UExportAlloc@@SAPAXI@Z"(i32 %n) +// M64-DAG: define dso_local dllexport i8* @"??_UExportAlloc@@SAPEAX_K@Z"(i64 %n) +// G32-DAG: define dso_local dllexport i8* @_ZN11ExportAllocnaEj(i32 %n) +// G64-DAG: define dso_local dllexport i8* @_ZN11ExportAllocnaEy(i64 %n) void* ExportAlloc::operator new[](__SIZE_TYPE__ n) { return malloc(n); } -// M32-DAG: define dllexport void @"\01??3ExportAlloc@@SAXPAX@Z"(i8* %p) -// M64-DAG: define dllexport void @"\01??3ExportAlloc@@SAXPEAX@Z"(i8* %p) -// G32-DAG: define dllexport void @_ZN11ExportAllocdlEPv(i8* %p) -// G64-DAG: define dllexport void @_ZN11ExportAllocdlEPv(i8* %p) +// M32-DAG: define dso_local dllexport void @"??3ExportAlloc@@SAXPAX@Z"(i8* %p) +// M64-DAG: define dso_local dllexport void @"??3ExportAlloc@@SAXPEAX@Z"(i8* %p) +// G32-DAG: define dso_local dllexport void @_ZN11ExportAllocdlEPv(i8* %p) +// G64-DAG: define dso_local dllexport void @_ZN11ExportAllocdlEPv(i8* %p) void ExportAlloc::operator delete(void* p) { free(p); } -// M32-DAG: define dllexport void @"\01??_VExportAlloc@@SAXPAX@Z"(i8* %p) -// M64-DAG: define dllexport void @"\01??_VExportAlloc@@SAXPEAX@Z"(i8* %p) -// G32-DAG: define dllexport void @_ZN11ExportAllocdaEPv(i8* %p) -// G64-DAG: define dllexport void @_ZN11ExportAllocdaEPv(i8* %p) +// M32-DAG: define dso_local dllexport void @"??_VExportAlloc@@SAXPAX@Z"(i8* %p) +// M64-DAG: define dso_local dllexport void @"??_VExportAlloc@@SAXPEAX@Z"(i8* %p) +// G32-DAG: define dso_local dllexport void @_ZN11ExportAllocdaEPv(i8* %p) +// G64-DAG: define dso_local dllexport void @_ZN11ExportAllocdaEPv(i8* %p) void ExportAlloc::operator delete[](void* p) { free(p); } @@ -501,125 +501,125 @@ struct MemFunTmpl { // Export implicit instantiation of an exported member function template. void useMemFunTmpl() { - // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??$exportedNormal@UImplicitInst_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) - // M64-DAG: define weak_odr dllexport void @"\01??$exportedNormal@UImplicitInst_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) - // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI21ImplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this) - // G64-DAG: define weak_odr dllexport void @_ZN10MemFunTmpl14exportedNormalI21ImplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this) + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"??$exportedNormal@UImplicitInst_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) + // M64-DAG: define weak_odr dso_local dllexport void @"??$exportedNormal@UImplicitInst_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) + // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI21ImplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this) + // G64-DAG: define weak_odr dso_local dllexport void @_ZN10MemFunTmpl14exportedNormalI21ImplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this) MemFunTmpl().exportedNormal<ImplicitInst_Exported>(); - // MSC-DAG: define weak_odr dllexport void @"\01??$exportedStatic@UImplicitInst_Exported@@@MemFunTmpl@@SAXXZ"() - // GNU-DAG: define weak_odr dllexport void @_ZN10MemFunTmpl14exportedStaticI21ImplicitInst_ExportedEEvv() + // MSC-DAG: define weak_odr dso_local dllexport void @"??$exportedStatic@UImplicitInst_Exported@@@MemFunTmpl@@SAXXZ"() + // GNU-DAG: define weak_odr dso_local dllexport void @_ZN10MemFunTmpl14exportedStaticI21ImplicitInst_ExportedEEvv() MemFunTmpl().exportedStatic<ImplicitInst_Exported>(); } // Export explicit instantiation declaration of an exported member function // template. -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??$exportedNormal@UExplicitDecl_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) -// M64-DAG: define weak_odr dllexport void @"\01??$exportedNormal@UExplicitDecl_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) -// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI21ExplicitDecl_ExportedEEvv(%struct.MemFunTmpl* %this) -// G64-DAG: define weak_odr dllexport void @_ZN10MemFunTmpl14exportedNormalI21ExplicitDecl_ExportedEEvv(%struct.MemFunTmpl* %this) +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"??$exportedNormal@UExplicitDecl_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) +// M64-DAG: define weak_odr dso_local dllexport void @"??$exportedNormal@UExplicitDecl_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) +// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI21ExplicitDecl_ExportedEEvv(%struct.MemFunTmpl* %this) +// G64-DAG: define weak_odr dso_local dllexport void @_ZN10MemFunTmpl14exportedNormalI21ExplicitDecl_ExportedEEvv(%struct.MemFunTmpl* %this) extern template void MemFunTmpl::exportedNormal<ExplicitDecl_Exported>(); template void MemFunTmpl::exportedNormal<ExplicitDecl_Exported>(); -// MSC-DAG: define weak_odr dllexport void @"\01??$exportedStatic@UExplicitDecl_Exported@@@MemFunTmpl@@SAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_ZN10MemFunTmpl14exportedStaticI21ExplicitDecl_ExportedEEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$exportedStatic@UExplicitDecl_Exported@@@MemFunTmpl@@SAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_ZN10MemFunTmpl14exportedStaticI21ExplicitDecl_ExportedEEvv() extern template void MemFunTmpl::exportedStatic<ExplicitDecl_Exported>(); template void MemFunTmpl::exportedStatic<ExplicitDecl_Exported>(); // Export explicit instantiation definition of an exported member function // template. -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??$exportedNormal@UExplicitInst_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) -// M64-DAG: define weak_odr dllexport void @"\01??$exportedNormal@UExplicitInst_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) -// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI21ExplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this) -// G64-DAG: define weak_odr dllexport void @_ZN10MemFunTmpl14exportedNormalI21ExplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this) +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"??$exportedNormal@UExplicitInst_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) +// M64-DAG: define weak_odr dso_local dllexport void @"??$exportedNormal@UExplicitInst_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) +// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI21ExplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this) +// G64-DAG: define weak_odr dso_local dllexport void @_ZN10MemFunTmpl14exportedNormalI21ExplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this) template void MemFunTmpl::exportedNormal<ExplicitInst_Exported>(); -// MSC-DAG: define weak_odr dllexport void @"\01??$exportedStatic@UExplicitInst_Exported@@@MemFunTmpl@@SAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_ZN10MemFunTmpl14exportedStaticI21ExplicitInst_ExportedEEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$exportedStatic@UExplicitInst_Exported@@@MemFunTmpl@@SAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_ZN10MemFunTmpl14exportedStaticI21ExplicitInst_ExportedEEvv() template void MemFunTmpl::exportedStatic<ExplicitInst_Exported>(); // Export specialization of an exported member function template. -// M32-DAG: define dllexport x86_thiscallcc void @"\01??$exportedNormal@UExplicitSpec_Def_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) -// M64-DAG: define dllexport void @"\01??$exportedNormal@UExplicitSpec_Def_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) -// G32-DAG: define dllexport x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI25ExplicitSpec_Def_ExportedEEvv(%struct.MemFunTmpl* %this) -// G64-DAG: define dllexport void @_ZN10MemFunTmpl14exportedNormalI25ExplicitSpec_Def_ExportedEEvv(%struct.MemFunTmpl* %this) +// M32-DAG: define dso_local dllexport x86_thiscallcc void @"??$exportedNormal@UExplicitSpec_Def_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) +// M64-DAG: define dso_local dllexport void @"??$exportedNormal@UExplicitSpec_Def_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) +// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI25ExplicitSpec_Def_ExportedEEvv(%struct.MemFunTmpl* %this) +// G64-DAG: define dso_local dllexport void @_ZN10MemFunTmpl14exportedNormalI25ExplicitSpec_Def_ExportedEEvv(%struct.MemFunTmpl* %this) template<> __declspec(dllexport) void MemFunTmpl::exportedNormal<ExplicitSpec_Def_Exported>() {} -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??$exportedNormal@UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) -// M64-DAG: define weak_odr dllexport void @"\01??$exportedNormal@UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) -// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI31ExplicitSpec_InlineDef_ExportedEEvv(%struct.MemFunTmpl* %this) -// G64-DAG: define weak_odr dllexport void @_ZN10MemFunTmpl14exportedNormalI31ExplicitSpec_InlineDef_ExportedEEvv(%struct.MemFunTmpl* %this) +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"??$exportedNormal@UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) +// M64-DAG: define weak_odr dso_local dllexport void @"??$exportedNormal@UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) +// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI31ExplicitSpec_InlineDef_ExportedEEvv(%struct.MemFunTmpl* %this) +// G64-DAG: define weak_odr dso_local dllexport void @_ZN10MemFunTmpl14exportedNormalI31ExplicitSpec_InlineDef_ExportedEEvv(%struct.MemFunTmpl* %this) template<> __declspec(dllexport) inline void MemFunTmpl::exportedNormal<ExplicitSpec_InlineDef_Exported>() {} -// MSC-DAG: define dllexport void @"\01??$exportedStatic@UExplicitSpec_Def_Exported@@@MemFunTmpl@@SAXXZ"() -// GNU-DAG: define dllexport void @_ZN10MemFunTmpl14exportedStaticI25ExplicitSpec_Def_ExportedEEvv() +// MSC-DAG: define dso_local dllexport void @"??$exportedStatic@UExplicitSpec_Def_Exported@@@MemFunTmpl@@SAXXZ"() +// GNU-DAG: define dso_local dllexport void @_ZN10MemFunTmpl14exportedStaticI25ExplicitSpec_Def_ExportedEEvv() template<> __declspec(dllexport) void MemFunTmpl::exportedStatic<ExplicitSpec_Def_Exported>() {} -// MSC-DAG: define weak_odr dllexport void @"\01??$exportedStatic@UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@SAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_ZN10MemFunTmpl14exportedStaticI31ExplicitSpec_InlineDef_ExportedEEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$exportedStatic@UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@SAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_ZN10MemFunTmpl14exportedStaticI31ExplicitSpec_InlineDef_ExportedEEvv() template<> __declspec(dllexport) inline void MemFunTmpl::exportedStatic<ExplicitSpec_InlineDef_Exported>() {} // Not exporting specialization of an exported member function template without -// explicit dllexport. -// M32-DAG: define x86_thiscallcc void @"\01??$exportedNormal@UExplicitSpec_NotExported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) -// M64-DAG: define void @"\01??$exportedNormal@UExplicitSpec_NotExported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) -// G32-DAG: define x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI24ExplicitSpec_NotExportedEEvv(%struct.MemFunTmpl* %this) -// G64-DAG: define void @_ZN10MemFunTmpl14exportedNormalI24ExplicitSpec_NotExportedEEvv(%struct.MemFunTmpl* %this) +// explicit dso_local dllexport. +// M32-DAG: define dso_local x86_thiscallcc void @"??$exportedNormal@UExplicitSpec_NotExported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) +// M64-DAG: define dso_local void @"??$exportedNormal@UExplicitSpec_NotExported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) +// G32-DAG: define dso_local x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI24ExplicitSpec_NotExportedEEvv(%struct.MemFunTmpl* %this) +// G64-DAG: define dso_local void @_ZN10MemFunTmpl14exportedNormalI24ExplicitSpec_NotExportedEEvv(%struct.MemFunTmpl* %this) template<> void MemFunTmpl::exportedNormal<ExplicitSpec_NotExported>() {} -// M32-DAG: define void @"\01??$exportedStatic@UExplicitSpec_NotExported@@@MemFunTmpl@@SAXXZ"() -// GNU-DAG: define void @_ZN10MemFunTmpl14exportedStaticI24ExplicitSpec_NotExportedEEvv() +// M32-DAG: define dso_local void @"??$exportedStatic@UExplicitSpec_NotExported@@@MemFunTmpl@@SAXXZ"() +// GNU-DAG: define dso_local void @_ZN10MemFunTmpl14exportedStaticI24ExplicitSpec_NotExportedEEvv() template<> void MemFunTmpl::exportedStatic<ExplicitSpec_NotExported>() {} // Export explicit instantiation declaration of a non-exported member function // template. -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??$normalDef@UExplicitDecl_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) -// M64-DAG: define weak_odr dllexport void @"\01??$normalDef@UExplicitDecl_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) -// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI21ExplicitDecl_ExportedEEvv(%struct.MemFunTmpl* %this) -// G64-DAG: define weak_odr dllexport void @_ZN10MemFunTmpl9normalDefI21ExplicitDecl_ExportedEEvv(%struct.MemFunTmpl* %this) +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"??$normalDef@UExplicitDecl_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) +// M64-DAG: define weak_odr dso_local dllexport void @"??$normalDef@UExplicitDecl_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) +// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI21ExplicitDecl_ExportedEEvv(%struct.MemFunTmpl* %this) +// G64-DAG: define weak_odr dso_local dllexport void @_ZN10MemFunTmpl9normalDefI21ExplicitDecl_ExportedEEvv(%struct.MemFunTmpl* %this) extern template __declspec(dllexport) void MemFunTmpl::normalDef<ExplicitDecl_Exported>(); template __declspec(dllexport) void MemFunTmpl::normalDef<ExplicitDecl_Exported>(); -// M32-DAG: define weak_odr dllexport void @"\01??$staticDef@UExplicitDecl_Exported@@@MemFunTmpl@@SAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_ZN10MemFunTmpl9staticDefI21ExplicitDecl_ExportedEEvv() +// M32-DAG: define weak_odr dso_local dllexport void @"??$staticDef@UExplicitDecl_Exported@@@MemFunTmpl@@SAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_ZN10MemFunTmpl9staticDefI21ExplicitDecl_ExportedEEvv() extern template __declspec(dllexport) void MemFunTmpl::staticDef<ExplicitDecl_Exported>(); template __declspec(dllexport) void MemFunTmpl::staticDef<ExplicitDecl_Exported>(); // Export explicit instantiation definition of a non-exported member function // template. -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??$normalDef@UExplicitInst_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) -// M64-DAG: define weak_odr dllexport void @"\01??$normalDef@UExplicitInst_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) -// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI21ExplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this) -// G64-DAG: define weak_odr dllexport void @_ZN10MemFunTmpl9normalDefI21ExplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this) +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"??$normalDef@UExplicitInst_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) +// M64-DAG: define weak_odr dso_local dllexport void @"??$normalDef@UExplicitInst_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) +// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI21ExplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this) +// G64-DAG: define weak_odr dso_local dllexport void @_ZN10MemFunTmpl9normalDefI21ExplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this) template __declspec(dllexport) void MemFunTmpl::normalDef<ExplicitInst_Exported>(); -// MSC-DAG: define weak_odr dllexport void @"\01??$staticDef@UExplicitInst_Exported@@@MemFunTmpl@@SAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_ZN10MemFunTmpl9staticDefI21ExplicitInst_ExportedEEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$staticDef@UExplicitInst_Exported@@@MemFunTmpl@@SAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_ZN10MemFunTmpl9staticDefI21ExplicitInst_ExportedEEvv() template __declspec(dllexport) void MemFunTmpl::staticDef<ExplicitInst_Exported>(); // Export specialization of a non-exported member function template. -// M32-DAG: define dllexport x86_thiscallcc void @"\01??$normalDef@UExplicitSpec_Def_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) -// M64-DAG: define dllexport void @"\01??$normalDef@UExplicitSpec_Def_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??$normalDef@UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) -// M64-DAG: define weak_odr dllexport void @"\01??$normalDef@UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) -// G32-DAG: define dllexport x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI25ExplicitSpec_Def_ExportedEEvv(%struct.MemFunTmpl* %this) -// G64-DAG: define dllexport void @_ZN10MemFunTmpl9normalDefI25ExplicitSpec_Def_ExportedEEvv(%struct.MemFunTmpl* %this) -// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI31ExplicitSpec_InlineDef_ExportedEEvv(%struct.MemFunTmpl* %this) -// G64-DAG: define weak_odr dllexport void @_ZN10MemFunTmpl9normalDefI31ExplicitSpec_InlineDef_ExportedEEvv(%struct.MemFunTmpl* %this) +// M32-DAG: define dso_local dllexport x86_thiscallcc void @"??$normalDef@UExplicitSpec_Def_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) +// M64-DAG: define dso_local dllexport void @"??$normalDef@UExplicitSpec_Def_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"??$normalDef@UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) +// M64-DAG: define weak_odr dso_local dllexport void @"??$normalDef@UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) +// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI25ExplicitSpec_Def_ExportedEEvv(%struct.MemFunTmpl* %this) +// G64-DAG: define dso_local dllexport void @_ZN10MemFunTmpl9normalDefI25ExplicitSpec_Def_ExportedEEvv(%struct.MemFunTmpl* %this) +// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI31ExplicitSpec_InlineDef_ExportedEEvv(%struct.MemFunTmpl* %this) +// G64-DAG: define weak_odr dso_local dllexport void @_ZN10MemFunTmpl9normalDefI31ExplicitSpec_InlineDef_ExportedEEvv(%struct.MemFunTmpl* %this) template<> __declspec(dllexport) void MemFunTmpl::normalDef<ExplicitSpec_Def_Exported>() {} template<> __declspec(dllexport) inline void MemFunTmpl::normalDef<ExplicitSpec_InlineDef_Exported>() {} -// MSC-DAG: define dllexport void @"\01??$staticDef@UExplicitSpec_Def_Exported@@@MemFunTmpl@@SAXXZ"() -// MSC-DAG: define weak_odr dllexport void @"\01??$staticDef@UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@SAXXZ"() -// GNU-DAG: define dllexport void @_ZN10MemFunTmpl9staticDefI25ExplicitSpec_Def_ExportedEEvv() -// GNU-DAG: define weak_odr dllexport void @_ZN10MemFunTmpl9staticDefI31ExplicitSpec_InlineDef_ExportedEEvv() +// MSC-DAG: define dso_local dllexport void @"??$staticDef@UExplicitSpec_Def_Exported@@@MemFunTmpl@@SAXXZ"() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$staticDef@UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@SAXXZ"() +// GNU-DAG: define dso_local dllexport void @_ZN10MemFunTmpl9staticDefI25ExplicitSpec_Def_ExportedEEvv() +// GNU-DAG: define weak_odr dso_local dllexport void @_ZN10MemFunTmpl9staticDefI31ExplicitSpec_InlineDef_ExportedEEvv() template<> __declspec(dllexport) void MemFunTmpl::staticDef<ExplicitSpec_Def_Exported>() {} template<> __declspec(dllexport) inline void MemFunTmpl::staticDef<ExplicitSpec_InlineDef_Exported>() {} @@ -633,49 +633,49 @@ template<typename T> const int MemVarTmpl::StaticVar; template<typename T> const int MemVarTmpl::ExportedStaticVar; // Export implicit instantiation of an exported member variable template. -// MSC-DAG: @"\01??$ExportedStaticVar@UImplicitInst_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4 -// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI21ImplicitInst_ExportedEE = weak_odr dllexport constant i32 1, comdat, align 4 +// MSC-DAG: @"??$ExportedStaticVar@UImplicitInst_Exported@@@MemVarTmpl@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4 +// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI21ImplicitInst_ExportedEE = weak_odr dso_local dllexport constant i32 1, comdat, align 4 int useMemVarTmpl() { return MemVarTmpl::ExportedStaticVar<ImplicitInst_Exported>; } // Export explicit instantiation declaration of an exported member variable // template. -// MSC-DAG: @"\01??$ExportedStaticVar@UExplicitDecl_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4 -// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI21ExplicitDecl_ExportedEE = weak_odr dllexport constant i32 1, comdat, align 4 +// MSC-DAG: @"??$ExportedStaticVar@UExplicitDecl_Exported@@@MemVarTmpl@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4 +// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI21ExplicitDecl_ExportedEE = weak_odr dso_local dllexport constant i32 1, comdat, align 4 extern template const int MemVarTmpl::ExportedStaticVar<ExplicitDecl_Exported>; template const int MemVarTmpl::ExportedStaticVar<ExplicitDecl_Exported>; // Export explicit instantiation definition of an exported member variable // template. -// MSC-DAG: @"\01??$ExportedStaticVar@UExplicitInst_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4 -// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI21ExplicitInst_ExportedEE = weak_odr dllexport constant i32 1, comdat, align 4 +// MSC-DAG: @"??$ExportedStaticVar@UExplicitInst_Exported@@@MemVarTmpl@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4 +// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI21ExplicitInst_ExportedEE = weak_odr dso_local dllexport constant i32 1, comdat, align 4 template const int MemVarTmpl::ExportedStaticVar<ExplicitInst_Exported>; // Export specialization of an exported member variable template. -// MSC-DAG: @"\01??$ExportedStaticVar@UExplicitSpec_Def_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4 -// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI25ExplicitSpec_Def_ExportedEE = dllexport constant i32 1, align 4 +// MSC-DAG: @"??$ExportedStaticVar@UExplicitSpec_Def_Exported@@@MemVarTmpl@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4 +// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI25ExplicitSpec_Def_ExportedEE = dso_local dllexport constant i32 1, align 4 template<> __declspec(dllexport) const int MemVarTmpl::ExportedStaticVar<ExplicitSpec_Def_Exported> = 1; // Not exporting specialization of an exported member variable template without // explicit dllexport. -// MSC-DAG: @"\01??$ExportedStaticVar@UExplicitSpec_NotExported@@@MemVarTmpl@@2HB" = weak_odr constant i32 1, comdat, align 4 -// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI24ExplicitSpec_NotExportedEE = constant i32 1, align 4 +// MSC-DAG: @"??$ExportedStaticVar@UExplicitSpec_NotExported@@@MemVarTmpl@@2HB" = weak_odr dso_local constant i32 1, comdat, align 4 +// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI24ExplicitSpec_NotExportedEE = dso_local constant i32 1, align 4 template<> const int MemVarTmpl::ExportedStaticVar<ExplicitSpec_NotExported> = 1; // Export explicit instantiation declaration of a non-exported member variable // template. -// MSC-DAG: @"\01??$StaticVar@UExplicitDecl_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4 -// GNU-DAG: @_ZN10MemVarTmpl9StaticVarI21ExplicitDecl_ExportedEE = weak_odr dllexport constant i32 1, comdat, align 4 +// MSC-DAG: @"??$StaticVar@UExplicitDecl_Exported@@@MemVarTmpl@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4 +// GNU-DAG: @_ZN10MemVarTmpl9StaticVarI21ExplicitDecl_ExportedEE = weak_odr dso_local dllexport constant i32 1, comdat, align 4 extern template __declspec(dllexport) const int MemVarTmpl::StaticVar<ExplicitDecl_Exported>; template __declspec(dllexport) const int MemVarTmpl::StaticVar<ExplicitDecl_Exported>; // Export explicit instantiation definition of a non-exported member variable // template. -// MSC-DAG: @"\01??$StaticVar@UExplicitInst_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4 -// GNU-DAG: @_ZN10MemVarTmpl9StaticVarI21ExplicitInst_ExportedEE = weak_odr dllexport constant i32 1, comdat, align 4 +// MSC-DAG: @"??$StaticVar@UExplicitInst_Exported@@@MemVarTmpl@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4 +// GNU-DAG: @_ZN10MemVarTmpl9StaticVarI21ExplicitInst_ExportedEE = weak_odr dso_local dllexport constant i32 1, comdat, align 4 template __declspec(dllexport) const int MemVarTmpl::StaticVar<ExplicitInst_Exported>; // Export specialization of a non-exported member variable template. -// MSC-DAG: @"\01??$StaticVar@UExplicitSpec_Def_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4 -// GNU-DAG: @_ZN10MemVarTmpl9StaticVarI25ExplicitSpec_Def_ExportedEE = dllexport constant i32 1, align 4 +// MSC-DAG: @"??$StaticVar@UExplicitSpec_Def_Exported@@@MemVarTmpl@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4 +// GNU-DAG: @_ZN10MemVarTmpl9StaticVarI25ExplicitSpec_Def_ExportedEE = dso_local dllexport constant i32 1, align 4 template<> __declspec(dllexport) const int MemVarTmpl::StaticVar<ExplicitSpec_Def_Exported> = 1; diff --git a/test/CodeGenCXX/dllexport-ms-friend.cpp b/test/CodeGenCXX/dllexport-ms-friend.cpp index 7bcf5905e5e58..670264704e891 100644 --- a/test/CodeGenCXX/dllexport-ms-friend.cpp +++ b/test/CodeGenCXX/dllexport-ms-friend.cpp @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -triple %ms_abi_triple -fms-extensions -emit-llvm -O0 -o - %s | FileCheck %s // Friend functions defined in classes are emitted. -// CHECK: define weak_odr dllexport void @"\01?friend1@@YAXXZ"() +// CHECK: define weak_odr dso_local dllexport void @"?friend1@@YAXXZ"() struct FuncFriend1 { friend __declspec(dllexport) void friend1() {} }; diff --git a/test/CodeGenCXX/dllexport-pr26549.cpp b/test/CodeGenCXX/dllexport-pr26549.cpp index ceb2e0685ef18..c5ac1c1dea3ac 100644 --- a/test/CodeGenCXX/dllexport-pr26549.cpp +++ b/test/CodeGenCXX/dllexport-pr26549.cpp @@ -3,7 +3,7 @@ template <typename> struct MessageT { }; extern template struct MessageT<int>; -// CHECK: define weak_odr dllexport {{.*}} %struct.MessageT* @"\01??4?$MessageT@H@@QEAAAEAU0@AEBU0@@Z"( +// CHECK: define weak_odr dso_local dllexport {{.*}} %struct.MessageT* @"??4?$MessageT@H@@QEAAAEAU0@AEBU0@@Z"( template struct __declspec(dllexport) MessageT<int>; // Previously we crashed when this dllexport was the last thing in the file. // DO NOT ADD MORE TESTS AFTER THIS LINE! diff --git a/test/CodeGenCXX/dllexport-vtable-thunks.cpp b/test/CodeGenCXX/dllexport-vtable-thunks.cpp index 81811ace2ee69..52947840d8d13 100644 --- a/test/CodeGenCXX/dllexport-vtable-thunks.cpp +++ b/test/CodeGenCXX/dllexport-vtable-thunks.cpp @@ -11,7 +11,7 @@ struct __declspec(dllexport) C : A, B { virtual void m(); }; void C::m() {} -// CHECK: define dllexport void @_ZThn8_N1C1mEv +// CHECK: define dso_local dllexport void @_ZThn8_N1C1mEv struct Base { virtual void m(); @@ -20,4 +20,4 @@ struct __declspec(dllexport) Derived : virtual Base { virtual void m(); }; void Derived::m() {} -// CHECK: define dllexport void @_ZTv0_n24_N7Derived1mEv +// CHECK: define dso_local dllexport void @_ZTv0_n24_N7Derived1mEv diff --git a/test/CodeGenCXX/dllexport.cpp b/test/CodeGenCXX/dllexport.cpp index a446147b6cdc6..a7b6aad357e58 100644 --- a/test/CodeGenCXX/dllexport.cpp +++ b/test/CodeGenCXX/dllexport.cpp @@ -1,11 +1,11 @@ -// RUN: %clang_cc1 -triple i686-windows-msvc -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O1 -mconstructor-aliases -disable-llvm-passes -o - %s -w -fms-compatibility-version=19.00 | FileCheck --check-prefix=MSC --check-prefix=M32 -check-prefix=MSVC2015 -check-prefix=M32MSVC2015 %s -// RUN: %clang_cc1 -triple i686-windows-msvc -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O1 -mconstructor-aliases -disable-llvm-passes -o - %s -w -fms-compatibility-version=18.00 | FileCheck --check-prefix=MSC --check-prefix=M32 -check-prefix=MSVC2013 -check-prefix=M32MSVC2013 %s +// RUN: %clang_cc1 -triple i686-windows-msvc -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O1 -mconstructor-aliases -disable-llvm-passes -o - %s -w -fms-compatibility-version=19.00 | FileCheck -allow-deprecated-dag-overlap --check-prefix=MSC --check-prefix=M32 -check-prefix=MSVC2015 -check-prefix=M32MSVC2015 %s +// RUN: %clang_cc1 -triple i686-windows-msvc -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O1 -mconstructor-aliases -disable-llvm-passes -o - %s -w -fms-compatibility-version=18.00 | FileCheck -allow-deprecated-dag-overlap --check-prefix=MSC --check-prefix=M32 -check-prefix=MSVC2013 -check-prefix=M32MSVC2013 %s -// RUN: %clang_cc1 -triple x86_64-windows-msvc -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O0 -o - %s -w -fms-compatibility-version=19.00 | FileCheck --check-prefix=MSC --check-prefix=M64 -check-prefix=MSVC2015 -check-prefix=M64MSVC2015 %s -// RUN: %clang_cc1 -triple x86_64-windows-msvc -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O0 -o - %s -w -fms-compatibility-version=18.00 | FileCheck --check-prefix=MSC --check-prefix=M64 -check-prefix=MSVC2013 -check-prefix=M64MSVC2013 %s +// RUN: %clang_cc1 -triple x86_64-windows-msvc -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O0 -o - %s -w -fms-compatibility-version=19.00 | FileCheck -allow-deprecated-dag-overlap --check-prefix=MSC --check-prefix=M64 -check-prefix=MSVC2015 -check-prefix=M64MSVC2015 %s +// RUN: %clang_cc1 -triple x86_64-windows-msvc -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O0 -o - %s -w -fms-compatibility-version=18.00 | FileCheck -allow-deprecated-dag-overlap --check-prefix=MSC --check-prefix=M64 -check-prefix=MSVC2013 -check-prefix=M64MSVC2013 %s -// RUN: %clang_cc1 -triple i686-windows-gnu -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O0 -o - %s -w | FileCheck --check-prefix=GNU --check-prefix=G32 %s -// RUN: %clang_cc1 -triple x86_64-windows-gnu -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O0 -o - %s -w | FileCheck --check-prefix=GNU --check-prefix=G64 %s +// RUN: %clang_cc1 -triple i686-windows-gnu -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O0 -o - %s -w | FileCheck -allow-deprecated-dag-overlap --check-prefix=GNU --check-prefix=G32 %s +// RUN: %clang_cc1 -triple x86_64-windows-gnu -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O0 -o - %s -w | FileCheck -allow-deprecated-dag-overlap --check-prefix=GNU --check-prefix=G64 %s // Helper structs to make templates more expressive. struct ImplicitInst_Exported {}; @@ -27,7 +27,9 @@ struct External { int v; }; #define INST(func) template void func(); // The vftable for struct W is comdat largest because we have RTTI. -// M32-DAG: $"\01??_7W@@6B@" = comdat largest +// M32-DAG: $"??_7W@@6B@" = comdat largest + +// M32-DAG: $"?smember@?$Base@H@PR32992@@0HA" = comdat any //===----------------------------------------------------------------------===// @@ -35,66 +37,98 @@ struct External { int v; }; //===----------------------------------------------------------------------===// // Declarations are not exported. -// MSC-NOT: @"\01?ExternGlobalDecl@@3HA" +// MSC-NOT: @"?ExternGlobalDecl@@3HA" // GNU-NOT: @ExternGlobalDecl __declspec(dllexport) extern int ExternGlobalDecl; +// M64-DAG: @__ImageBase = external dso_local constant i8 + +// GNU-DAG: @_ZTVN10__cxxabiv117__class_type_infoE = external dso_local global + // dllexport implies a definition. -// MSC-DAG: @"\01?GlobalDef@@3HA" = dllexport global i32 0, align 4 -// GNU-DAG: @GlobalDef = dllexport global i32 0, align 4 +// MSC-DAG: @"?GlobalDef@@3HA" = dso_local dllexport global i32 0, align 4 +// GNU-DAG: @GlobalDef = dso_local dllexport global i32 0, align 4 __declspec(dllexport) int GlobalDef; // Export definition. -// MSC-DAG: @"\01?GlobalInit1@@3HA" = dllexport global i32 1, align 4 -// GNU-DAG: @GlobalInit1 = dllexport global i32 1, align 4 +// MSC-DAG: @"?GlobalInit1@@3HA" = dso_local dllexport global i32 1, align 4 +// GNU-DAG: @GlobalInit1 = dso_local dllexport global i32 1, align 4 __declspec(dllexport) int GlobalInit1 = 1; -// MSC-DAG: @"\01?GlobalInit2@@3HA" = dllexport global i32 1, align 4 -// GNU-DAG: @GlobalInit2 = dllexport global i32 1, align 4 +// MSC-DAG: @"?GlobalInit2@@3HA" = dso_local dllexport global i32 1, align 4 +// GNU-DAG: @GlobalInit2 = dso_local dllexport global i32 1, align 4 int __declspec(dllexport) GlobalInit2 = 1; // Declare, then export definition. -// MSC-DAG: @"\01?GlobalDeclInit@@3HA" = dllexport global i32 1, align 4 -// GNU-DAG: @GlobalDeclInit = dllexport global i32 1, align 4 +// MSC-DAG: @"?GlobalDeclInit@@3HA" = dso_local dllexport global i32 1, align 4 +// GNU-DAG: @GlobalDeclInit = dso_local dllexport global i32 1, align 4 __declspec(dllexport) extern int GlobalDeclInit; int GlobalDeclInit = 1; // Redeclarations -// MSC-DAG: @"\01?GlobalRedecl1@@3HA" = dllexport global i32 0, align 4 -// GNU-DAG: @GlobalRedecl1 = dllexport global i32 0, align 4 +// MSC-DAG: @"?GlobalRedecl1@@3HA" = dso_local dllexport global i32 0, align 4 +// GNU-DAG: @GlobalRedecl1 = dso_local dllexport global i32 0, align 4 __declspec(dllexport) extern int GlobalRedecl1; __declspec(dllexport) int GlobalRedecl1; -// MSC-DAG: @"\01?GlobalRedecl2@@3HA" = dllexport global i32 0, align 4 -// GNU-DAG: @GlobalRedecl2 = dllexport global i32 0, align 4 +// MSC-DAG: @"?GlobalRedecl2@@3HA" = dso_local dllexport global i32 0, align 4 +// GNU-DAG: @GlobalRedecl2 = dso_local dllexport global i32 0, align 4 __declspec(dllexport) extern int GlobalRedecl2; int GlobalRedecl2; -// MSC-DAG: @"\01?ExternalGlobal@ns@@3HA" = dllexport global i32 0, align 4 -// GNU-DAG: @_ZN2ns14ExternalGlobalE = dllexport global i32 0, align 4 +// MSC-DAG: @"?ExternalGlobal@ns@@3HA" = dso_local dllexport global i32 0, align 4 +// GNU-DAG: @_ZN2ns14ExternalGlobalE = dso_local dllexport global i32 0, align 4 namespace ns { __declspec(dllexport) int ExternalGlobal; } -// MSC-DAG: @"\01?ExternalAutoTypeGlobal@@3UExternal@@A" = dllexport global %struct.External zeroinitializer, align 4 -// GNU-DAG: @ExternalAutoTypeGlobal = dllexport global %struct.External zeroinitializer, align 4 +// MSC-DAG: @"?ExternalAutoTypeGlobal@@3UExternal@@A" = dso_local dllexport global %struct.External zeroinitializer, align 4 +// GNU-DAG: @ExternalAutoTypeGlobal = dso_local dllexport global %struct.External zeroinitializer, align 4 __declspec(dllexport) auto ExternalAutoTypeGlobal = External(); int f(); -// MSC-DAG: @"\01?x@?1??nonInlineStaticLocalsFunc@@YAHXZ@4HA" = internal {{(unnamed_addr )*}}global i32 0 -// MSC-DAG: @"\01?$S1@?1??nonInlineStaticLocalsFunc@@YAHXZ@4IA" = internal {{(unnamed_addr )*}}global i32 0 +// MSC-DAG: @"?x@?1??nonInlineStaticLocalsFunc@@YAHXZ@4HA" = internal {{(unnamed_addr )*}}global i32 0 +// MSC-DAG: @"?$S1@?1??nonInlineStaticLocalsFunc@@YAHXZ@4IA" = internal {{(unnamed_addr )*}}global i32 0 int __declspec(dllexport) nonInlineStaticLocalsFunc() { static int x = f(); return x++; }; -// MSC-DAG: @"\01?x@?1??inlineStaticLocalsFunc@@YAHXZ@4HA" = weak_odr dllexport global i32 0, comdat -// MSC-DAG: @"\01??_B?1??inlineStaticLocalsFunc@@YAHXZ@51" = weak_odr dllexport global i32 0, comdat +// MSC-DAG: @"?x@?1??inlineStaticLocalsFunc@@YAHXZ@4HA" = weak_odr dso_local dllexport global i32 0, comdat +// MSC-DAG: @"??_B?1??inlineStaticLocalsFunc@@YAHXZ@51" = weak_odr dllexport global i32 0, comdat // Note: MinGW doesn't seem to export the static local here. inline int __declspec(dllexport) inlineStaticLocalsFunc() { static int x = f(); return x++; } +namespace PR32992 { +// Static data members of a instantiated base class should be exported. +template <class T> +class Base { + virtual void myfunc() {} + static int smember; +}; +// MSC-DAG: @"?smember@?$Base@H@PR32992@@0HA" = weak_odr dso_local dllexport global i32 77, comdat, align 4 +template <class T> int Base<T>::smember = 77; +template <class T> +class __declspec(dllexport) Derived2 : Base<T> { + void myfunc() {} +}; +class Derived : public Derived2<int> { + void myfunc() {} +}; +} // namespace PR32992 +namespace PR32992_1 { +namespace a { enum b { c }; } +template <typename> class d { + static constexpr a::b e = a::c; +}; +namespace f { + template <typename g = int> class h : d<g> {}; +} +using f::h; +class __declspec(dllexport) i : h<> {}; +} //===----------------------------------------------------------------------===// // Variable templates @@ -102,49 +136,49 @@ inline int __declspec(dllexport) inlineStaticLocalsFunc() { // Declarations are not exported. -// MSC-DAG: @"\01??$VarTmplImplicitDef@UImplicitInst_Exported@@@@3HA" = external global -// GNU-DAG: @_Z18VarTmplImplicitDefI21ImplicitInst_ExportedE = external global +// MSC-DAG: @"??$VarTmplImplicitDef@UImplicitInst_Exported@@@@3HA" = external dso_local global +// GNU-DAG: @_Z18VarTmplImplicitDefI21ImplicitInst_ExportedE = external dso_local global template<typename T> __declspec(dllexport) extern int VarTmplImplicitDef; USEVAR(VarTmplImplicitDef<ImplicitInst_Exported>) // Export definition. -// MSC-DAG: @"\01??$VarTmplInit1@UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4 -// GNU-DAG: @_Z12VarTmplInit1I21ExplicitInst_ExportedE = weak_odr dllexport global i32 1, comdat, align 4 +// MSC-DAG: @"??$VarTmplInit1@UExplicitInst_Exported@@@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4 +// GNU-DAG: @_Z12VarTmplInit1I21ExplicitInst_ExportedE = weak_odr dso_local dllexport global i32 1, comdat, align 4 template<typename T> __declspec(dllexport) int VarTmplInit1 = 1; INSTVAR(VarTmplInit1<ExplicitInst_Exported>) -// MSC-DAG: @"\01??$VarTmplInit2@UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4 -// GNU-DAG: @_Z12VarTmplInit2I21ExplicitInst_ExportedE = weak_odr dllexport global i32 1, comdat, align 4 +// MSC-DAG: @"??$VarTmplInit2@UExplicitInst_Exported@@@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4 +// GNU-DAG: @_Z12VarTmplInit2I21ExplicitInst_ExportedE = weak_odr dso_local dllexport global i32 1, comdat, align 4 template<typename T> int __declspec(dllexport) VarTmplInit2 = 1; INSTVAR(VarTmplInit2<ExplicitInst_Exported>) // Declare, then export definition. -// MSC-DAG: @"\01??$VarTmplDeclInit@UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4 -// GNU-DAG: @_Z15VarTmplDeclInitI21ExplicitInst_ExportedE = weak_odr dllexport global i32 1, comdat, align 4 +// MSC-DAG: @"??$VarTmplDeclInit@UExplicitInst_Exported@@@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4 +// GNU-DAG: @_Z15VarTmplDeclInitI21ExplicitInst_ExportedE = weak_odr dso_local dllexport global i32 1, comdat, align 4 template<typename T> __declspec(dllexport) extern int VarTmplDeclInit; template<typename T> int VarTmplDeclInit = 1; INSTVAR(VarTmplDeclInit<ExplicitInst_Exported>) // Redeclarations -// MSC-DAG: @"\01??$VarTmplRedecl1@UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4 -// GNU-DAG: @_Z14VarTmplRedecl1I21ExplicitInst_ExportedE = weak_odr dllexport global i32 1, comdat, align 4 +// MSC-DAG: @"??$VarTmplRedecl1@UExplicitInst_Exported@@@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4 +// GNU-DAG: @_Z14VarTmplRedecl1I21ExplicitInst_ExportedE = weak_odr dso_local dllexport global i32 1, comdat, align 4 template<typename T> __declspec(dllexport) extern int VarTmplRedecl1; template<typename T> __declspec(dllexport) int VarTmplRedecl1 = 1; INSTVAR(VarTmplRedecl1<ExplicitInst_Exported>) -// MSC-DAG: @"\01??$VarTmplRedecl2@UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4 -// GNU-DAG: @_Z14VarTmplRedecl2I21ExplicitInst_ExportedE = weak_odr dllexport global i32 1, comdat, align 4 +// MSC-DAG: @"??$VarTmplRedecl2@UExplicitInst_Exported@@@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4 +// GNU-DAG: @_Z14VarTmplRedecl2I21ExplicitInst_ExportedE = weak_odr dso_local dllexport global i32 1, comdat, align 4 template<typename T> __declspec(dllexport) extern int VarTmplRedecl2; template<typename T> int VarTmplRedecl2 = 1; INSTVAR(VarTmplRedecl2<ExplicitInst_Exported>) -// MSC-DAG: @"\01??$ExternalVarTmpl@UExplicitInst_Exported@@@ns@@3HA" = weak_odr dllexport global i32 1, comdat, align 4 -// GNU-DAG: @_ZN2ns15ExternalVarTmplI21ExplicitInst_ExportedEE = weak_odr dllexport global i32 1, comdat, align 4 +// MSC-DAG: @"??$ExternalVarTmpl@UExplicitInst_Exported@@@ns@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4 +// GNU-DAG: @_ZN2ns15ExternalVarTmplI21ExplicitInst_ExportedEE = weak_odr dso_local dllexport global i32 1, comdat, align 4 namespace ns { template<typename T> __declspec(dllexport) int ExternalVarTmpl = 1; } INSTVAR(ns::ExternalVarTmpl<ExplicitInst_Exported>) -// MSC-DAG: @"\01??$ExternalAutoTypeVarTmpl@UExplicitInst_Exported@@@@3UExternal@@A" = weak_odr dllexport global %struct.External zeroinitializer, comdat, align 4 -// GNU-DAG: @_Z23ExternalAutoTypeVarTmplI21ExplicitInst_ExportedE = weak_odr dllexport global %struct.External zeroinitializer, comdat, align 4 +// MSC-DAG: @"??$ExternalAutoTypeVarTmpl@UExplicitInst_Exported@@@@3UExternal@@A" = weak_odr dso_local dllexport global %struct.External zeroinitializer, comdat, align 4 +// GNU-DAG: @_Z23ExternalAutoTypeVarTmplI21ExplicitInst_ExportedE = weak_odr dso_local dllexport global %struct.External zeroinitializer, comdat, align 4 template<typename T> __declspec(dllexport) auto ExternalAutoTypeVarTmpl = External(); template External ExternalAutoTypeVarTmpl<ExplicitInst_Exported>; @@ -153,55 +187,55 @@ template<typename T> int VarTmpl = 1; template<typename T> __declspec(dllexport) int ExportedVarTmpl = 1; // Export implicit instantiation of an exported variable template. -// MSC-DAG: @"\01??$ExportedVarTmpl@UImplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4 -// GNU-DAG: @_Z15ExportedVarTmplI21ImplicitInst_ExportedE = weak_odr dllexport global i32 1, comdat, align 4 +// MSC-DAG: @"??$ExportedVarTmpl@UImplicitInst_Exported@@@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4 +// GNU-DAG: @_Z15ExportedVarTmplI21ImplicitInst_ExportedE = weak_odr dso_local dllexport global i32 1, comdat, align 4 USEVAR(ExportedVarTmpl<ImplicitInst_Exported>) // Export explicit instantiation declaration of an exported variable template. -// MSC-DAG: @"\01??$ExportedVarTmpl@UImplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4 -// GNU-DAG: @_Z15ExportedVarTmplI21ExplicitDecl_ExportedE = weak_odr dllexport global i32 1, comdat, align 4 +// MSC-DAG: @"??$ExportedVarTmpl@UImplicitInst_Exported@@@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4 +// GNU-DAG: @_Z15ExportedVarTmplI21ExplicitDecl_ExportedE = weak_odr dso_local dllexport global i32 1, comdat, align 4 extern template int ExportedVarTmpl<ExplicitDecl_Exported>; template int ExportedVarTmpl<ExplicitDecl_Exported>; // Export explicit instantiation definition of an exported variable template. -// MSC-DAG: @"\01??$ExportedVarTmpl@UImplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4 -// GNU-DAG: @_Z15ExportedVarTmplI21ExplicitInst_ExportedE = weak_odr dllexport global i32 1, comdat, align 4 +// MSC-DAG: @"??$ExportedVarTmpl@UImplicitInst_Exported@@@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4 +// GNU-DAG: @_Z15ExportedVarTmplI21ExplicitInst_ExportedE = weak_odr dso_local dllexport global i32 1, comdat, align 4 template __declspec(dllexport) int ExportedVarTmpl<ExplicitInst_Exported>; // Export specialization of an exported variable template. -// MSC-DAG: @"\01??$ExportedVarTmpl@UExplicitSpec_Exported@@@@3HA" = dllexport global i32 0, align 4 -// GNU-DAG: @_Z15ExportedVarTmplI21ExplicitSpec_ExportedE = dllexport global i32 0, align 4 +// MSC-DAG: @"??$ExportedVarTmpl@UExplicitSpec_Exported@@@@3HA" = dso_local dllexport global i32 0, align 4 +// GNU-DAG: @_Z15ExportedVarTmplI21ExplicitSpec_ExportedE = dso_local dllexport global i32 0, align 4 template<> __declspec(dllexport) int ExportedVarTmpl<ExplicitSpec_Exported>; -// MSC-DAG: @"\01??$ExportedVarTmpl@UExplicitSpec_Def_Exported@@@@3HA" = dllexport global i32 1, align 4 -// GNU-DAG: @_Z15ExportedVarTmplI25ExplicitSpec_Def_ExportedE = dllexport global i32 1, align 4 +// MSC-DAG: @"??$ExportedVarTmpl@UExplicitSpec_Def_Exported@@@@3HA" = dso_local dllexport global i32 1, align 4 +// GNU-DAG: @_Z15ExportedVarTmplI25ExplicitSpec_Def_ExportedE = dso_local dllexport global i32 1, align 4 template<> __declspec(dllexport) int ExportedVarTmpl<ExplicitSpec_Def_Exported> = 1; // Not exporting specialization of an exported variable template without // explicit dllexport. -// MSC-DAG: @"\01??$ExportedVarTmpl@UExplicitSpec_NotExported@@@@3HA" = global i32 0, align 4 -// GNU-DAG: @_Z15ExportedVarTmplI24ExplicitSpec_NotExportedE = global i32 0, align 4 +// MSC-DAG: @"??$ExportedVarTmpl@UExplicitSpec_NotExported@@@@3HA" = dso_local global i32 0, align 4 +// GNU-DAG: @_Z15ExportedVarTmplI24ExplicitSpec_NotExportedE = dso_local global i32 0, align 4 template<> int ExportedVarTmpl<ExplicitSpec_NotExported>; // Export explicit instantiation declaration of a non-exported variable template. -// MSC-DAG: @"\01??$VarTmpl@UExplicitDecl_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4 -// GNU-DAG: @_Z7VarTmplI21ExplicitDecl_ExportedE = weak_odr dllexport global i32 1, comdat, align 4 +// MSC-DAG: @"??$VarTmpl@UExplicitDecl_Exported@@@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4 +// GNU-DAG: @_Z7VarTmplI21ExplicitDecl_ExportedE = weak_odr dso_local dllexport global i32 1, comdat, align 4 extern template __declspec(dllexport) int VarTmpl<ExplicitDecl_Exported>; template __declspec(dllexport) int VarTmpl<ExplicitDecl_Exported>; // Export explicit instantiation definition of a non-exported variable template. -// MSC-DAG: @"\01??$VarTmpl@UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4 -// GNU-DAG: @_Z7VarTmplI21ExplicitInst_ExportedE = weak_odr dllexport global i32 1, comdat, align 4 +// MSC-DAG: @"??$VarTmpl@UExplicitInst_Exported@@@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4 +// GNU-DAG: @_Z7VarTmplI21ExplicitInst_ExportedE = weak_odr dso_local dllexport global i32 1, comdat, align 4 template __declspec(dllexport) int VarTmpl<ExplicitInst_Exported>; // Export specialization of a non-exported variable template. -// MSC-DAG: @"\01??$VarTmpl@UExplicitSpec_Exported@@@@3HA" = dllexport global i32 0, align 4 -// GNU-DAG: @_Z7VarTmplI21ExplicitSpec_ExportedE = dllexport global i32 0, align 4 +// MSC-DAG: @"??$VarTmpl@UExplicitSpec_Exported@@@@3HA" = dso_local dllexport global i32 0, align 4 +// GNU-DAG: @_Z7VarTmplI21ExplicitSpec_ExportedE = dso_local dllexport global i32 0, align 4 template<> __declspec(dllexport) int VarTmpl<ExplicitSpec_Exported>; -// MSC-DAG: @"\01??$VarTmpl@UExplicitSpec_Def_Exported@@@@3HA" = dllexport global i32 1, align 4 -// GNU-DAG: @_Z7VarTmplI25ExplicitSpec_Def_ExportedE = dllexport global i32 1, align 4 +// MSC-DAG: @"??$VarTmpl@UExplicitSpec_Def_Exported@@@@3HA" = dso_local dllexport global i32 1, align 4 +// GNU-DAG: @_Z7VarTmplI25ExplicitSpec_Def_ExportedE = dso_local dllexport global i32 1, align 4 template<> __declspec(dllexport) int VarTmpl<ExplicitSpec_Def_Exported> = 1; @@ -213,46 +247,46 @@ template<> __declspec(dllexport) int VarTmpl<ExplicitSpec_Def_Exported> = 1; // Declarations are not exported. // Export function definition. -// MSC-DAG: define dllexport void @"\01?def@@YAXXZ"() -// GNU-DAG: define dllexport void @_Z3defv() +// MSC-DAG: define dso_local dllexport void @"?def@@YAXXZ"() +// GNU-DAG: define dso_local dllexport void @_Z3defv() __declspec(dllexport) void def() {} // extern "C" -// MSC-DAG: define dllexport void @externC() -// GNU-DAG: define dllexport void @externC() +// MSC-DAG: define dso_local dllexport void @externC() +// GNU-DAG: define dso_local dllexport void @externC() extern "C" __declspec(dllexport) void externC() {} // Export inline function. -// MSC-DAG: define weak_odr dllexport void @"\01?inlineFunc@@YAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_Z10inlineFuncv() +// MSC-DAG: define weak_odr dso_local dllexport void @"?inlineFunc@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_Z10inlineFuncv() __declspec(dllexport) inline void inlineFunc() {} -// MSC-DAG: define weak_odr dllexport void @"\01?inlineDecl@@YAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_Z10inlineDeclv() +// MSC-DAG: define weak_odr dso_local dllexport void @"?inlineDecl@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_Z10inlineDeclv() __declspec(dllexport) inline void inlineDecl(); void inlineDecl() {} -// MSC-DAG: define weak_odr dllexport void @"\01?inlineDef@@YAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_Z9inlineDefv() +// MSC-DAG: define weak_odr dso_local dllexport void @"?inlineDef@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_Z9inlineDefv() __declspec(dllexport) void inlineDef(); inline void inlineDef() {} // Redeclarations -// MSC-DAG: define dllexport void @"\01?redecl1@@YAXXZ"() -// GNU-DAG: define dllexport void @_Z7redecl1v() +// MSC-DAG: define dso_local dllexport void @"?redecl1@@YAXXZ"() +// GNU-DAG: define dso_local dllexport void @_Z7redecl1v() __declspec(dllexport) void redecl1(); __declspec(dllexport) void redecl1() {} -// MSC-DAG: define dllexport void @"\01?redecl2@@YAXXZ"() -// GNU-DAG: define dllexport void @_Z7redecl2v() +// MSC-DAG: define dso_local dllexport void @"?redecl2@@YAXXZ"() +// GNU-DAG: define dso_local dllexport void @_Z7redecl2v() __declspec(dllexport) void redecl2(); void redecl2() {} // Friend functions -// MSC-DAG: define dllexport void @"\01?friend1@@YAXXZ"() -// GNU-DAG: define dllexport void @_Z7friend1v() -// MSC-DAG: define dllexport void @"\01?friend2@@YAXXZ"() -// GNU-DAG: define dllexport void @_Z7friend2v() +// MSC-DAG: define dso_local dllexport void @"?friend1@@YAXXZ"() +// GNU-DAG: define dso_local dllexport void @_Z7friend1v() +// MSC-DAG: define dso_local dllexport void @"?friend2@@YAXXZ"() +// GNU-DAG: define dso_local dllexport void @_Z7friend2v() struct FuncFriend { friend __declspec(dllexport) void friend1(); friend __declspec(dllexport) void friend2(); @@ -260,14 +294,24 @@ struct FuncFriend { __declspec(dllexport) void friend1() {} void friend2() {} +// MSC-DAG: define dso_local dllexport void @"?func@Befriended@@SAXXZ"() +// GNU-DAG: define dso_local dllexport void @_ZN10Befriended4funcEv() +struct __declspec(dllexport) Befriended { + static void func(); + struct Befriending { + friend void Befriended::func(); + }; +}; +void Befriended::func() {} + // Implicit declarations can be redeclared with dllexport. -// MSC-DAG: define dllexport noalias i8* @"\01??2@{{YAPAXI|YAPEAX_K}}@Z"( -// GNU-DAG: define dllexport noalias i8* @_Znw{{[yj]}}( +// MSC-DAG: define dso_local dllexport noalias i8* @"??2@{{YAPAXI|YAPEAX_K}}@Z"( +// GNU-DAG: define dso_local dllexport noalias i8* @_Znw{{[yj]}}( void* alloc(__SIZE_TYPE__ n); __declspec(dllexport) void* operator new(__SIZE_TYPE__ n) { return alloc(n); } -// MSC-DAG: define dllexport void @"\01?externalFunc@ns@@YAXXZ"() -// GNU-DAG: define dllexport void @_ZN2ns12externalFuncEv() +// MSC-DAG: define dso_local dllexport void @"?externalFunc@ns@@YAXXZ"() +// GNU-DAG: define dso_local dllexport void @_ZN2ns12externalFuncEv() namespace ns { __declspec(dllexport) void externalFunc() {} } @@ -277,60 +321,60 @@ namespace ns { __declspec(dllexport) void externalFunc() {} } //===----------------------------------------------------------------------===// // Export function template definition. -// MSC-DAG: define weak_odr dllexport void @"\01??$funcTmplDef@UExplicitInst_Exported@@@@YAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_Z11funcTmplDefI21ExplicitInst_ExportedEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$funcTmplDef@UExplicitInst_Exported@@@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_Z11funcTmplDefI21ExplicitInst_ExportedEvv() template<typename T> __declspec(dllexport) void funcTmplDef() {} INST(funcTmplDef<ExplicitInst_Exported>) // Export inline function template. -// MSC-DAG: define weak_odr dllexport void @"\01??$inlineFuncTmpl1@UExplicitInst_Exported@@@@YAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_Z15inlineFuncTmpl1I21ExplicitInst_ExportedEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$inlineFuncTmpl1@UExplicitInst_Exported@@@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_Z15inlineFuncTmpl1I21ExplicitInst_ExportedEvv() template<typename T> __declspec(dllexport) inline void inlineFuncTmpl1() {} INST(inlineFuncTmpl1<ExplicitInst_Exported>) -// MSC-DAG: define weak_odr dllexport void @"\01??$inlineFuncTmpl2@UExplicitInst_Exported@@@@YAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_Z15inlineFuncTmpl2I21ExplicitInst_ExportedEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$inlineFuncTmpl2@UExplicitInst_Exported@@@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_Z15inlineFuncTmpl2I21ExplicitInst_ExportedEvv() template<typename T> inline void __attribute__((dllexport)) inlineFuncTmpl2() {} INST(inlineFuncTmpl2<ExplicitInst_Exported>) -// MSC-DAG: define weak_odr dllexport void @"\01??$inlineFuncTmplDecl@UExplicitInst_Exported@@@@YAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_Z18inlineFuncTmplDeclI21ExplicitInst_ExportedEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$inlineFuncTmplDecl@UExplicitInst_Exported@@@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_Z18inlineFuncTmplDeclI21ExplicitInst_ExportedEvv() template<typename T> __declspec(dllexport) inline void inlineFuncTmplDecl(); template<typename T> void inlineFuncTmplDecl() {} INST(inlineFuncTmplDecl<ExplicitInst_Exported>) -// MSC-DAG: define weak_odr dllexport void @"\01??$inlineFuncTmplDef@UExplicitInst_Exported@@@@YAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_Z17inlineFuncTmplDefI21ExplicitInst_ExportedEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$inlineFuncTmplDef@UExplicitInst_Exported@@@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_Z17inlineFuncTmplDefI21ExplicitInst_ExportedEvv() template<typename T> __declspec(dllexport) void inlineFuncTmplDef(); template<typename T> inline void inlineFuncTmplDef() {} INST(inlineFuncTmplDef<ExplicitInst_Exported>) // Redeclarations -// MSC-DAG: define weak_odr dllexport void @"\01??$funcTmplRedecl1@UExplicitInst_Exported@@@@YAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_Z15funcTmplRedecl1I21ExplicitInst_ExportedEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$funcTmplRedecl1@UExplicitInst_Exported@@@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_Z15funcTmplRedecl1I21ExplicitInst_ExportedEvv() template<typename T> __declspec(dllexport) void funcTmplRedecl1(); template<typename T> __declspec(dllexport) void funcTmplRedecl1() {} INST(funcTmplRedecl1<ExplicitInst_Exported>) -// MSC-DAG: define weak_odr dllexport void @"\01??$funcTmplRedecl2@UExplicitInst_Exported@@@@YAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_Z15funcTmplRedecl2I21ExplicitInst_ExportedEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$funcTmplRedecl2@UExplicitInst_Exported@@@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_Z15funcTmplRedecl2I21ExplicitInst_ExportedEvv() template<typename T> __declspec(dllexport) void funcTmplRedecl2(); template<typename T> void funcTmplRedecl2() {} INST(funcTmplRedecl2<ExplicitInst_Exported>) -// MSC-DAG: define weak_odr dllexport void @"\01??$funcTmplRedecl3@UExplicitInst_Exported@@@@YAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_Z15funcTmplRedecl3I21ExplicitInst_ExportedEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$funcTmplRedecl3@UExplicitInst_Exported@@@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_Z15funcTmplRedecl3I21ExplicitInst_ExportedEvv() template<typename T> __declspec(dllexport) void funcTmplRedecl3(); template<typename T> void funcTmplRedecl3() {} INST(funcTmplRedecl3<ExplicitInst_Exported>) // Function template friends -// MSC-DAG: define weak_odr dllexport void @"\01??$funcTmplFriend1@UExplicitInst_Exported@@@@YAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_Z15funcTmplFriend1I21ExplicitInst_ExportedEvv() -// MSC-DAG: define weak_odr dllexport void @"\01??$funcTmplFriend2@UExplicitInst_Exported@@@@YAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_Z15funcTmplFriend2I21ExplicitInst_ExportedEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$funcTmplFriend1@UExplicitInst_Exported@@@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_Z15funcTmplFriend1I21ExplicitInst_ExportedEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$funcTmplFriend2@UExplicitInst_Exported@@@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_Z15funcTmplFriend2I21ExplicitInst_ExportedEvv() struct FuncTmplFriend { template<typename T> friend __declspec(dllexport) void funcTmplFriend1(); template<typename T> friend __declspec(dllexport) void funcTmplFriend2(); @@ -340,8 +384,8 @@ template<typename T> void funcTmplFriend2() {} INST(funcTmplFriend1<ExplicitInst_Exported>) INST(funcTmplFriend2<ExplicitInst_Exported>) -// MSC-DAG: define weak_odr dllexport void @"\01??$externalFuncTmpl@UExplicitInst_Exported@@@ns@@YAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_ZN2ns16externalFuncTmplI21ExplicitInst_ExportedEEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$externalFuncTmpl@UExplicitInst_Exported@@@ns@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_ZN2ns16externalFuncTmplI21ExplicitInst_ExportedEEvv() namespace ns { template<typename T> __declspec(dllexport) void externalFuncTmpl() {} } INST(ns::externalFuncTmpl<ExplicitInst_Exported>) @@ -350,55 +394,55 @@ template<typename T> void funcTmpl() {} template<typename T> __declspec(dllexport) void exportedFuncTmpl() {} // Export implicit instantiation of an exported function template. -// MSC-DAG: define weak_odr dllexport void @"\01??$exportedFuncTmpl@UImplicitInst_Exported@@@@YAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_Z16exportedFuncTmplI21ImplicitInst_ExportedEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$exportedFuncTmpl@UImplicitInst_Exported@@@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_Z16exportedFuncTmplI21ImplicitInst_ExportedEvv() USE(exportedFuncTmpl<ImplicitInst_Exported>) // Export explicit instantiation declaration of an exported function template. -// MSC-DAG: define weak_odr dllexport void @"\01??$exportedFuncTmpl@UExplicitDecl_Exported@@@@YAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_Z16exportedFuncTmplI21ExplicitDecl_ExportedEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$exportedFuncTmpl@UExplicitDecl_Exported@@@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_Z16exportedFuncTmplI21ExplicitDecl_ExportedEvv() extern template void exportedFuncTmpl<ExplicitDecl_Exported>(); template void exportedFuncTmpl<ExplicitDecl_Exported>(); // Export explicit instantiation definition of an exported function template. -// MSC-DAG: define weak_odr dllexport void @"\01??$exportedFuncTmpl@UExplicitInst_Exported@@@@YAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_Z16exportedFuncTmplI21ExplicitInst_ExportedEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$exportedFuncTmpl@UExplicitInst_Exported@@@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_Z16exportedFuncTmplI21ExplicitInst_ExportedEvv() template void exportedFuncTmpl<ExplicitInst_Exported>(); // Export specialization of an exported function template. -// MSC-DAG: define dllexport void @"\01??$exportedFuncTmpl@UExplicitSpec_Def_Exported@@@@YAXXZ"() -// GNU-DAG: define dllexport void @_Z16exportedFuncTmplI25ExplicitSpec_Def_ExportedEvv() +// MSC-DAG: define dso_local dllexport void @"??$exportedFuncTmpl@UExplicitSpec_Def_Exported@@@@YAXXZ"() +// GNU-DAG: define dso_local dllexport void @_Z16exportedFuncTmplI25ExplicitSpec_Def_ExportedEvv() template<> __declspec(dllexport) void exportedFuncTmpl<ExplicitSpec_Def_Exported>() {} -// MSC-DAG: define weak_odr dllexport void @"\01??$exportedFuncTmpl@UExplicitSpec_InlineDef_Exported@@@@YAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_Z16exportedFuncTmplI31ExplicitSpec_InlineDef_ExportedEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$exportedFuncTmpl@UExplicitSpec_InlineDef_Exported@@@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_Z16exportedFuncTmplI31ExplicitSpec_InlineDef_ExportedEvv() template<> __declspec(dllexport) inline void exportedFuncTmpl<ExplicitSpec_InlineDef_Exported>() {} // Not exporting specialization of an exported function template without // explicit dllexport. -// MSC-DAG: define void @"\01??$exportedFuncTmpl@UExplicitSpec_NotExported@@@@YAXXZ"() -// GNU-DAG: define void @_Z16exportedFuncTmplI24ExplicitSpec_NotExportedEvv() +// MSC-DAG: define dso_local void @"??$exportedFuncTmpl@UExplicitSpec_NotExported@@@@YAXXZ"() +// GNU-DAG: define dso_local void @_Z16exportedFuncTmplI24ExplicitSpec_NotExportedEvv() template<> void exportedFuncTmpl<ExplicitSpec_NotExported>() {} // Export explicit instantiation declaration of a non-exported function template. -// MSC-DAG: define weak_odr dllexport void @"\01??$funcTmpl@UExplicitDecl_Exported@@@@YAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_Z8funcTmplI21ExplicitDecl_ExportedEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$funcTmpl@UExplicitDecl_Exported@@@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_Z8funcTmplI21ExplicitDecl_ExportedEvv() extern template __declspec(dllexport) void funcTmpl<ExplicitDecl_Exported>(); template __declspec(dllexport) void funcTmpl<ExplicitDecl_Exported>(); // Export explicit instantiation definition of a non-exported function template. -// MSC-DAG: define weak_odr dllexport void @"\01??$funcTmpl@UExplicitInst_Exported@@@@YAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_Z8funcTmplI21ExplicitInst_ExportedEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$funcTmpl@UExplicitInst_Exported@@@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_Z8funcTmplI21ExplicitInst_ExportedEvv() template __declspec(dllexport) void funcTmpl<ExplicitInst_Exported>(); // Export specialization of a non-exported function template. -// MSC-DAG: define dllexport void @"\01??$funcTmpl@UExplicitSpec_Def_Exported@@@@YAXXZ"() -// GNU-DAG: define dllexport void @_Z8funcTmplI25ExplicitSpec_Def_ExportedEvv() +// MSC-DAG: define dso_local dllexport void @"??$funcTmpl@UExplicitSpec_Def_Exported@@@@YAXXZ"() +// GNU-DAG: define dso_local dllexport void @_Z8funcTmplI25ExplicitSpec_Def_ExportedEvv() template<> __declspec(dllexport) void funcTmpl<ExplicitSpec_Def_Exported>() {} -// MSC-DAG: define weak_odr dllexport void @"\01??$funcTmpl@UExplicitSpec_InlineDef_Exported@@@@YAXXZ"() -// GNU-DAG: define weak_odr dllexport void @_Z8funcTmplI31ExplicitSpec_InlineDef_ExportedEvv() +// MSC-DAG: define weak_odr dso_local dllexport void @"??$funcTmpl@UExplicitSpec_InlineDef_Exported@@@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local dllexport void @_Z8funcTmplI31ExplicitSpec_InlineDef_ExportedEvv() template<> __declspec(dllexport) inline void funcTmpl<ExplicitSpec_InlineDef_Exported>() {} @@ -408,61 +452,61 @@ template<> __declspec(dllexport) inline void funcTmpl<ExplicitSpec_InlineDef_Exp //===----------------------------------------------------------------------===// // dllexport takes precedence over the dllimport if both are specified. -// MSC-DAG: @"\01?PrecedenceGlobal1A@@3HA" = dllexport global i32 0, align 4 -// MSC-DAG: @"\01?PrecedenceGlobal1B@@3HA" = dllexport global i32 0, align 4 -// GNU-DAG: @PrecedenceGlobal1A = dllexport global i32 0, align 4 -// GNU-DAG: @PrecedenceGlobal1B = dllexport global i32 0, align 4 +// MSC-DAG: @"?PrecedenceGlobal1A@@3HA" = dso_local dllexport global i32 0, align 4 +// MSC-DAG: @"?PrecedenceGlobal1B@@3HA" = dso_local dllexport global i32 0, align 4 +// GNU-DAG: @PrecedenceGlobal1A = dso_local dllexport global i32 0, align 4 +// GNU-DAG: @PrecedenceGlobal1B = dso_local dllexport global i32 0, align 4 __attribute__((dllimport, dllexport)) int PrecedenceGlobal1A; // dllimport ignored __declspec(dllimport) __declspec(dllexport) int PrecedenceGlobal1B; // dllimport ignored -// MSC-DAG: @"\01?PrecedenceGlobal2A@@3HA" = dllexport global i32 0, align 4 -// MSC-DAG: @"\01?PrecedenceGlobal2B@@3HA" = dllexport global i32 0, align 4 -// GNU-DAG: @PrecedenceGlobal2A = dllexport global i32 0, align 4 -// GNU-DAG: @PrecedenceGlobal2B = dllexport global i32 0, align 4 +// MSC-DAG: @"?PrecedenceGlobal2A@@3HA" = dso_local dllexport global i32 0, align 4 +// MSC-DAG: @"?PrecedenceGlobal2B@@3HA" = dso_local dllexport global i32 0, align 4 +// GNU-DAG: @PrecedenceGlobal2A = dso_local dllexport global i32 0, align 4 +// GNU-DAG: @PrecedenceGlobal2B = dso_local dllexport global i32 0, align 4 __attribute__((dllexport, dllimport)) int PrecedenceGlobal2A; // dllimport ignored __declspec(dllexport) __declspec(dllimport) int PrecedenceGlobal2B; // dllimport ignored -// MSC-DAG: @"\01?PrecedenceGlobalRedecl1@@3HA" = dllexport global i32 0, align 4 -// GNU-DAG: @PrecedenceGlobalRedecl1 = dllexport global i32 0, align 4 +// MSC-DAG: @"?PrecedenceGlobalRedecl1@@3HA" = dso_local dllexport global i32 0, align 4 +// GNU-DAG: @PrecedenceGlobalRedecl1 = dso_local dllexport global i32 0, align 4 __declspec(dllexport) extern int PrecedenceGlobalRedecl1; __declspec(dllimport) int PrecedenceGlobalRedecl1 = 0; -// MSC-DAG: @"\01?PrecedenceGlobalRedecl2@@3HA" = dllexport global i32 0, align 4 -// GNU-DAG: @PrecedenceGlobalRedecl2 = dllexport global i32 0, align 4 +// MSC-DAG: @"?PrecedenceGlobalRedecl2@@3HA" = dso_local dllexport global i32 0, align 4 +// GNU-DAG: @PrecedenceGlobalRedecl2 = dso_local dllexport global i32 0, align 4 __declspec(dllimport) extern int PrecedenceGlobalRedecl2; __declspec(dllexport) int PrecedenceGlobalRedecl2; -// MSC-DAG: @"\01?PrecedenceGlobalMixed1@@3HA" = dllexport global i32 0, align 4 -// GNU-DAG: @PrecedenceGlobalMixed1 = dllexport global i32 0, align 4 +// MSC-DAG: @"?PrecedenceGlobalMixed1@@3HA" = dso_local dllexport global i32 0, align 4 +// GNU-DAG: @PrecedenceGlobalMixed1 = dso_local dllexport global i32 0, align 4 __attribute__((dllexport)) extern int PrecedenceGlobalMixed1; __declspec(dllimport) int PrecedenceGlobalMixed1 = 0; -// MSC-DAG: @"\01?PrecedenceGlobalMixed2@@3HA" = dllexport global i32 0, align 4 -// GNU-DAG: @PrecedenceGlobalMixed2 = dllexport global i32 0, align 4 +// MSC-DAG: @"?PrecedenceGlobalMixed2@@3HA" = dso_local dllexport global i32 0, align 4 +// GNU-DAG: @PrecedenceGlobalMixed2 = dso_local dllexport global i32 0, align 4 __attribute__((dllimport)) extern int PrecedenceGlobalMixed2; __declspec(dllexport) int PrecedenceGlobalMixed2; -// MSC-DAG: define dllexport void @"\01?precedence1A@@YAXXZ" -// MSC-DAG: define dllexport void @"\01?precedence1B@@YAXXZ" -// GNU-DAG: define dllexport void @_Z12precedence1Av() -// GNU-DAG: define dllexport void @_Z12precedence1Bv() +// MSC-DAG: define dso_local dllexport void @"?precedence1A@@YAXXZ" +// MSC-DAG: define dso_local dllexport void @"?precedence1B@@YAXXZ" +// GNU-DAG: define dso_local dllexport void @_Z12precedence1Av() +// GNU-DAG: define dso_local dllexport void @_Z12precedence1Bv() void __attribute__((dllimport, dllexport)) precedence1A() {} void __declspec(dllimport) __declspec(dllexport) precedence1B() {} -// MSC-DAG: define dllexport void @"\01?precedence2A@@YAXXZ" -// MSC-DAG: define dllexport void @"\01?precedence2B@@YAXXZ" -// GNU-DAG: define dllexport void @_Z12precedence2Av() -// GNU-DAG: define dllexport void @_Z12precedence2Bv() +// MSC-DAG: define dso_local dllexport void @"?precedence2A@@YAXXZ" +// MSC-DAG: define dso_local dllexport void @"?precedence2B@@YAXXZ" +// GNU-DAG: define dso_local dllexport void @_Z12precedence2Av() +// GNU-DAG: define dso_local dllexport void @_Z12precedence2Bv() void __attribute__((dllexport, dllimport)) precedence2A() {} void __declspec(dllexport) __declspec(dllimport) precedence2B() {} -// MSC-DAG: define dllexport void @"\01?precedenceRedecl1@@YAXXZ" -// GNU-DAG: define dllexport void @_Z17precedenceRedecl1v() +// MSC-DAG: define dso_local dllexport void @"?precedenceRedecl1@@YAXXZ" +// GNU-DAG: define dso_local dllexport void @_Z17precedenceRedecl1v() void __declspec(dllimport) precedenceRedecl1(); void __declspec(dllexport) precedenceRedecl1() {} -// MSC-DAG: define dllexport void @"\01?precedenceRedecl2@@YAXXZ" -// GNU-DAG: define dllexport void @_Z17precedenceRedecl2v() +// MSC-DAG: define dso_local dllexport void @"?precedenceRedecl2@@YAXXZ" +// GNU-DAG: define dso_local dllexport void @_Z17precedenceRedecl2v() void __declspec(dllexport) precedenceRedecl2(); void __declspec(dllimport) precedenceRedecl2() {} @@ -474,11 +518,11 @@ void __declspec(dllimport) precedenceRedecl2() {} struct S { void __declspec(dllexport) a() {} - // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?a@S@@QAEXXZ" + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?a@S@@QAEXXZ" struct T { void __declspec(dllexport) a() {} - // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?a@T@S@@QAEXXZ" + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?a@T@S@@QAEXXZ" }; }; @@ -487,11 +531,11 @@ struct SomeTemplate { SomeTemplate(T o = T()) : o(o) {} T o; }; -// MSVC2015-DAG: define weak_odr dllexport {{.+}} @"\01??4?$SomeTemplate@H@@Q{{.+}}@$$Q{{.+}}@@Z" -// MSVC2013-DAG: define weak_odr dllexport {{.+}} @"\01??4?$SomeTemplate@H@@Q{{.+}}0@A{{.+}}0@@Z" +// MSVC2015-DAG: define weak_odr dso_local dllexport {{.+}} @"??4?$SomeTemplate@H@@Q{{.+}}@$$Q{{.+}}@@Z" +// MSVC2013-DAG: define weak_odr dso_local dllexport {{.+}} @"??4?$SomeTemplate@H@@Q{{.+}}0@A{{.+}}0@@Z" struct __declspec(dllexport) InheritFromTemplate : SomeTemplate<int> {}; -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??_F?$SomeTemplate@H@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"??_F?$SomeTemplate@H@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat namespace PR23801 { template <typename> @@ -508,32 +552,32 @@ struct __declspec(dllexport) B { } // -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??_FB@PR23801@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"??_FB@PR23801@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat struct __declspec(dllexport) T { // Copy assignment operator: - // M32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.T* @"\01??4T@@QAEAAU0@ABU0@@Z" + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.T* @"??4T@@QAEAAU0@ABU0@@Z" // Explicitly defaulted copy constructur: T(const T&) = default; - // M32MSVC2013-DAG: define weak_odr dllexport x86_thiscallcc %struct.T* @"\01??0T@@QAE@ABU0@@Z" + // M32MSVC2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.T* @"??0T@@QAE@ABU0@@Z" void a() {} - // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?a@T@@QAEXXZ" + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?a@T@@QAEXXZ" static int b; - // M32-DAG: @"\01?b@T@@2HA" = external global i32 + // M32-DAG: @"?b@T@@2HA" = external dso_local global i32 static int c; - // M32-DAG: @"\01?c@T@@2HA" = dllexport global i32 0, align 4 + // M32-DAG: @"?c@T@@2HA" = dso_local dllexport global i32 0, align 4 }; USEVAR(T::b) int T::c; // Export template class with static member variable -// MSC-DAG: @"\01?StaticClassVarExpTmplClass@?$TmplClass@H@@2HA" = weak_odr dllexport global i32 0, comdat, align 4 -// GNU-DAG: @_ZN9TmplClassIiE26StaticClassVarExpTmplClassE = weak_odr dllexport global i32 0, comdat, align 4 +// MSC-DAG: @"?StaticClassVarExpTmplClass@?$TmplClass@H@@2HA" = weak_odr dso_local dllexport global i32 0, comdat, align 4 +// GNU-DAG: @_ZN9TmplClassIiE26StaticClassVarExpTmplClassE = weak_odr dso_local dllexport global i32 0, comdat, align 4 template<typename T> struct __declspec(dllexport) TmplClass { @@ -544,8 +588,8 @@ template<typename T> T TmplClass<T>::StaticClassVarExpTmplClass; // Export a definition of a template function. -// MSC-DAG: define weak_odr dllexport i32 @"\01??$TypeFunTmpl@H@@YAHH@Z" -// GNU-DAG: define weak_odr dllexport i32 @_Z11TypeFunTmplIiET_S0_ +// MSC-DAG: define weak_odr dso_local dllexport i32 @"??$TypeFunTmpl@H@@YAHH@Z" +// GNU-DAG: define weak_odr dso_local dllexport i32 @_Z11TypeFunTmplIiET_S0_ template<typename T> T __declspec(dllexport) TypeFunTmpl(T t) { return t + t; } @@ -558,38 +602,38 @@ int useExportedTmplStaticAndFun() template <typename T> struct __declspec(dllexport) U { void foo() {} }; struct __declspec(dllexport) V : public U<int> { }; // U<int>'s assignment operator is emitted. -// M32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.U* @"\01??4?$U@H@@QAEAAU0@ABU0@@Z" +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.U* @"??4?$U@H@@QAEAAU0@ABU0@@Z" struct __declspec(dllexport) W { virtual void foo(); }; void W::foo() {} // Default ctor: -// M32-DAG: define weak_odr dllexport x86_thiscallcc %struct.W* @"\01??0W@@QAE@XZ" +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.W* @"??0W@@QAE@XZ" // Copy ctor: -// M32-DAG: define weak_odr dllexport x86_thiscallcc %struct.W* @"\01??0W@@QAE@ABU0@@Z" +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.W* @"??0W@@QAE@ABU0@@Z" // vftable: -// M32-DAG: [[W_VTABLE:@.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (%rtti.CompleteObjectLocator* @"\01??_R4W@@6B@" to i8*), i8* bitcast (void (%struct.W*)* @"\01?foo@W@@UAEXXZ" to i8*)] }, comdat($"\01??_7W@@6B@") -// M32-DAG: @"\01??_7W@@6B@" = dllexport unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* [[W_VTABLE]], i32 0, i32 0, i32 1) -// G32-DAG: @_ZTV1W = dllexport unnamed_addr constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @_ZTI1W to i8*), i8* bitcast (void (%struct.W*)* @_ZN1W3fooEv to i8*)] } +// M32-DAG: [[W_VTABLE:@.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (%rtti.CompleteObjectLocator* @"??_R4W@@6B@" to i8*), i8* bitcast (void (%struct.W*)* @"?foo@W@@UAEXXZ" to i8*)] }, comdat($"??_7W@@6B@") +// M32-DAG: @"??_7W@@6B@" = dllexport unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* [[W_VTABLE]], i32 0, i32 0, i32 1) +// G32-DAG: @_ZTV1W = dso_local dllexport unnamed_addr constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @_ZTI1W to i8*), i8* bitcast (void (%struct.W*)* @_ZN1W3fooEv to i8*)] } struct __declspec(dllexport) X : public virtual W {}; // vbtable: -// M32-DAG: @"\01??_8X@@7B@" = weak_odr dllexport unnamed_addr constant [2 x i32] [i32 0, i32 4] +// M32-DAG: @"??_8X@@7B@" = weak_odr dllexport unnamed_addr constant [2 x i32] [i32 0, i32 4] struct __declspec(dllexport) Y { // Move assignment operator: - // MSVC2015-DAG: define weak_odr dllexport {{.+}} @"\01??4Y@@Q{{.+}}@$$Q{{.+}}@@Z" - // MSVC2013-DAG: define weak_odr dllexport {{.+}} @"\01??4Y@@Q{{.+}}0@A{{.+}}0@@Z" + // MSVC2015-DAG: define weak_odr dso_local dllexport {{.+}} @"??4Y@@Q{{.+}}@$$Q{{.+}}@@Z" + // MSVC2013-DAG: define weak_odr dso_local dllexport {{.+}} @"??4Y@@Q{{.+}}0@A{{.+}}0@@Z" int x; }; struct __declspec(dllexport) Z { virtual ~Z() {} }; // The scalar deleting dtor does not get exported: -// M32-DAG: define linkonce_odr x86_thiscallcc i8* @"\01??_GZ@@UAEPAXI@Z" +// M32-DAG: define linkonce_odr dso_local x86_thiscallcc i8* @"??_GZ@@UAEPAXI@Z" // The user-defined dtor does get exported: -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??1Z@@UAE@XZ" +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"??1Z@@UAE@XZ" namespace UseDtorAlias { struct __declspec(dllexport) A { ~A(); }; @@ -597,39 +641,39 @@ namespace UseDtorAlias { A::~A() { } B::~B() { } // Emit a alias definition of B's constructor. - // M32-DAG: @"\01??1B@UseDtorAlias@@QAE@XZ" = dllexport alias {{.*}} @"\01??1A@UseDtorAlias@@QAE@XZ" + // M32-DAG: @"??1B@UseDtorAlias@@QAE@XZ" = dso_local dllexport unnamed_addr alias {{.*}} @"??1A@UseDtorAlias@@QAE@XZ" } struct __declspec(dllexport) DefaultedCtorsDtors { DefaultedCtorsDtors() = default; - // M32MSVC2013-DAG: define weak_odr dllexport x86_thiscallcc %struct.DefaultedCtorsDtors* @"\01??0DefaultedCtorsDtors@@QAE@XZ" + // M32MSVC2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.DefaultedCtorsDtors* @"??0DefaultedCtorsDtors@@QAE@XZ" ~DefaultedCtorsDtors() = default; - // M32MSVC2013-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??1DefaultedCtorsDtors@@QAE@XZ" + // M32MSVC2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"??1DefaultedCtorsDtors@@QAE@XZ" }; // Export defaulted member function definitions declared inside class. struct __declspec(dllexport) ExportDefaultedInclassDefs { ExportDefaultedInclassDefs() = default; - // M32VS2013-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE@XZ"(%struct.ExportDefaultedInclassDefs* returned %this) - // M64VS2013-DAG: define weak_odr dllexport %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA@XZ"(%struct.ExportDefaultedInclassDefs* returned %this) - // M32VS2015-NOT: define weak_odr dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE@XZ"(%struct.ExportDefaultedInclassDefs* returned %this) - // M64VS2015-NOT: define weak_odr dllexport %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA@XZ"(%struct.ExportDefaultedInclassDefs* returned %this) + // M32VS2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QAE@XZ"(%struct.ExportDefaultedInclassDefs* returned %this) + // M64VS2013-DAG: define weak_odr dso_local dllexport %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QEAA@XZ"(%struct.ExportDefaultedInclassDefs* returned %this) + // M32VS2015-NOT: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QAE@XZ"(%struct.ExportDefaultedInclassDefs* returned %this) + // M64VS2015-NOT: define weak_odr dso_local dllexport %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QEAA@XZ"(%struct.ExportDefaultedInclassDefs* returned %this) ~ExportDefaultedInclassDefs() = default; - // M32VS2013-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??1ExportDefaultedInclassDefs@@QAE@XZ"(%struct.ExportDefaultedInclassDefs* %this) - // M64VS2013-DAG: define weak_odr dllexport void @"\01??1ExportDefaultedInclassDefs@@QEAA@XZ"(%struct.ExportDefaultedInclassDefs* %this) - // M32VS2015-NOT: define weak_odr dllexport x86_thiscallcc void @"\01??1ExportDefaultedInclassDefs@@QAE@XZ"(%struct.ExportDefaultedInclassDefs* %this) - // M64VS2015-NOT: define weak_odr dllexport void @"\01??1ExportDefaultedInclassDefs@@QEAA@XZ"(%struct.ExportDefaultedInclassDefs* %this) + // M32VS2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"??1ExportDefaultedInclassDefs@@QAE@XZ"(%struct.ExportDefaultedInclassDefs* %this) + // M64VS2013-DAG: define weak_odr dso_local dllexport void @"??1ExportDefaultedInclassDefs@@QEAA@XZ"(%struct.ExportDefaultedInclassDefs* %this) + // M32VS2015-NOT: define weak_odr dso_local dllexport x86_thiscallcc void @"??1ExportDefaultedInclassDefs@@QAE@XZ"(%struct.ExportDefaultedInclassDefs* %this) + // M64VS2015-NOT: define weak_odr dso_local dllexport void @"??1ExportDefaultedInclassDefs@@QEAA@XZ"(%struct.ExportDefaultedInclassDefs* %this) ExportDefaultedInclassDefs(const ExportDefaultedInclassDefs&) = default; - // M32VS2013-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE@ABU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) - // M64VS2013-DAG: define weak_odr dllexport %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA@AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) - // M32VS2015-NOT: define weak_odr dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE@ABU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) - // M64VS2015-NOT: define weak_odr dllexport %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA@AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) + // M32VS2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QAE@ABU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) + // M64VS2013-DAG: define weak_odr dso_local dllexport %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QEAA@AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) + // M32VS2015-NOT: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QAE@ABU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) + // M64VS2015-NOT: define weak_odr dso_local dllexport %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QEAA@AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) ExportDefaultedInclassDefs& operator=(const ExportDefaultedInclassDefs&) = default; - // M32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"\01??4ExportDefaultedInclassDefs@@QAEAAU0@ABU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) - // M64-DAG: define weak_odr dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"\01??4ExportDefaultedInclassDefs@@QEAAAEAU0@AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"??4ExportDefaultedInclassDefs@@QAEAAU0@ABU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) + // M64-DAG: define weak_odr dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"??4ExportDefaultedInclassDefs@@QEAAAEAU0@AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}})) }; namespace ReferencedInlineMethodInNestedClass { @@ -642,8 +686,8 @@ namespace ReferencedInlineMethodInNestedClass { }; T *t; }; - // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?foo@S@ReferencedInlineMethodInNestedClass@@QAEXXZ" - // M32-DAG: define linkonce_odr x86_thiscallcc void @"\01?bar@T@S@ReferencedInlineMethodInNestedClass@@QAEXXZ" + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?foo@S@ReferencedInlineMethodInNestedClass@@QAEXXZ" + // M32-DAG: define linkonce_odr dso_local x86_thiscallcc void @"?bar@T@S@ReferencedInlineMethodInNestedClass@@QAEXXZ" } // MS ignores DLL attributes on partial specializations. @@ -651,37 +695,37 @@ template <typename T> struct PartiallySpecializedClassTemplate {}; template <typename T> struct __declspec(dllexport) PartiallySpecializedClassTemplate<T*> { void f(); }; template <typename T> void PartiallySpecializedClassTemplate<T*>::f() {} USEMEMFUNC(PartiallySpecializedClassTemplate<void*>, f); -// M32-DAG: define linkonce_odr x86_thiscallcc void @"\01?f@?$PartiallySpecializedClassTemplate@PAX@@QAEXXZ" -// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN33PartiallySpecializedClassTemplateIPvE1fEv +// M32-DAG: define linkonce_odr dso_local x86_thiscallcc void @"?f@?$PartiallySpecializedClassTemplate@PAX@@QAEXXZ" +// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN33PartiallySpecializedClassTemplateIPvE1fEv // Attributes on explicit specializations are honored. template <typename T> struct ExplicitlySpecializedClassTemplate {}; template <> struct __declspec(dllexport) ExplicitlySpecializedClassTemplate<void*> { void f(); }; void ExplicitlySpecializedClassTemplate<void*>::f() {} USEMEMFUNC(ExplicitlySpecializedClassTemplate<void*>, f); -// M32-DAG: define dllexport x86_thiscallcc void @"\01?f@?$ExplicitlySpecializedClassTemplate@PAX@@QAEXXZ" -// G32-DAG: define dllexport x86_thiscallcc void @_ZN34ExplicitlySpecializedClassTemplateIPvE1fEv +// M32-DAG: define dso_local dllexport x86_thiscallcc void @"?f@?$ExplicitlySpecializedClassTemplate@PAX@@QAEXXZ" +// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN34ExplicitlySpecializedClassTemplateIPvE1fEv // MS inherits DLL attributes to partial specializations. template <typename T> struct __declspec(dllexport) PartiallySpecializedExportedClassTemplate {}; template <typename T> struct PartiallySpecializedExportedClassTemplate<T*> { void f() {} }; USEMEMFUNC(PartiallySpecializedExportedClassTemplate<void*>, f); -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?f@?$PartiallySpecializedExportedClassTemplate@PAX@@QAEXXZ" -// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN41PartiallySpecializedExportedClassTemplateIPvE1fEv +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?f@?$PartiallySpecializedExportedClassTemplate@PAX@@QAEXXZ" +// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN41PartiallySpecializedExportedClassTemplateIPvE1fEv // MS ignores DLL attributes on partial specializations; inheritance still works though. template <typename T> struct __declspec(dllexport) PartiallySpecializedExportedClassTemplate2 {}; template <typename T> struct __declspec(dllimport) PartiallySpecializedExportedClassTemplate2<T*> { void f(); }; template <typename T> void PartiallySpecializedExportedClassTemplate2<T*>::f() {} USEMEMFUNC(PartiallySpecializedExportedClassTemplate2<void*>, f); -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?f@?$PartiallySpecializedExportedClassTemplate2@PAX@@QAEXXZ" +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?f@?$PartiallySpecializedExportedClassTemplate2@PAX@@QAEXXZ" // G32-DAG: declare dllimport x86_thiscallcc void @_ZN42PartiallySpecializedExportedClassTemplate2IPvE1fEv // Attributes on the instantiation take precedence over attributes on the template. template <typename T> struct __declspec(dllimport) ExplicitlyInstantiatedWithDifferentAttr { void f() {} }; template struct __declspec(dllexport) ExplicitlyInstantiatedWithDifferentAttr<int>; USEMEMFUNC(ExplicitlyInstantiatedWithDifferentAttr<int>, f); -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?f@?$ExplicitlyInstantiatedWithDifferentAttr@H@@QAEXXZ" +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?f@?$ExplicitlyInstantiatedWithDifferentAttr@H@@QAEXXZ" // Don't create weak dllexport aliases. (PR21373) struct NonExportedBaseClass { @@ -690,62 +734,62 @@ struct NonExportedBaseClass { NonExportedBaseClass::~NonExportedBaseClass() {} struct __declspec(dllexport) ExportedDerivedClass : NonExportedBaseClass {}; -// M32-DAG: weak_odr dllexport x86_thiscallcc void @"\01??1ExportedDerivedClass@@UAE@XZ" +// M32-DAG: weak_odr dso_local dllexport x86_thiscallcc void @"??1ExportedDerivedClass@@UAE@XZ" // Do not assert about generating code for constexpr functions twice during explicit instantiation (PR21718). template <typename T> struct ExplicitInstConstexprMembers { // Copy assignment operator - // M32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable(1) %struct.ExplicitInstConstexprMembers* @"\01??4?$ExplicitInstConstexprMembers@X@@QAEAAU0@ABU0@@Z" + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable(1) %struct.ExplicitInstConstexprMembers* @"??4?$ExplicitInstConstexprMembers@X@@QAEAAU0@ABU0@@Z" constexpr ExplicitInstConstexprMembers() {} - // M32-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExplicitInstConstexprMembers* @"\01??0?$ExplicitInstConstexprMembers@X@@QAE@XZ" + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExplicitInstConstexprMembers* @"??0?$ExplicitInstConstexprMembers@X@@QAE@XZ" ExplicitInstConstexprMembers(const ExplicitInstConstexprMembers&) = default; - // M32MSVC2013-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExplicitInstConstexprMembers* @"\01??0?$ExplicitInstConstexprMembers@X@@QAE@ABU0@@Z" + // M32MSVC2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExplicitInstConstexprMembers* @"??0?$ExplicitInstConstexprMembers@X@@QAE@ABU0@@Z" constexpr int f() const { return 42; } - // M32-DAG: define weak_odr dllexport x86_thiscallcc i32 @"\01?f@?$ExplicitInstConstexprMembers@X@@QBEHXZ" + // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc i32 @"?f@?$ExplicitInstConstexprMembers@X@@QBEHXZ" }; template struct __declspec(dllexport) ExplicitInstConstexprMembers<void>; template <typename T> struct ExplicitInstantiationDeclTemplate { void f() {} }; extern template struct __declspec(dllexport) ExplicitInstantiationDeclTemplate<int>; USEMEMFUNC(ExplicitInstantiationDeclTemplate<int>, f); -// M32-DAG: {{declare|define available_externally}} x86_thiscallcc void @"\01?f@?$ExplicitInstantiationDeclTemplate@H@@QAEXXZ" +// M32-DAG: {{declare|define available_externally}} dso_local x86_thiscallcc void @"?f@?$ExplicitInstantiationDeclTemplate@H@@QAEXXZ" template <typename T> struct __declspec(dllexport) ExplicitInstantiationDeclExportedTemplate { void f() {} }; extern template struct ExplicitInstantiationDeclExportedTemplate<int>; USEMEMFUNC(ExplicitInstantiationDeclExportedTemplate<int>, f); -// M32-DAG: {{declare|define available_externally}} x86_thiscallcc void @"\01?f@?$ExplicitInstantiationDeclExportedTemplate@H@@QAEXXZ" +// M32-DAG: {{declare|define available_externally}} dso_local x86_thiscallcc void @"?f@?$ExplicitInstantiationDeclExportedTemplate@H@@QAEXXZ" template <typename T> struct ExplicitInstantiationDeclExportedDefTemplate { void f() {} ExplicitInstantiationDeclExportedDefTemplate() {} }; extern template struct ExplicitInstantiationDeclExportedDefTemplate<int>; template struct __declspec(dllexport) ExplicitInstantiationDeclExportedDefTemplate<int>; USEMEMFUNC(ExplicitInstantiationDeclExportedDefTemplate<int>, f); -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?f@?$ExplicitInstantiationDeclExportedDefTemplate@H@@QAEXXZ" -// M32-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExplicitInstantiationDeclExportedDefTemplate* @"\01??0?$ExplicitInstantiationDeclExportedDefTemplate@H@@QAE@XZ" -// G32-DAG: define weak_odr x86_thiscallcc void @_ZN44ExplicitInstantiationDeclExportedDefTemplateIiE1fEv +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?f@?$ExplicitInstantiationDeclExportedDefTemplate@H@@QAEXXZ" +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExplicitInstantiationDeclExportedDefTemplate* @"??0?$ExplicitInstantiationDeclExportedDefTemplate@H@@QAE@XZ" +// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN44ExplicitInstantiationDeclExportedDefTemplateIiE1fEv template <typename T> struct ImplicitInstantiationExportedExplicitInstantiationDefTemplate { virtual void f() {} }; ImplicitInstantiationExportedExplicitInstantiationDefTemplate<int> ImplicitInstantiationExportedExplicitInstantiationDefTemplateInstance; template struct __declspec(dllexport) ImplicitInstantiationExportedExplicitInstantiationDefTemplate<int>; USEMEMFUNC(ImplicitInstantiationExportedExplicitInstantiationDefTemplate<int>, f); -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?f@?$ImplicitInstantiationExportedExplicitInstantiationDefTemplate@H@@UAEXXZ" -// G32-DAG: define weak_odr x86_thiscallcc void @_ZN61ImplicitInstantiationExportedExplicitInstantiationDefTemplateIiE1fEv +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?f@?$ImplicitInstantiationExportedExplicitInstantiationDefTemplate@H@@UAEXXZ" +// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN61ImplicitInstantiationExportedExplicitInstantiationDefTemplateIiE1fEv template <typename T> struct __declspec(dllexport) ImplicitInstantiationExplicitInstantiationDefExportedTemplate { virtual void f() {} }; ImplicitInstantiationExplicitInstantiationDefExportedTemplate<int> ImplicitInstantiationExplicitInstantiationDefExportedTemplateInstance; template struct ImplicitInstantiationExplicitInstantiationDefExportedTemplate<int>; USEMEMFUNC(ImplicitInstantiationExplicitInstantiationDefExportedTemplate<int>, f); -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?f@?$ImplicitInstantiationExplicitInstantiationDefExportedTemplate@H@@UAEXXZ" -// G32-DAG: define weak_odr x86_thiscallcc void @_ZN61ImplicitInstantiationExplicitInstantiationDefExportedTemplateIiE1fEv +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?f@?$ImplicitInstantiationExplicitInstantiationDefExportedTemplate@H@@UAEXXZ" +// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN61ImplicitInstantiationExplicitInstantiationDefExportedTemplateIiE1fEv template <typename T> struct __declspec(dllexport) ImplicitInstantiationExportedExplicitInstantiationDefExportedTemplate { virtual void f() {} }; ImplicitInstantiationExportedExplicitInstantiationDefExportedTemplate<int> ImplicitInstantiationExportedExplicitInstantiationDefExportedTemplateInstance; template struct __declspec(dllexport) ImplicitInstantiationExportedExplicitInstantiationDefExportedTemplate<int>; USEMEMFUNC(ImplicitInstantiationExportedExplicitInstantiationDefExportedTemplate<int>, f); -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?f@?$ImplicitInstantiationExportedExplicitInstantiationDefExportedTemplate@H@@UAEXXZ" -// G32-DAG: define weak_odr x86_thiscallcc void @_ZN69ImplicitInstantiationExportedExplicitInstantiationDefExportedTemplateIiE1fEv +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?f@?$ImplicitInstantiationExportedExplicitInstantiationDefExportedTemplate@H@@UAEXXZ" +// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN69ImplicitInstantiationExportedExplicitInstantiationDefExportedTemplateIiE1fEv namespace { struct InternalLinkageType {}; } struct __declspec(dllexport) PR23308 { @@ -753,20 +797,20 @@ struct __declspec(dllexport) PR23308 { }; void PR23308::f(InternalLinkageType*) {} long use(PR23308* p) { p->f(nullptr); } -// M32-DAG: define internal x86_thiscallcc void @"\01?f@PR23308@@QAEXPAUInternalLinkageType@?A@@@Z" +// M32-DAG: define internal x86_thiscallcc void @"?f@PR23308@@QAEXPAUInternalLinkageType@?A@@@Z" template <typename T> struct PR23770BaseTemplate { void f() {} }; template <typename T> struct PR23770DerivedTemplate : PR23770BaseTemplate<int> {}; extern template struct PR23770DerivedTemplate<int>; template struct __declspec(dllexport) PR23770DerivedTemplate<int>; -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?f@?$PR23770BaseTemplate@H@@QAEXXZ" +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?f@?$PR23770BaseTemplate@H@@QAEXXZ" namespace InClassInits { struct __declspec(dllexport) S { int x = 42; }; -// M32-DAG: define weak_odr dllexport x86_thiscallcc %"struct.InClassInits::S"* @"\01??0S@InClassInits@@QAE@XZ" +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %"struct.InClassInits::S"* @"??0S@InClassInits@@QAE@XZ" // dllexport an already instantiated class template. template <typename T> struct Base { @@ -774,7 +818,7 @@ template <typename T> struct Base { }; Base<int> base; struct __declspec(dllexport) T : Base<int> { }; -// M32-DAG: define weak_odr dllexport x86_thiscallcc %"struct.InClassInits::Base"* @"\01??0?$Base@H@InClassInits@@QAE@XZ" +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %"struct.InClassInits::Base"* @"??0?$Base@H@InClassInits@@QAE@XZ" struct A { A(int); }; struct __declspec(dllexport) U { @@ -782,7 +826,7 @@ struct __declspec(dllexport) U { U(A = 0) {} int x = 0; }; -// M32-DAG: define weak_odr dllexport x86_thiscallcc %"struct.InClassInits::U"* @"\01??0U@InClassInits@@QAE@UA@1@@Z" +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %"struct.InClassInits::U"* @"??0U@InClassInits@@QAE@UA@1@@Z" struct Evil { template <typename T> struct Base { @@ -794,7 +838,7 @@ struct Evil { // the default ctor must still be delayed. struct __declspec(dllexport) T : Base<int> {}; }; -// M32-DAG: define weak_odr dllexport x86_thiscallcc %"struct.InClassInits::Evil::Base"* @"\01??0?$Base@H@Evil@InClassInits@@QAE@XZ" +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %"struct.InClassInits::Evil::Base"* @"??0?$Base@H@Evil@InClassInits@@QAE@XZ" template <typename T> struct Foo {}; template <typename T> struct Bar { @@ -806,7 +850,7 @@ struct __declspec(dllexport) Baz { // After parsing Baz, in ActOnFinishCXXNonNestedClass we would synthesize // Baz's operator=, causing instantiation of Foo<int> after which // ActOnFinishCXXNonNestedClass is called, and we would bite our own tail. -// M32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable(1) %"struct.InClassInits::Baz"* @"\01??4Baz@InClassInits@@QAEAAU01@ABU01@@Z" +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable(1) %"struct.InClassInits::Baz"* @"??4Baz@InClassInits@@QAEAAU01@ABU01@@Z" } // We had an issue where instantiating A would force emission of B's delayed @@ -817,28 +861,28 @@ struct __declspec(dllexport) B { B(int = 0) {} A<int> m_fn1() {} }; -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??_FB@pr26490@@QAEXXZ" +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"??_FB@pr26490@@QAEXXZ" } // dllexport trumps dllimport on an explicit instantiation. template <typename T> struct ExplicitInstantiationTwoAttributes { void f() {} }; template struct __declspec(dllexport) __declspec(dllimport) ExplicitInstantiationTwoAttributes<int>; -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?f@?$ExplicitInstantiationTwoAttributes@H@@QAEXXZ" +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?f@?$ExplicitInstantiationTwoAttributes@H@@QAEXXZ" namespace pr34849 { // Specializations of exported class template member functions get exported. template <typename> struct __declspec(dllexport) ExportedClassTemplate { void foo(); }; template<> void ExportedClassTemplate<int>::foo() {} template struct ExportedClassTemplate<int>; -// M32-DAG: define dllexport x86_thiscallcc void @"\01?foo@?$ExportedClassTemplate@H@pr34849@@QAEXXZ" +// M32-DAG: define dso_local dllexport x86_thiscallcc void @"?foo@?$ExportedClassTemplate@H@pr34849@@QAEXXZ" // Specializations of exported class member template functions do not get exported. struct __declspec(dllexport) ExportedClass { template <typename> void bar() ; }; template<> void ExportedClass::bar<int>() {} -// M32-DAG: define x86_thiscallcc void @"\01??$bar@H@ExportedClass@pr34849@@QAEXXZ" +// M32-DAG: define dso_local x86_thiscallcc void @"??$bar@H@ExportedClass@pr34849@@QAEXXZ" template <typename> struct __declspec(dllexport) ExportedClassTemplate2 { template <typename> void baz(); }; template<> template<> void ExportedClassTemplate2<int>::baz<int>() {} -// M32-DAG: define x86_thiscallcc void @"\01??$baz@H@?$ExportedClassTemplate2@H@pr34849@@QAEXXZ" +// M32-DAG: define dso_local x86_thiscallcc void @"??$baz@H@?$ExportedClassTemplate2@H@pr34849@@QAEXXZ" } //===----------------------------------------------------------------------===// @@ -874,69 +918,69 @@ template struct __declspec(dllimport) ExplicitlyImportInstantiatedTemplate<int>; // MS: ClassTemplate<int> gets exported. struct __declspec(dllexport) DerivedFromTemplate : public ClassTemplate<int> {}; USEMEMFUNC(DerivedFromTemplate, func) -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?func@?$ClassTemplate@H@@QAEXXZ" -// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ClassTemplateIiE4funcEv +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?func@?$ClassTemplate@H@@QAEXXZ" +// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ClassTemplateIiE4funcEv // ExportedTemplate is explicitly exported. struct __declspec(dllexport) DerivedFromExportedTemplate : public ExportedClassTemplate<int> {}; USEMEMFUNC(DerivedFromExportedTemplate, func) -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?func@?$ExportedClassTemplate@H@@QAEXXZ" -// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN21ExportedClassTemplateIiE4funcEv +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?func@?$ExportedClassTemplate@H@@QAEXXZ" +// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN21ExportedClassTemplateIiE4funcEv // ImportedClassTemplate is explicitly imported. struct __declspec(dllexport) DerivedFromImportedTemplate : public ImportedClassTemplate<int> {}; USEMEMFUNC(DerivedFromImportedTemplate, func) -// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"\01?func@?$ImportedClassTemplate@H@@QAEXXZ" +// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"?func@?$ImportedClassTemplate@H@@QAEXXZ" // G32-DAG: declare dllimport x86_thiscallcc void @_ZN21ImportedClassTemplateIiE4funcEv // Base class already implicitly instantiated without dll attribute. struct DerivedFromTemplateD : public ClassTemplate<double> {}; struct __declspec(dllexport) DerivedFromTemplateD2 : public ClassTemplate<double> {}; USEMEMFUNC(DerivedFromTemplateD2, func) -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?func@?$ClassTemplate@N@@QAEXXZ" -// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ClassTemplateIdE4funcEv +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?func@?$ClassTemplate@N@@QAEXXZ" +// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ClassTemplateIdE4funcEv // MS: Base class already instantiated with different dll attribute. struct __declspec(dllimport) DerivedFromTemplateB : public ClassTemplate<bool> {}; struct __declspec(dllexport) DerivedFromTemplateB2 : public ClassTemplate<bool> {}; USEMEMFUNC(DerivedFromTemplateB2, func) -// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"\01?func@?$ClassTemplate@_N@@QAEXXZ" -// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ClassTemplateIbE4funcEv +// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"?func@?$ClassTemplate@_N@@QAEXXZ" +// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ClassTemplateIbE4funcEv // Base class already specialized without dll attribute. struct __declspec(dllexport) DerivedFromExplicitlySpecializedTemplate : public ExplicitlySpecializedTemplate<int> {}; USEMEMFUNC(DerivedFromExplicitlySpecializedTemplate, func) -// M32-DAG: define x86_thiscallcc void @"\01?func@?$ExplicitlySpecializedTemplate@H@@QAEXXZ" -// G32-DAG: define x86_thiscallcc void @_ZN29ExplicitlySpecializedTemplateIiE4funcEv +// M32-DAG: define dso_local x86_thiscallcc void @"?func@?$ExplicitlySpecializedTemplate@H@@QAEXXZ" +// G32-DAG: define dso_local x86_thiscallcc void @_ZN29ExplicitlySpecializedTemplateIiE4funcEv // Base class alredy specialized with export attribute. struct __declspec(dllexport) DerivedFromExplicitlyExportSpecializedTemplate : public ExplicitlyExportSpecializedTemplate<int> {}; USEMEMFUNC(DerivedFromExplicitlyExportSpecializedTemplate, func) -// M32-DAG: define dllexport x86_thiscallcc void @"\01?func@?$ExplicitlyExportSpecializedTemplate@H@@QAEXXZ" -// G32-DAG: define dllexport x86_thiscallcc void @_ZN35ExplicitlyExportSpecializedTemplateIiE4funcEv +// M32-DAG: define dso_local dllexport x86_thiscallcc void @"?func@?$ExplicitlyExportSpecializedTemplate@H@@QAEXXZ" +// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN35ExplicitlyExportSpecializedTemplateIiE4funcEv // Base class already specialized with import attribute. struct __declspec(dllexport) DerivedFromExplicitlyImportSpecializedTemplate : public ExplicitlyImportSpecializedTemplate<int> {}; USEMEMFUNC(DerivedFromExplicitlyImportSpecializedTemplate, func) -// M32-DAG: declare dllimport x86_thiscallcc void @"\01?func@?$ExplicitlyImportSpecializedTemplate@H@@QAEXXZ" +// M32-DAG: declare dllimport x86_thiscallcc void @"?func@?$ExplicitlyImportSpecializedTemplate@H@@QAEXXZ" // G32-DAG: declare dllimport x86_thiscallcc void @_ZN35ExplicitlyImportSpecializedTemplateIiE4funcEv // Base class already instantiated without dll attribute. struct __declspec(dllexport) DerivedFromExplicitlyInstantiatedTemplate : public ExplicitlyInstantiatedTemplate<int> {}; USEMEMFUNC(DerivedFromExplicitlyInstantiatedTemplate, func) -// M32-DAG: define weak_odr x86_thiscallcc void @"\01?func@?$ExplicitlyInstantiatedTemplate@H@@QAEXXZ" -// G32-DAG: define weak_odr x86_thiscallcc void @_ZN30ExplicitlyInstantiatedTemplateIiE4funcEv +// M32-DAG: define weak_odr dso_local x86_thiscallcc void @"?func@?$ExplicitlyInstantiatedTemplate@H@@QAEXXZ" +// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN30ExplicitlyInstantiatedTemplateIiE4funcEv // Base class already instantiated with export attribute. struct __declspec(dllexport) DerivedFromExplicitlyExportInstantiatedTemplate : public ExplicitlyExportInstantiatedTemplate<int> {}; USEMEMFUNC(DerivedFromExplicitlyExportInstantiatedTemplate, func) -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?func@?$ExplicitlyExportInstantiatedTemplate@H@@QAEXXZ" -// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN36ExplicitlyExportInstantiatedTemplateIiE4funcEv +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?func@?$ExplicitlyExportInstantiatedTemplate@H@@QAEXXZ" +// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN36ExplicitlyExportInstantiatedTemplateIiE4funcEv // Base class already instantiated with import attribute. struct __declspec(dllexport) DerivedFromExplicitlyImportInstantiatedTemplate : public ExplicitlyImportInstantiatedTemplate<int> {}; USEMEMFUNC(DerivedFromExplicitlyImportInstantiatedTemplate, func) -// M32-DAG: declare dllimport x86_thiscallcc void @"\01?func@?$ExplicitlyImportInstantiatedTemplate@H@@QAEXXZ" +// M32-DAG: declare dllimport x86_thiscallcc void @"?func@?$ExplicitlyImportInstantiatedTemplate@H@@QAEXXZ" // G32-DAG: declare dllimport x86_thiscallcc void @_ZN36ExplicitlyImportInstantiatedTemplateIiE4funcEv // MS: A dll attribute propagates through multiple levels of instantiation. @@ -944,15 +988,15 @@ template <typename T> struct TopClass { void func() {} }; template <typename T> struct MiddleClass : public TopClass<T> { }; struct __declspec(dllexport) BottomClass : public MiddleClass<int> { }; USEMEMFUNC(BottomClass, func) -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?func@?$TopClass@H@@QAEXXZ" -// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN8TopClassIiE4funcEv +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?func@?$TopClass@H@@QAEXXZ" +// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN8TopClassIiE4funcEv template <typename T> struct ExplicitInstantiationDeclTemplateBase { void func() {} }; extern template struct ExplicitInstantiationDeclTemplateBase<int>; struct __declspec(dllexport) DerivedFromExplicitInstantiationDeclTemplateBase : public ExplicitInstantiationDeclTemplateBase<int> {}; template struct ExplicitInstantiationDeclTemplateBase<int>; -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?func@?$ExplicitInstantiationDeclTemplateBase@H@@QAEXXZ" -// G32-DAG: define weak_odr x86_thiscallcc void @_ZN37ExplicitInstantiationDeclTemplateBaseIiE4funcEv +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?func@?$ExplicitInstantiationDeclTemplateBase@H@@QAEXXZ" +// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN37ExplicitInstantiationDeclTemplateBaseIiE4funcEv // PR26076 struct LayerSelectionBound; @@ -965,8 +1009,8 @@ struct __declspec(dllexport) LayerTreeImpl { }; LayerSelection foo; }; -// M32-DAG: define weak_odr dllexport x86_thiscallcc %"struct.LayerTreeImpl::ElementLayers"* @"\01??0ElementLayers@LayerTreeImpl@@QAE@XZ" -// M64-DAG: define weak_odr dllexport %"struct.LayerTreeImpl::ElementLayers"* @"\01??0ElementLayers@LayerTreeImpl@@QEAA@XZ" +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %"struct.LayerTreeImpl::ElementLayers"* @"??0ElementLayers@LayerTreeImpl@@QAE@XZ" +// M64-DAG: define weak_odr dso_local dllexport %"struct.LayerTreeImpl::ElementLayers"* @"??0ElementLayers@LayerTreeImpl@@QEAA@XZ" class __declspec(dllexport) ACE_Shared_Object { public: @@ -974,6 +1018,6 @@ public: }; class __declspec(dllexport) ACE_Service_Object : public ACE_Shared_Object {}; // Implicit move constructor declaration. -// MSVC2015-DAG: define weak_odr dllexport {{.+}}ACE_Service_Object@@Q{{.+}}@$$Q +// MSVC2015-DAG: define weak_odr dso_local dllexport {{.+}}ACE_Service_Object@@Q{{.+}}@$$Q // The declarations should not be exported. -// MSVC2013-NOT: define weak_odr dllexport {{.+}}ACE_Service_Object@@Q{{.+}}@$$Q +// MSVC2013-NOT: define weak_odr dso_local dllexport {{.+}}ACE_Service_Object@@Q{{.+}}@$$Q diff --git a/test/CodeGenCXX/dllimport-dtor-thunks.cpp b/test/CodeGenCXX/dllimport-dtor-thunks.cpp index b381fff450daf..da3227a49a4b5 100644 --- a/test/CodeGenCXX/dllimport-dtor-thunks.cpp +++ b/test/CodeGenCXX/dllimport-dtor-thunks.cpp @@ -1,9 +1,5 @@ // RUN: %clang_cc1 -mconstructor-aliases %s -triple x86_64-windows-msvc -fms-extensions -emit-llvm -o - | FileCheck %s -// FIXME: We should really consider removing -mconstructor-aliases for MS C++ -// ABI. The risk of bugs introducing ABI incompatibility under -// -mno-constructor-aliases is too high. - // PR32990 // Introduces the virtual destructor. We should use the base destructor @@ -39,11 +35,11 @@ extern "C" void testit() { // The destructors are called in reverse order of construction. Only the third // needs the complete destructor (_D). -// CHECK-LABEL: define void @testit() -// CHECK: call void @"\01??_DImportVBaseOverrideVDtor@@QEAAXXZ"(%struct.ImportVBaseOverrideVDtor* %{{.*}}) -// CHECK: call void @"\01??1ImportOverrideVDtor@@UEAA@XZ"(%struct.ImportOverrideVDtor* %{{.*}}) -// CHECK: call void @"\01??1ImportIntroVDtor@@UEAA@XZ"(%struct.ImportIntroVDtor* %{{.*}}) - -// CHECK-LABEL: define linkonce_odr void @"\01??_DImportVBaseOverrideVDtor@@QEAAXXZ" -// CHECK-LABEL: declare dllimport void @"\01??1ImportOverrideVDtor@@UEAA@XZ" -// CHECK-LABEL: declare dllimport void @"\01??1ImportIntroVDtor@@UEAA@XZ" +// CHECK-LABEL: define dso_local void @testit() +// CHECK: call void @"??_DImportVBaseOverrideVDtor@@QEAAXXZ"(%struct.ImportVBaseOverrideVDtor* %{{.*}}) +// CHECK: call void @"??1ImportOverrideVDtor@@UEAA@XZ"(%struct.ImportOverrideVDtor* %{{.*}}) +// CHECK: call void @"??1ImportIntroVDtor@@UEAA@XZ"(%struct.ImportIntroVDtor* %{{.*}}) + +// CHECK-LABEL: declare dllimport void @"??_DImportVBaseOverrideVDtor@@QEAAXXZ" +// CHECK-LABEL: declare dllimport void @"??1ImportOverrideVDtor@@UEAA@XZ" +// CHECK-LABEL: declare dllimport void @"??1ImportIntroVDtor@@UEAA@XZ" diff --git a/test/CodeGenCXX/dllimport-members.cpp b/test/CodeGenCXX/dllimport-members.cpp index ff7868382d8c8..7a7519f66831e 100644 --- a/test/CodeGenCXX/dllimport-members.cpp +++ b/test/CodeGenCXX/dllimport-members.cpp @@ -63,124 +63,124 @@ struct __declspec(dllimport) ForceNonTrivial { struct ImportMembers { struct Nested; - // M32-DAG: define dllexport x86_thiscallcc void @"\01?normalDef@ImportMembers@@QAEXXZ"(%struct.ImportMembers* %this) - // M64-DAG: define dllexport void @"\01?normalDef@ImportMembers@@QEAAXXZ"(%struct.ImportMembers* %this) - // M32-DAG: declare dllimport x86_thiscallcc void @"\01?normalDecl@ImportMembers@@QAEXXZ"(%struct.ImportMembers*) - // M64-DAG: declare dllimport void @"\01?normalDecl@ImportMembers@@QEAAXXZ"(%struct.ImportMembers*) - // M32-DAG: declare dllimport x86_thiscallcc void @"\01?normalInclass@ImportMembers@@QAEXXZ"(%struct.ImportMembers*) - // M64-DAG: declare dllimport void @"\01?normalInclass@ImportMembers@@QEAAXXZ"(%struct.ImportMembers*) - // M32-DAG: declare dllimport x86_thiscallcc void @"\01?normalInlineDef@ImportMembers@@QAEXXZ"(%struct.ImportMembers*) - // M64-DAG: declare dllimport void @"\01?normalInlineDef@ImportMembers@@QEAAXXZ"(%struct.ImportMembers*) - // M32-DAG: declare dllimport x86_thiscallcc void @"\01?normalInlineDecl@ImportMembers@@QAEXXZ"(%struct.ImportMembers*) - // M64-DAG: declare dllimport void @"\01?normalInlineDecl@ImportMembers@@QEAAXXZ"(%struct.ImportMembers*) - // G32-DAG: define x86_thiscallcc void @_ZN13ImportMembers9normalDefEv(%struct.ImportMembers* %this) - // G64-DAG: define void @_ZN13ImportMembers9normalDefEv(%struct.ImportMembers* %this) - // G32-DAG: declare dllimport x86_thiscallcc void @_ZN13ImportMembers10normalDeclEv(%struct.ImportMembers*) - // G64-DAG: declare dllimport void @_ZN13ImportMembers10normalDeclEv(%struct.ImportMembers*) - // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers13normalInclassEv(%struct.ImportMembers* %this) - // G64-DAG: define linkonce_odr void @_ZN13ImportMembers13normalInclassEv(%struct.ImportMembers* %this) - // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers15normalInlineDefEv(%struct.ImportMembers* %this) - // G64-DAG: define linkonce_odr void @_ZN13ImportMembers15normalInlineDefEv(%struct.ImportMembers* %this) - // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers16normalInlineDeclEv(%struct.ImportMembers* %this) - // G64-DAG: define linkonce_odr void @_ZN13ImportMembers16normalInlineDeclEv(%struct.ImportMembers* %this) - // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?normalInclass@ImportMembers@@QAEXXZ"( - // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?normalInlineDef@ImportMembers@@QAEXXZ"( - // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?normalInlineDecl@ImportMembers@@QAEXXZ"( - // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers13normalInclassEv( - // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers15normalInlineDefEv( - // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers16normalInlineDeclEv( + // M32-DAG: define dso_local dllexport x86_thiscallcc void @"?normalDef@ImportMembers@@QAEXXZ"(%struct.ImportMembers* %this) + // M64-DAG: define dso_local dllexport void @"?normalDef@ImportMembers@@QEAAXXZ"(%struct.ImportMembers* %this) + // M32-DAG: declare dllimport x86_thiscallcc void @"?normalDecl@ImportMembers@@QAEXXZ"(%struct.ImportMembers*) + // M64-DAG: declare dllimport void @"?normalDecl@ImportMembers@@QEAAXXZ"(%struct.ImportMembers*) + // M32-DAG: declare dllimport x86_thiscallcc void @"?normalInclass@ImportMembers@@QAEXXZ"(%struct.ImportMembers*) + // M64-DAG: declare dllimport void @"?normalInclass@ImportMembers@@QEAAXXZ"(%struct.ImportMembers*) + // M32-DAG: declare dllimport x86_thiscallcc void @"?normalInlineDef@ImportMembers@@QAEXXZ"(%struct.ImportMembers*) + // M64-DAG: declare dllimport void @"?normalInlineDef@ImportMembers@@QEAAXXZ"(%struct.ImportMembers*) + // M32-DAG: declare dllimport x86_thiscallcc void @"?normalInlineDecl@ImportMembers@@QAEXXZ"(%struct.ImportMembers*) + // M64-DAG: declare dllimport void @"?normalInlineDecl@ImportMembers@@QEAAXXZ"(%struct.ImportMembers*) + // G32-DAG: define dso_local x86_thiscallcc void @_ZN13ImportMembers9normalDefEv(%struct.ImportMembers* %this) + // G64-DAG: define dso_local void @_ZN13ImportMembers9normalDefEv(%struct.ImportMembers* %this) + // G32-DAG: declare dllimport x86_thiscallcc void @_ZN13ImportMembers10normalDeclEv(%struct.ImportMembers*) + // G64-DAG: declare dllimport void @_ZN13ImportMembers10normalDeclEv(%struct.ImportMembers*) + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers13normalInclassEv(%struct.ImportMembers* %this) + // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers13normalInclassEv(%struct.ImportMembers* %this) + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers15normalInlineDefEv(%struct.ImportMembers* %this) + // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers15normalInlineDefEv(%struct.ImportMembers* %this) + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers16normalInlineDeclEv(%struct.ImportMembers* %this) + // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers16normalInlineDeclEv(%struct.ImportMembers* %this) + // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?normalInclass@ImportMembers@@QAEXXZ"( + // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?normalInlineDef@ImportMembers@@QAEXXZ"( + // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?normalInlineDecl@ImportMembers@@QAEXXZ"( + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers13normalInclassEv( + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers15normalInlineDefEv( + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers16normalInlineDeclEv( __declspec(dllimport) void normalDef(); // dllimport ignored __declspec(dllimport) void normalDecl(); __declspec(dllimport) void normalInclass() {} __declspec(dllimport) void normalInlineDef(); __declspec(dllimport) inline void normalInlineDecl(); - // M32-DAG: define dllexport x86_thiscallcc void @"\01?virtualDef@ImportMembers@@UAEXXZ"(%struct.ImportMembers* %this) - // M64-DAG: define dllexport void @"\01?virtualDef@ImportMembers@@UEAAXXZ"(%struct.ImportMembers* %this) - // M32-DAG: declare dllimport x86_thiscallcc void @"\01?virtualDecl@ImportMembers@@UAEXXZ"(%struct.ImportMembers*) - // M64-DAG: declare dllimport void @"\01?virtualDecl@ImportMembers@@UEAAXXZ"(%struct.ImportMembers*) - // M32-DAG: declare dllimport x86_thiscallcc void @"\01?virtualInclass@ImportMembers@@UAEXXZ"(%struct.ImportMembers*) - // M64-DAG: declare dllimport void @"\01?virtualInclass@ImportMembers@@UEAAXXZ"(%struct.ImportMembers*) - // M32-DAG: declare dllimport x86_thiscallcc void @"\01?virtualInlineDef@ImportMembers@@UAEXXZ"(%struct.ImportMembers*) - // M64-DAG: declare dllimport void @"\01?virtualInlineDef@ImportMembers@@UEAAXXZ"(%struct.ImportMembers*) - // M32-DAG: declare dllimport x86_thiscallcc void @"\01?virtualInlineDecl@ImportMembers@@UAEXXZ"(%struct.ImportMembers*) - // M64-DAG: declare dllimport void @"\01?virtualInlineDecl@ImportMembers@@UEAAXXZ"(%struct.ImportMembers*) - // G32-DAG: define x86_thiscallcc void @_ZN13ImportMembers10virtualDefEv(%struct.ImportMembers* %this) - // G64-DAG: define void @_ZN13ImportMembers10virtualDefEv(%struct.ImportMembers* %this) + // M32-DAG: define dso_local dllexport x86_thiscallcc void @"?virtualDef@ImportMembers@@UAEXXZ"(%struct.ImportMembers* %this) + // M64-DAG: define dso_local dllexport void @"?virtualDef@ImportMembers@@UEAAXXZ"(%struct.ImportMembers* %this) + // M32-DAG: declare dllimport x86_thiscallcc void @"?virtualDecl@ImportMembers@@UAEXXZ"(%struct.ImportMembers*) + // M64-DAG: declare dllimport void @"?virtualDecl@ImportMembers@@UEAAXXZ"(%struct.ImportMembers*) + // M32-DAG: declare dllimport x86_thiscallcc void @"?virtualInclass@ImportMembers@@UAEXXZ"(%struct.ImportMembers*) + // M64-DAG: declare dllimport void @"?virtualInclass@ImportMembers@@UEAAXXZ"(%struct.ImportMembers*) + // M32-DAG: declare dllimport x86_thiscallcc void @"?virtualInlineDef@ImportMembers@@UAEXXZ"(%struct.ImportMembers*) + // M64-DAG: declare dllimport void @"?virtualInlineDef@ImportMembers@@UEAAXXZ"(%struct.ImportMembers*) + // M32-DAG: declare dllimport x86_thiscallcc void @"?virtualInlineDecl@ImportMembers@@UAEXXZ"(%struct.ImportMembers*) + // M64-DAG: declare dllimport void @"?virtualInlineDecl@ImportMembers@@UEAAXXZ"(%struct.ImportMembers*) + // G32-DAG: define dso_local x86_thiscallcc void @_ZN13ImportMembers10virtualDefEv(%struct.ImportMembers* %this) + // G64-DAG: define dso_local void @_ZN13ImportMembers10virtualDefEv(%struct.ImportMembers* %this) // G32-DAG: declare dllimport x86_thiscallcc void @_ZN13ImportMembers11virtualDeclEv(%struct.ImportMembers*) // G64-DAG: declare dllimport void @_ZN13ImportMembers11virtualDeclEv(%struct.ImportMembers*) - // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers14virtualInclassEv(%struct.ImportMembers* %this) - // G64-DAG: define linkonce_odr void @_ZN13ImportMembers14virtualInclassEv(%struct.ImportMembers* %this) - // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers16virtualInlineDefEv(%struct.ImportMembers* %this) - // G64-DAG: define linkonce_odr void @_ZN13ImportMembers16virtualInlineDefEv(%struct.ImportMembers* %this) - // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers17virtualInlineDeclEv(%struct.ImportMembers* %this) - // G64-DAG: define linkonce_odr void @_ZN13ImportMembers17virtualInlineDeclEv(%struct.ImportMembers* %this) - // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?virtualInclass@ImportMembers@@UAEXXZ"( - // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?virtualInlineDef@ImportMembers@@UAEXXZ"( - // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?virtualInlineDecl@ImportMembers@@UAEXXZ"( - // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers14virtualInclassEv( - // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers16virtualInlineDefEv( - // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers17virtualInlineDeclEv( + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers14virtualInclassEv(%struct.ImportMembers* %this) + // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers14virtualInclassEv(%struct.ImportMembers* %this) + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers16virtualInlineDefEv(%struct.ImportMembers* %this) + // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers16virtualInlineDefEv(%struct.ImportMembers* %this) + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers17virtualInlineDeclEv(%struct.ImportMembers* %this) + // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers17virtualInlineDeclEv(%struct.ImportMembers* %this) + // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?virtualInclass@ImportMembers@@UAEXXZ"( + // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?virtualInlineDef@ImportMembers@@UAEXXZ"( + // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?virtualInlineDecl@ImportMembers@@UAEXXZ"( + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers14virtualInclassEv( + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers16virtualInlineDefEv( + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers17virtualInlineDeclEv( __declspec(dllimport) virtual void virtualDef(); // dllimport ignored __declspec(dllimport) virtual void virtualDecl(); __declspec(dllimport) virtual void virtualInclass() {} __declspec(dllimport) virtual void virtualInlineDef(); __declspec(dllimport) virtual inline void virtualInlineDecl(); - // MSC-DAG: define dllexport void @"\01?staticDef@ImportMembers@@SAXXZ"() - // MSC-DAG: declare dllimport void @"\01?staticDecl@ImportMembers@@SAXXZ"() - // MSC-DAG: declare dllimport void @"\01?staticInclass@ImportMembers@@SAXXZ"() - // MSC-DAG: declare dllimport void @"\01?staticInlineDef@ImportMembers@@SAXXZ"() - // MSC-DAG: declare dllimport void @"\01?staticInlineDecl@ImportMembers@@SAXXZ"() - // GNU-DAG: define void @_ZN13ImportMembers9staticDefEv() - // GNU-DAG: declare dllimport void @_ZN13ImportMembers10staticDeclEv() - // GNU-DAG: define linkonce_odr void @_ZN13ImportMembers13staticInclassEv() - // GNU-DAG: define linkonce_odr void @_ZN13ImportMembers15staticInlineDefEv() - // GNU-DAG: define linkonce_odr void @_ZN13ImportMembers16staticInlineDeclEv() - // MO1-DAG: define available_externally dllimport void @"\01?staticInclass@ImportMembers@@SAXXZ"() - // MO1-DAG: define available_externally dllimport void @"\01?staticInlineDef@ImportMembers@@SAXXZ"() - // MO1-DAG: define available_externally dllimport void @"\01?staticInlineDecl@ImportMembers@@SAXXZ"() - // GO1-DAG: define linkonce_odr void @_ZN13ImportMembers13staticInclassEv() - // GO1-DAG: define linkonce_odr void @_ZN13ImportMembers15staticInlineDefEv() - // GO1-DAG: define linkonce_odr void @_ZN13ImportMembers16staticInlineDeclEv() + // MSC-DAG: define dso_local dllexport void @"?staticDef@ImportMembers@@SAXXZ"() + // MSC-DAG: declare dllimport void @"?staticDecl@ImportMembers@@SAXXZ"() + // MSC-DAG: declare dllimport void @"?staticInclass@ImportMembers@@SAXXZ"() + // MSC-DAG: declare dllimport void @"?staticInlineDef@ImportMembers@@SAXXZ"() + // MSC-DAG: declare dllimport void @"?staticInlineDecl@ImportMembers@@SAXXZ"() + // GNU-DAG: define dso_local void @_ZN13ImportMembers9staticDefEv() + // GNU-DAG: declare dllimport void @_ZN13ImportMembers10staticDeclEv() + // GNU-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers13staticInclassEv() + // GNU-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers15staticInlineDefEv() + // GNU-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers16staticInlineDeclEv() + // MO1-DAG: define available_externally dllimport void @"?staticInclass@ImportMembers@@SAXXZ"() + // MO1-DAG: define available_externally dllimport void @"?staticInlineDef@ImportMembers@@SAXXZ"() + // MO1-DAG: define available_externally dllimport void @"?staticInlineDecl@ImportMembers@@SAXXZ"() + // GO1-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers13staticInclassEv() + // GO1-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers15staticInlineDefEv() + // GO1-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers16staticInlineDeclEv() __declspec(dllimport) static void staticDef(); // dllimport ignored __declspec(dllimport) static void staticDecl(); __declspec(dllimport) static void staticInclass() {} __declspec(dllimport) static void staticInlineDef(); __declspec(dllimport) static inline void staticInlineDecl(); - // M32-DAG: declare dllimport x86_thiscallcc void @"\01?protectedNormalDecl@ImportMembers@@IAEXXZ"(%struct.ImportMembers*) - // M64-DAG: declare dllimport void @"\01?protectedNormalDecl@ImportMembers@@IEAAXXZ"(%struct.ImportMembers*) + // M32-DAG: declare dllimport x86_thiscallcc void @"?protectedNormalDecl@ImportMembers@@IAEXXZ"(%struct.ImportMembers*) + // M64-DAG: declare dllimport void @"?protectedNormalDecl@ImportMembers@@IEAAXXZ"(%struct.ImportMembers*) // G32-DAG: declare dllimport x86_thiscallcc void @_ZN13ImportMembers19protectedNormalDeclEv(%struct.ImportMembers*) // G64-DAG: declare dllimport void @_ZN13ImportMembers19protectedNormalDeclEv(%struct.ImportMembers*) - // MSC-DAG: declare dllimport void @"\01?protectedStaticDecl@ImportMembers@@KAXXZ"() + // MSC-DAG: declare dllimport void @"?protectedStaticDecl@ImportMembers@@KAXXZ"() // GNU-DAG: declare dllimport void @_ZN13ImportMembers19protectedStaticDeclEv() protected: __declspec(dllimport) void protectedNormalDecl(); __declspec(dllimport) static void protectedStaticDecl(); - // M32-DAG: declare dllimport x86_thiscallcc void @"\01?privateNormalDecl@ImportMembers@@AAEXXZ"(%struct.ImportMembers*) - // M64-DAG: declare dllimport void @"\01?privateNormalDecl@ImportMembers@@AEAAXXZ"(%struct.ImportMembers*) + // M32-DAG: declare dllimport x86_thiscallcc void @"?privateNormalDecl@ImportMembers@@AAEXXZ"(%struct.ImportMembers*) + // M64-DAG: declare dllimport void @"?privateNormalDecl@ImportMembers@@AEAAXXZ"(%struct.ImportMembers*) // G32-DAG: declare dllimport x86_thiscallcc void @_ZN13ImportMembers17privateNormalDeclEv(%struct.ImportMembers*) // G64-DAG: declare dllimport void @_ZN13ImportMembers17privateNormalDeclEv(%struct.ImportMembers*) - // MSC-DAG: declare dllimport void @"\01?privateStaticDecl@ImportMembers@@CAXXZ"() + // MSC-DAG: declare dllimport void @"?privateStaticDecl@ImportMembers@@CAXXZ"() // GNU-DAG: declare dllimport void @_ZN13ImportMembers17privateStaticDeclEv() private: __declspec(dllimport) void privateNormalDecl(); __declspec(dllimport) static void privateStaticDecl(); - // M32-DAG: declare x86_thiscallcc void @"\01?ignored@ImportMembers@@QAEXXZ"(%struct.ImportMembers*) - // M64-DAG: declare void @"\01?ignored@ImportMembers@@QEAAXXZ"(%struct.ImportMembers*) - // G32-DAG: declare x86_thiscallcc void @_ZN13ImportMembers7ignoredEv(%struct.ImportMembers*) - // G64-DAG: declare void @_ZN13ImportMembers7ignoredEv(%struct.ImportMembers*) + // M32-DAG: declare dso_local x86_thiscallcc void @"?ignored@ImportMembers@@QAEXXZ"(%struct.ImportMembers*) + // M64-DAG: declare dso_local void @"?ignored@ImportMembers@@QEAAXXZ"(%struct.ImportMembers*) + // G32-DAG: declare dso_local x86_thiscallcc void @_ZN13ImportMembers7ignoredEv(%struct.ImportMembers*) + // G64-DAG: declare dso_local void @_ZN13ImportMembers7ignoredEv(%struct.ImportMembers*) public: void ignored(); - // MSC-DAG: @"\01?StaticField@ImportMembers@@2HA" = external dllimport global i32 - // MSC-DAG: @"\01?StaticConstField@ImportMembers@@2HB" = external dllimport constant i32 - // MSC-DAG: @"\01?StaticConstFieldEqualInit@ImportMembers@@2HB" = available_externally dllimport constant i32 1, align 4 - // MSC-DAG: @"\01?StaticConstFieldBraceInit@ImportMembers@@2HB" = available_externally dllimport constant i32 1, align 4 - // MSC-DAG: @"\01?ConstexprField@ImportMembers@@2HB" = available_externally dllimport constant i32 1, align 4 + // MSC-DAG: @"?StaticField@ImportMembers@@2HA" = external dllimport global i32 + // MSC-DAG: @"?StaticConstField@ImportMembers@@2HB" = external dllimport constant i32 + // MSC-DAG: @"?StaticConstFieldEqualInit@ImportMembers@@2HB" = available_externally dllimport constant i32 1, align 4 + // MSC-DAG: @"?StaticConstFieldBraceInit@ImportMembers@@2HB" = available_externally dllimport constant i32 1, align 4 + // MSC-DAG: @"?ConstexprField@ImportMembers@@2HB" = available_externally dllimport constant i32 1, align 4 // GNU-DAG: @_ZN13ImportMembers11StaticFieldE = external dllimport global i32 // GNU-DAG: @_ZN13ImportMembers16StaticConstFieldE = external dllimport constant i32 // GNU-DAG: @_ZN13ImportMembers25StaticConstFieldEqualInitE = external dllimport constant i32 @@ -235,125 +235,125 @@ USEMV(ImportMembers, ConstexprField) // Import individual members of a nested class. struct ImportMembers::Nested { - // M32-DAG: define dllexport x86_thiscallcc void @"\01?normalDef@Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"* %this) - // M64-DAG: define dllexport void @"\01?normalDef@Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"* %this) - // M32-DAG: declare dllimport x86_thiscallcc void @"\01?normalDecl@Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"*) - // M64-DAG: declare dllimport void @"\01?normalDecl@Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"*) - // M32-DAG: declare dllimport x86_thiscallcc void @"\01?normalInclass@Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"*) - // M64-DAG: declare dllimport void @"\01?normalInclass@Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"*) - // M32-DAG: declare dllimport x86_thiscallcc void @"\01?normalInlineDef@Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"*) - // M64-DAG: declare dllimport void @"\01?normalInlineDef@Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"*) - // M32-DAG: declare dllimport x86_thiscallcc void @"\01?normalInlineDecl@Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"*) - // M64-DAG: declare dllimport void @"\01?normalInlineDecl@Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"*) - // G32-DAG: define x86_thiscallcc void @_ZN13ImportMembers6Nested9normalDefEv(%"struct.ImportMembers::Nested"* %this) - // G64-DAG: define void @_ZN13ImportMembers6Nested9normalDefEv(%"struct.ImportMembers::Nested"* %this) + // M32-DAG: define dso_local dllexport x86_thiscallcc void @"?normalDef@Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"* %this) + // M64-DAG: define dso_local dllexport void @"?normalDef@Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"* %this) + // M32-DAG: declare dllimport x86_thiscallcc void @"?normalDecl@Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"*) + // M64-DAG: declare dllimport void @"?normalDecl@Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"*) + // M32-DAG: declare dllimport x86_thiscallcc void @"?normalInclass@Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"*) + // M64-DAG: declare dllimport void @"?normalInclass@Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"*) + // M32-DAG: declare dllimport x86_thiscallcc void @"?normalInlineDef@Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"*) + // M64-DAG: declare dllimport void @"?normalInlineDef@Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"*) + // M32-DAG: declare dllimport x86_thiscallcc void @"?normalInlineDecl@Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"*) + // M64-DAG: declare dllimport void @"?normalInlineDecl@Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"*) + // G32-DAG: define dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested9normalDefEv(%"struct.ImportMembers::Nested"* %this) + // G64-DAG: define dso_local void @_ZN13ImportMembers6Nested9normalDefEv(%"struct.ImportMembers::Nested"* %this) // G32-DAG: declare dllimport x86_thiscallcc void @_ZN13ImportMembers6Nested10normalDeclEv(%"struct.ImportMembers::Nested"*) // G64-DAG: declare dllimport void @_ZN13ImportMembers6Nested10normalDeclEv(%"struct.ImportMembers::Nested"*) - // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers6Nested13normalInclassEv(%"struct.ImportMembers::Nested"* %this) - // G64-DAG: define linkonce_odr void @_ZN13ImportMembers6Nested13normalInclassEv(%"struct.ImportMembers::Nested"* %this) - // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers6Nested15normalInlineDefEv(%"struct.ImportMembers::Nested"* %this) - // G64-DAG: define linkonce_odr void @_ZN13ImportMembers6Nested15normalInlineDefEv(%"struct.ImportMembers::Nested"* %this) - // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers6Nested16normalInlineDeclEv(%"struct.ImportMembers::Nested"* %this) - // G64-DAG: define linkonce_odr void @_ZN13ImportMembers6Nested16normalInlineDeclEv(%"struct.ImportMembers::Nested"* %this) - // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?normalInclass@Nested@ImportMembers@@QAEXXZ"( - // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?normalInlineDef@Nested@ImportMembers@@QAEXXZ"( - // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?normalInlineDecl@Nested@ImportMembers@@QAEXXZ"( - // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers6Nested13normalInclassEv( - // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers6Nested15normalInlineDefEv( - // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers6Nested16normalInlineDeclEv( + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested13normalInclassEv(%"struct.ImportMembers::Nested"* %this) + // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested13normalInclassEv(%"struct.ImportMembers::Nested"* %this) + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested15normalInlineDefEv(%"struct.ImportMembers::Nested"* %this) + // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested15normalInlineDefEv(%"struct.ImportMembers::Nested"* %this) + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested16normalInlineDeclEv(%"struct.ImportMembers::Nested"* %this) + // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested16normalInlineDeclEv(%"struct.ImportMembers::Nested"* %this) + // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?normalInclass@Nested@ImportMembers@@QAEXXZ"( + // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?normalInlineDef@Nested@ImportMembers@@QAEXXZ"( + // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?normalInlineDecl@Nested@ImportMembers@@QAEXXZ"( + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested13normalInclassEv( + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested15normalInlineDefEv( + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested16normalInlineDeclEv( __declspec(dllimport) void normalDef(); // dllimport ignored __declspec(dllimport) void normalDecl(); __declspec(dllimport) void normalInclass() {} __declspec(dllimport) void normalInlineDef(); __declspec(dllimport) inline void normalInlineDecl(); - // M32-DAG: define dllexport x86_thiscallcc void @"\01?virtualDef@Nested@ImportMembers@@UAEXXZ"(%"struct.ImportMembers::Nested"* %this) - // M64-DAG: define dllexport void @"\01?virtualDef@Nested@ImportMembers@@UEAAXXZ"(%"struct.ImportMembers::Nested"* %this) - // M32-DAG: declare dllimport x86_thiscallcc void @"\01?virtualDecl@Nested@ImportMembers@@UAEXXZ"(%"struct.ImportMembers::Nested"*) - // M64-DAG: declare dllimport void @"\01?virtualDecl@Nested@ImportMembers@@UEAAXXZ"(%"struct.ImportMembers::Nested"*) - // M32-DAG: declare dllimport x86_thiscallcc void @"\01?virtualInclass@Nested@ImportMembers@@UAEXXZ"(%"struct.ImportMembers::Nested"*) - // M64-DAG: declare dllimport void @"\01?virtualInclass@Nested@ImportMembers@@UEAAXXZ"(%"struct.ImportMembers::Nested"*) - // M32-DAG: declare dllimport x86_thiscallcc void @"\01?virtualInlineDef@Nested@ImportMembers@@UAEXXZ"(%"struct.ImportMembers::Nested"*) - // M64-DAG: declare dllimport void @"\01?virtualInlineDef@Nested@ImportMembers@@UEAAXXZ"(%"struct.ImportMembers::Nested"*) - // M32-DAG: declare dllimport x86_thiscallcc void @"\01?virtualInlineDecl@Nested@ImportMembers@@UAEXXZ"(%"struct.ImportMembers::Nested"*) - // M64-DAG: declare dllimport void @"\01?virtualInlineDecl@Nested@ImportMembers@@UEAAXXZ"(%"struct.ImportMembers::Nested"*) - // G32-DAG: define x86_thiscallcc void @_ZN13ImportMembers6Nested10virtualDefEv(%"struct.ImportMembers::Nested"* %this) - // G64-DAG: define void @_ZN13ImportMembers6Nested10virtualDefEv(%"struct.ImportMembers::Nested"* %this) + // M32-DAG: define dso_local dllexport x86_thiscallcc void @"?virtualDef@Nested@ImportMembers@@UAEXXZ"(%"struct.ImportMembers::Nested"* %this) + // M64-DAG: define dso_local dllexport void @"?virtualDef@Nested@ImportMembers@@UEAAXXZ"(%"struct.ImportMembers::Nested"* %this) + // M32-DAG: declare dllimport x86_thiscallcc void @"?virtualDecl@Nested@ImportMembers@@UAEXXZ"(%"struct.ImportMembers::Nested"*) + // M64-DAG: declare dllimport void @"?virtualDecl@Nested@ImportMembers@@UEAAXXZ"(%"struct.ImportMembers::Nested"*) + // M32-DAG: declare dllimport x86_thiscallcc void @"?virtualInclass@Nested@ImportMembers@@UAEXXZ"(%"struct.ImportMembers::Nested"*) + // M64-DAG: declare dllimport void @"?virtualInclass@Nested@ImportMembers@@UEAAXXZ"(%"struct.ImportMembers::Nested"*) + // M32-DAG: declare dllimport x86_thiscallcc void @"?virtualInlineDef@Nested@ImportMembers@@UAEXXZ"(%"struct.ImportMembers::Nested"*) + // M64-DAG: declare dllimport void @"?virtualInlineDef@Nested@ImportMembers@@UEAAXXZ"(%"struct.ImportMembers::Nested"*) + // M32-DAG: declare dllimport x86_thiscallcc void @"?virtualInlineDecl@Nested@ImportMembers@@UAEXXZ"(%"struct.ImportMembers::Nested"*) + // M64-DAG: declare dllimport void @"?virtualInlineDecl@Nested@ImportMembers@@UEAAXXZ"(%"struct.ImportMembers::Nested"*) + // G32-DAG: define dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested10virtualDefEv(%"struct.ImportMembers::Nested"* %this) + // G64-DAG: define dso_local void @_ZN13ImportMembers6Nested10virtualDefEv(%"struct.ImportMembers::Nested"* %this) // G32-DAG: declare dllimport x86_thiscallcc void @_ZN13ImportMembers6Nested11virtualDeclEv(%"struct.ImportMembers::Nested"*) // G64-DAG: declare dllimport void @_ZN13ImportMembers6Nested11virtualDeclEv(%"struct.ImportMembers::Nested"*) - // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers6Nested14virtualInclassEv(%"struct.ImportMembers::Nested"* %this) - // G64-DAG: define linkonce_odr void @_ZN13ImportMembers6Nested14virtualInclassEv(%"struct.ImportMembers::Nested"* %this) - // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers6Nested16virtualInlineDefEv(%"struct.ImportMembers::Nested"* %this) - // G64-DAG: define linkonce_odr void @_ZN13ImportMembers6Nested16virtualInlineDefEv(%"struct.ImportMembers::Nested"* %this) - // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers6Nested17virtualInlineDeclEv(%"struct.ImportMembers::Nested"* %this) - // G64-DAG: define linkonce_odr void @_ZN13ImportMembers6Nested17virtualInlineDeclEv(%"struct.ImportMembers::Nested"* %this) - - // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?virtualInclass@Nested@ImportMembers@@UAEXXZ"( - // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?virtualInlineDef@Nested@ImportMembers@@UAEXXZ"( - // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?virtualInlineDecl@Nested@ImportMembers@@UAEXXZ"( - // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers6Nested14virtualInclassEv( - // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers6Nested16virtualInlineDefEv( - // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers6Nested17virtualInlineDeclEv( + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested14virtualInclassEv(%"struct.ImportMembers::Nested"* %this) + // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested14virtualInclassEv(%"struct.ImportMembers::Nested"* %this) + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested16virtualInlineDefEv(%"struct.ImportMembers::Nested"* %this) + // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested16virtualInlineDefEv(%"struct.ImportMembers::Nested"* %this) + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested17virtualInlineDeclEv(%"struct.ImportMembers::Nested"* %this) + // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested17virtualInlineDeclEv(%"struct.ImportMembers::Nested"* %this) + + // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?virtualInclass@Nested@ImportMembers@@UAEXXZ"( + // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?virtualInlineDef@Nested@ImportMembers@@UAEXXZ"( + // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?virtualInlineDecl@Nested@ImportMembers@@UAEXXZ"( + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested14virtualInclassEv( + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested16virtualInlineDefEv( + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested17virtualInlineDeclEv( __declspec(dllimport) virtual void virtualDef(); // dllimport ignored __declspec(dllimport) virtual void virtualDecl(); __declspec(dllimport) virtual void virtualInclass() {} __declspec(dllimport) virtual void virtualInlineDef(); __declspec(dllimport) virtual inline void virtualInlineDecl(); - // MSC-DAG: define dllexport void @"\01?staticDef@Nested@ImportMembers@@SAXXZ"() - // MSC-DAG: declare dllimport void @"\01?staticDecl@Nested@ImportMembers@@SAXXZ"() - // MSC-DAG: declare dllimport void @"\01?staticInclass@Nested@ImportMembers@@SAXXZ"() - // MSC-DAG: declare dllimport void @"\01?staticInlineDef@Nested@ImportMembers@@SAXXZ"() - // MSC-DAG: declare dllimport void @"\01?staticInlineDecl@Nested@ImportMembers@@SAXXZ"() - // GNU-DAG: define void @_ZN13ImportMembers6Nested9staticDefEv() - // GNU-DAG: declare dllimport void @_ZN13ImportMembers6Nested10staticDeclEv() - // GNU-DAG: define linkonce_odr void @_ZN13ImportMembers6Nested13staticInclassEv() - // GNU-DAG: define linkonce_odr void @_ZN13ImportMembers6Nested15staticInlineDefEv() - // GNU-DAG: define linkonce_odr void @_ZN13ImportMembers6Nested16staticInlineDeclEv() - // MO1-DAG: define available_externally dllimport void @"\01?staticInclass@Nested@ImportMembers@@SAXXZ"() - // MO1-DAG: define available_externally dllimport void @"\01?staticInlineDef@Nested@ImportMembers@@SAXXZ"() - // MO1-DAG: define available_externally dllimport void @"\01?staticInlineDecl@Nested@ImportMembers@@SAXXZ"() - // GO1-DAG: define linkonce_odr void @_ZN13ImportMembers6Nested13staticInclassEv() - // GO1-DAG: define linkonce_odr void @_ZN13ImportMembers6Nested15staticInlineDefEv() - // GO1-DAG: define linkonce_odr void @_ZN13ImportMembers6Nested16staticInlineDeclEv() + // MSC-DAG: define dso_local dllexport void @"?staticDef@Nested@ImportMembers@@SAXXZ"() + // MSC-DAG: declare dllimport void @"?staticDecl@Nested@ImportMembers@@SAXXZ"() + // MSC-DAG: declare dllimport void @"?staticInclass@Nested@ImportMembers@@SAXXZ"() + // MSC-DAG: declare dllimport void @"?staticInlineDef@Nested@ImportMembers@@SAXXZ"() + // MSC-DAG: declare dllimport void @"?staticInlineDecl@Nested@ImportMembers@@SAXXZ"() + // GNU-DAG: define dso_local void @_ZN13ImportMembers6Nested9staticDefEv() + // GNU-DAG: declare dllimport void @_ZN13ImportMembers6Nested10staticDeclEv() + // GNU-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested13staticInclassEv() + // GNU-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested15staticInlineDefEv() + // GNU-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested16staticInlineDeclEv() + // MO1-DAG: define available_externally dllimport void @"?staticInclass@Nested@ImportMembers@@SAXXZ"() + // MO1-DAG: define available_externally dllimport void @"?staticInlineDef@Nested@ImportMembers@@SAXXZ"() + // MO1-DAG: define available_externally dllimport void @"?staticInlineDecl@Nested@ImportMembers@@SAXXZ"() + // GO1-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested13staticInclassEv() + // GO1-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested15staticInlineDefEv() + // GO1-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested16staticInlineDeclEv() __declspec(dllimport) static void staticDef(); // dllimport ignored __declspec(dllimport) static void staticDecl(); __declspec(dllimport) static void staticInclass() {} __declspec(dllimport) static void staticInlineDef(); __declspec(dllimport) static inline void staticInlineDecl(); - // M32-DAG: declare dllimport x86_thiscallcc void @"\01?protectedNormalDecl@Nested@ImportMembers@@IAEXXZ"(%"struct.ImportMembers::Nested"*) - // M64-DAG: declare dllimport void @"\01?protectedNormalDecl@Nested@ImportMembers@@IEAAXXZ"(%"struct.ImportMembers::Nested"*) + // M32-DAG: declare dllimport x86_thiscallcc void @"?protectedNormalDecl@Nested@ImportMembers@@IAEXXZ"(%"struct.ImportMembers::Nested"*) + // M64-DAG: declare dllimport void @"?protectedNormalDecl@Nested@ImportMembers@@IEAAXXZ"(%"struct.ImportMembers::Nested"*) // G32-DAG: declare dllimport x86_thiscallcc void @_ZN13ImportMembers6Nested19protectedNormalDeclEv(%"struct.ImportMembers::Nested"*) // G64-DAG: declare dllimport void @_ZN13ImportMembers6Nested19protectedNormalDeclEv(%"struct.ImportMembers::Nested"*) - // MSC-DAG: declare dllimport void @"\01?protectedStaticDecl@Nested@ImportMembers@@KAXXZ"() + // MSC-DAG: declare dllimport void @"?protectedStaticDecl@Nested@ImportMembers@@KAXXZ"() // GNU-DAG: declare dllimport void @_ZN13ImportMembers6Nested19protectedStaticDeclEv() protected: __declspec(dllimport) void protectedNormalDecl(); __declspec(dllimport) static void protectedStaticDecl(); - // M32-DAG: declare dllimport x86_thiscallcc void @"\01?privateNormalDecl@Nested@ImportMembers@@AAEXXZ"(%"struct.ImportMembers::Nested"*) - // M64-DAG: declare dllimport void @"\01?privateNormalDecl@Nested@ImportMembers@@AEAAXXZ"(%"struct.ImportMembers::Nested"*) + // M32-DAG: declare dllimport x86_thiscallcc void @"?privateNormalDecl@Nested@ImportMembers@@AAEXXZ"(%"struct.ImportMembers::Nested"*) + // M64-DAG: declare dllimport void @"?privateNormalDecl@Nested@ImportMembers@@AEAAXXZ"(%"struct.ImportMembers::Nested"*) // G32-DAG: declare dllimport x86_thiscallcc void @_ZN13ImportMembers6Nested17privateNormalDeclEv(%"struct.ImportMembers::Nested"*) // G64-DAG: declare dllimport void @_ZN13ImportMembers6Nested17privateNormalDeclEv(%"struct.ImportMembers::Nested"*) - // MSC-DAG: declare dllimport void @"\01?privateStaticDecl@Nested@ImportMembers@@CAXXZ"() + // MSC-DAG: declare dllimport void @"?privateStaticDecl@Nested@ImportMembers@@CAXXZ"() // GNU-DAG: declare dllimport void @_ZN13ImportMembers6Nested17privateStaticDeclEv() private: __declspec(dllimport) void privateNormalDecl(); __declspec(dllimport) static void privateStaticDecl(); - // M32-DAG: declare x86_thiscallcc void @"\01?ignored@Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"*) - // M64-DAG: declare void @"\01?ignored@Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"*) - // G32-DAG: declare x86_thiscallcc void @_ZN13ImportMembers6Nested7ignoredEv(%"struct.ImportMembers::Nested"*) - // G64-DAG: declare void @_ZN13ImportMembers6Nested7ignoredEv(%"struct.ImportMembers::Nested"*) + // M32-DAG: declare dso_local x86_thiscallcc void @"?ignored@Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"*) + // M64-DAG: declare dso_local void @"?ignored@Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"*) + // G32-DAG: declare dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested7ignoredEv(%"struct.ImportMembers::Nested"*) + // G64-DAG: declare dso_local void @_ZN13ImportMembers6Nested7ignoredEv(%"struct.ImportMembers::Nested"*) public: void ignored(); - // MSC-DAG: @"\01?StaticField@Nested@ImportMembers@@2HA" = external dllimport global i32 - // MSC-DAG: @"\01?StaticConstField@Nested@ImportMembers@@2HB" = external dllimport constant i32 - // MSC-DAG: @"\01?StaticConstFieldEqualInit@Nested@ImportMembers@@2HB" = available_externally dllimport constant i32 1, align 4 - // MSC-DAG: @"\01?StaticConstFieldBraceInit@Nested@ImportMembers@@2HB" = available_externally dllimport constant i32 1, align 4 - // MSC-DAG: @"\01?ConstexprField@Nested@ImportMembers@@2HB" = available_externally dllimport constant i32 1, align 4 + // MSC-DAG: @"?StaticField@Nested@ImportMembers@@2HA" = external dllimport global i32 + // MSC-DAG: @"?StaticConstField@Nested@ImportMembers@@2HB" = external dllimport constant i32 + // MSC-DAG: @"?StaticConstFieldEqualInit@Nested@ImportMembers@@2HB" = available_externally dllimport constant i32 1, align 4 + // MSC-DAG: @"?StaticConstFieldBraceInit@Nested@ImportMembers@@2HB" = available_externally dllimport constant i32 1, align 4 + // MSC-DAG: @"?ConstexprField@Nested@ImportMembers@@2HB" = available_externally dllimport constant i32 1, align 4 // GNU-DAG: @_ZN13ImportMembers6Nested11StaticFieldE = external dllimport global i32 // GNU-DAG: @_ZN13ImportMembers6Nested16StaticConstFieldE = external dllimport constant i32 // GNU-DAG: @_ZN13ImportMembers6Nested25StaticConstFieldEqualInitE = external dllimport constant i32 @@ -408,38 +408,38 @@ USEMV(ImportMembers::Nested, ConstexprField) // Import special member functions. struct ImportSpecials { - // M32-DAG: declare dllimport x86_thiscallcc %struct.ImportSpecials* @"\01??0ImportSpecials@@QAE@XZ"(%struct.ImportSpecials* returned) - // M64-DAG: declare dllimport %struct.ImportSpecials* @"\01??0ImportSpecials@@QEAA@XZ"(%struct.ImportSpecials* returned) + // M32-DAG: declare dllimport x86_thiscallcc %struct.ImportSpecials* @"??0ImportSpecials@@QAE@XZ"(%struct.ImportSpecials* returned) + // M64-DAG: declare dllimport %struct.ImportSpecials* @"??0ImportSpecials@@QEAA@XZ"(%struct.ImportSpecials* returned) // G32-DAG: declare dllimport x86_thiscallcc void @_ZN14ImportSpecialsC1Ev(%struct.ImportSpecials*) // G64-DAG: declare dllimport void @_ZN14ImportSpecialsC1Ev(%struct.ImportSpecials*) __declspec(dllimport) ImportSpecials(); - // M32-DAG: declare dllimport x86_thiscallcc void @"\01??1ImportSpecials@@QAE@XZ"(%struct.ImportSpecials*) - // M64-DAG: declare dllimport void @"\01??1ImportSpecials@@QEAA@XZ"(%struct.ImportSpecials*) + // M32-DAG: declare dllimport x86_thiscallcc void @"??1ImportSpecials@@QAE@XZ"(%struct.ImportSpecials*) + // M64-DAG: declare dllimport void @"??1ImportSpecials@@QEAA@XZ"(%struct.ImportSpecials*) // G32-DAG: declare dllimport x86_thiscallcc void @_ZN14ImportSpecialsD1Ev(%struct.ImportSpecials*) // G64-DAG: declare dllimport void @_ZN14ImportSpecialsD1Ev(%struct.ImportSpecials*) __declspec(dllimport) ~ImportSpecials(); - // M32-DAG: declare dllimport x86_thiscallcc %struct.ImportSpecials* @"\01??0ImportSpecials@@QAE@ABU0@@Z"(%struct.ImportSpecials* returned, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) - // M64-DAG: declare dllimport %struct.ImportSpecials* @"\01??0ImportSpecials@@QEAA@AEBU0@@Z"(%struct.ImportSpecials* returned, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) + // M32-DAG: declare dllimport x86_thiscallcc %struct.ImportSpecials* @"??0ImportSpecials@@QAE@ABU0@@Z"(%struct.ImportSpecials* returned, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) + // M64-DAG: declare dllimport %struct.ImportSpecials* @"??0ImportSpecials@@QEAA@AEBU0@@Z"(%struct.ImportSpecials* returned, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) // G32-DAG: declare dllimport x86_thiscallcc void @_ZN14ImportSpecialsC1ERKS_(%struct.ImportSpecials*, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) // G64-DAG: declare dllimport void @_ZN14ImportSpecialsC1ERKS_(%struct.ImportSpecials*, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) __declspec(dllimport) ImportSpecials(const ImportSpecials&); - // M32-DAG: declare dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportSpecials* @"\01??4ImportSpecials@@QAEAAU0@ABU0@@Z"(%struct.ImportSpecials*, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) - // M64-DAG: declare dllimport dereferenceable({{[0-9]+}}) %struct.ImportSpecials* @"\01??4ImportSpecials@@QEAAAEAU0@AEBU0@@Z"(%struct.ImportSpecials*, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) + // M32-DAG: declare dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportSpecials* @"??4ImportSpecials@@QAEAAU0@ABU0@@Z"(%struct.ImportSpecials*, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) + // M64-DAG: declare dllimport dereferenceable({{[0-9]+}}) %struct.ImportSpecials* @"??4ImportSpecials@@QEAAAEAU0@AEBU0@@Z"(%struct.ImportSpecials*, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) // G32-DAG: declare dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportSpecials* @_ZN14ImportSpecialsaSERKS_(%struct.ImportSpecials*, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) // G64-DAG: declare dllimport dereferenceable({{[0-9]+}}) %struct.ImportSpecials* @_ZN14ImportSpecialsaSERKS_(%struct.ImportSpecials*, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) __declspec(dllimport) ImportSpecials& operator=(const ImportSpecials&); - // M32-DAG: declare dllimport x86_thiscallcc %struct.ImportSpecials* @"\01??0ImportSpecials@@QAE@$$QAU0@@Z"(%struct.ImportSpecials* returned, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) - // M64-DAG: declare dllimport %struct.ImportSpecials* @"\01??0ImportSpecials@@QEAA@$$QEAU0@@Z"(%struct.ImportSpecials* returned, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) + // M32-DAG: declare dllimport x86_thiscallcc %struct.ImportSpecials* @"??0ImportSpecials@@QAE@$$QAU0@@Z"(%struct.ImportSpecials* returned, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) + // M64-DAG: declare dllimport %struct.ImportSpecials* @"??0ImportSpecials@@QEAA@$$QEAU0@@Z"(%struct.ImportSpecials* returned, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) // G32-DAG: declare dllimport x86_thiscallcc void @_ZN14ImportSpecialsC1EOS_(%struct.ImportSpecials*, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) // G64-DAG: declare dllimport void @_ZN14ImportSpecialsC1EOS_(%struct.ImportSpecials*, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) __declspec(dllimport) ImportSpecials(ImportSpecials&&); - // M32-DAG: declare dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportSpecials* @"\01??4ImportSpecials@@QAEAAU0@$$QAU0@@Z"(%struct.ImportSpecials*, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) - // M64-DAG: declare dllimport dereferenceable({{[0-9]+}}) %struct.ImportSpecials* @"\01??4ImportSpecials@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ImportSpecials*, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) + // M32-DAG: declare dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportSpecials* @"??4ImportSpecials@@QAEAAU0@$$QAU0@@Z"(%struct.ImportSpecials*, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) + // M64-DAG: declare dllimport dereferenceable({{[0-9]+}}) %struct.ImportSpecials* @"??4ImportSpecials@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ImportSpecials*, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) // G32-DAG: declare dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportSpecials* @_ZN14ImportSpecialsaSEOS_(%struct.ImportSpecials*, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) // G64-DAG: declare dllimport dereferenceable({{[0-9]+}}) %struct.ImportSpecials* @_ZN14ImportSpecialsaSEOS_(%struct.ImportSpecials*, %struct.ImportSpecials* dereferenceable({{[0-9]+}})) __declspec(dllimport) ImportSpecials& operator=(ImportSpecials&&); @@ -449,52 +449,52 @@ USESPECIALS(ImportSpecials) // Export inline special member functions. struct ImportInlineSpecials { - // M32-DAG: declare dllimport x86_thiscallcc %struct.ImportInlineSpecials* @"\01??0ImportInlineSpecials@@QAE@XZ"(%struct.ImportInlineSpecials* returned) - // M64-DAG: declare dllimport %struct.ImportInlineSpecials* @"\01??0ImportInlineSpecials@@QEAA@XZ"(%struct.ImportInlineSpecials* returned) - // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN20ImportInlineSpecialsC1Ev(%struct.ImportInlineSpecials* %this) - // G64-DAG: define linkonce_odr void @_ZN20ImportInlineSpecialsC1Ev(%struct.ImportInlineSpecials* %this) - // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportInlineSpecials* @"\01??0ImportInlineSpecials@@QAE@XZ"( - // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN20ImportInlineSpecialsC1Ev( + // M32-DAG: declare dllimport x86_thiscallcc %struct.ImportInlineSpecials* @"??0ImportInlineSpecials@@QAE@XZ"(%struct.ImportInlineSpecials* returned) + // M64-DAG: declare dllimport %struct.ImportInlineSpecials* @"??0ImportInlineSpecials@@QEAA@XZ"(%struct.ImportInlineSpecials* returned) + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1Ev(%struct.ImportInlineSpecials* %this) + // G64-DAG: define linkonce_odr dso_local void @_ZN20ImportInlineSpecialsC1Ev(%struct.ImportInlineSpecials* %this) + // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportInlineSpecials* @"??0ImportInlineSpecials@@QAE@XZ"( + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1Ev( __declspec(dllimport) ImportInlineSpecials() {} - // M32-DAG: declare dllimport x86_thiscallcc void @"\01??1ImportInlineSpecials@@QAE@XZ"(%struct.ImportInlineSpecials*) - // M64-DAG: declare dllimport void @"\01??1ImportInlineSpecials@@QEAA@XZ"(%struct.ImportInlineSpecials*) - // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN20ImportInlineSpecialsD1Ev(%struct.ImportInlineSpecials* %this) - // G64-DAG: define linkonce_odr void @_ZN20ImportInlineSpecialsD1Ev(%struct.ImportInlineSpecials* %this) - // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01??1ImportInlineSpecials@@QAE@XZ"( - // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN20ImportInlineSpecialsD1Ev( + // M32-DAG: declare dllimport x86_thiscallcc void @"??1ImportInlineSpecials@@QAE@XZ"(%struct.ImportInlineSpecials*) + // M64-DAG: declare dllimport void @"??1ImportInlineSpecials@@QEAA@XZ"(%struct.ImportInlineSpecials*) + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsD1Ev(%struct.ImportInlineSpecials* %this) + // G64-DAG: define linkonce_odr dso_local void @_ZN20ImportInlineSpecialsD1Ev(%struct.ImportInlineSpecials* %this) + // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"??1ImportInlineSpecials@@QAE@XZ"( + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsD1Ev( __declspec(dllimport) ~ImportInlineSpecials() {} - // M32-DAG: declare dllimport x86_thiscallcc %struct.ImportInlineSpecials* @"\01??0ImportInlineSpecials@@QAE@ABU0@@Z"(%struct.ImportInlineSpecials* returned, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) - // M64-DAG: declare dllimport %struct.ImportInlineSpecials* @"\01??0ImportInlineSpecials@@QEAA@AEBU0@@Z"(%struct.ImportInlineSpecials* returned, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) - // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN20ImportInlineSpecialsC1ERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) - // G64-DAG: define linkonce_odr void @_ZN20ImportInlineSpecialsC1ERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) - // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportInlineSpecials* @"\01??0ImportInlineSpecials@@QAE@ABU0@@Z"( - // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN20ImportInlineSpecialsC1ERKS_( + // M32-DAG: declare dllimport x86_thiscallcc %struct.ImportInlineSpecials* @"??0ImportInlineSpecials@@QAE@ABU0@@Z"(%struct.ImportInlineSpecials* returned, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) + // M64-DAG: declare dllimport %struct.ImportInlineSpecials* @"??0ImportInlineSpecials@@QEAA@AEBU0@@Z"(%struct.ImportInlineSpecials* returned, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1ERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) + // G64-DAG: define linkonce_odr dso_local void @_ZN20ImportInlineSpecialsC1ERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) + // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportInlineSpecials* @"??0ImportInlineSpecials@@QAE@ABU0@@Z"( + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1ERKS_( __declspec(dllimport) inline ImportInlineSpecials(const ImportInlineSpecials&); - // M32-DAG: declare dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"\01??4ImportInlineSpecials@@QAEAAU0@ABU0@@Z"(%struct.ImportInlineSpecials*, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) - // M64-DAG: declare dllimport dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"\01??4ImportInlineSpecials@@QEAAAEAU0@AEBU0@@Z"(%struct.ImportInlineSpecials*, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) - // G32-DAG: define linkonce_odr x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) - // G64-DAG: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) - // MO1-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"\01??4ImportInlineSpecials@@QAEAAU0@ABU0@@Z"( - // GO1-DAG: define linkonce_odr x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSERKS_( + // M32-DAG: declare dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"??4ImportInlineSpecials@@QAEAAU0@ABU0@@Z"(%struct.ImportInlineSpecials*, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) + // M64-DAG: declare dllimport dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"??4ImportInlineSpecials@@QEAAAEAU0@AEBU0@@Z"(%struct.ImportInlineSpecials*, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) + // G64-DAG: define linkonce_odr dso_local dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) + // MO1-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"??4ImportInlineSpecials@@QAEAAU0@ABU0@@Z"( + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSERKS_( __declspec(dllimport) ImportInlineSpecials& operator=(const ImportInlineSpecials&); - // M32-DAG: declare dllimport x86_thiscallcc %struct.ImportInlineSpecials* @"\01??0ImportInlineSpecials@@QAE@$$QAU0@@Z"(%struct.ImportInlineSpecials* returned, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) - // M64-DAG: declare dllimport %struct.ImportInlineSpecials* @"\01??0ImportInlineSpecials@@QEAA@$$QEAU0@@Z"(%struct.ImportInlineSpecials* returned, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) - // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN20ImportInlineSpecialsC1EOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) - // G64-DAG: define linkonce_odr void @_ZN20ImportInlineSpecialsC1EOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) - // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportInlineSpecials* @"\01??0ImportInlineSpecials@@QAE@$$QAU0@@Z"( - // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN20ImportInlineSpecialsC1EOS_( + // M32-DAG: declare dllimport x86_thiscallcc %struct.ImportInlineSpecials* @"??0ImportInlineSpecials@@QAE@$$QAU0@@Z"(%struct.ImportInlineSpecials* returned, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) + // M64-DAG: declare dllimport %struct.ImportInlineSpecials* @"??0ImportInlineSpecials@@QEAA@$$QEAU0@@Z"(%struct.ImportInlineSpecials* returned, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1EOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) + // G64-DAG: define linkonce_odr dso_local void @_ZN20ImportInlineSpecialsC1EOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) + // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportInlineSpecials* @"??0ImportInlineSpecials@@QAE@$$QAU0@@Z"( + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1EOS_( __declspec(dllimport) ImportInlineSpecials(ImportInlineSpecials&&) {} - // M32-DAG: declare dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"\01??4ImportInlineSpecials@@QAEAAU0@$$QAU0@@Z"(%struct.ImportInlineSpecials*, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) - // M64-DAG: declare dllimport dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"\01??4ImportInlineSpecials@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ImportInlineSpecials*, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) - // G32-DAG: define linkonce_odr x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSEOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) - // G64-DAG: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSEOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) - // MO1-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"\01??4ImportInlineSpecials@@QAEAAU0@$$QAU0@@Z"( - // GO1-DAG: define linkonce_odr x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSEOS_( + // M32-DAG: declare dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"??4ImportInlineSpecials@@QAEAAU0@$$QAU0@@Z"(%struct.ImportInlineSpecials*, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) + // M64-DAG: declare dllimport dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"??4ImportInlineSpecials@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ImportInlineSpecials*, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSEOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) + // G64-DAG: define linkonce_odr dso_local dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSEOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}})) + // MO1-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"??4ImportInlineSpecials@@QAEAAU0@$$QAU0@@Z"( + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSEOS_( __declspec(dllimport) ImportInlineSpecials& operator=(ImportInlineSpecials&&) { return *this; } }; ImportInlineSpecials::ImportInlineSpecials(const ImportInlineSpecials&) {} @@ -504,52 +504,52 @@ USESPECIALS(ImportInlineSpecials) // Import defaulted member functions. struct ImportDefaulted { - // M32-DAG: declare dllimport x86_thiscallcc %struct.ImportDefaulted* @"\01??0ImportDefaulted@@QAE@XZ"(%struct.ImportDefaulted* returned) - // M64-DAG: declare dllimport %struct.ImportDefaulted* @"\01??0ImportDefaulted@@QEAA@XZ"(%struct.ImportDefaulted* returned) - // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN15ImportDefaultedC1Ev(%struct.ImportDefaulted* %this) - // G64-DAG: define linkonce_odr void @_ZN15ImportDefaultedC1Ev(%struct.ImportDefaulted* %this) - // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportDefaulted* @"\01??0ImportDefaulted@@QAE@XZ"(%struct.ImportDefaulted* returned %this) - // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN15ImportDefaultedC1Ev(%struct.ImportDefaulted* %this) + // M32-DAG: declare dllimport x86_thiscallcc %struct.ImportDefaulted* @"??0ImportDefaulted@@QAE@XZ"(%struct.ImportDefaulted* returned) + // M64-DAG: declare dllimport %struct.ImportDefaulted* @"??0ImportDefaulted@@QEAA@XZ"(%struct.ImportDefaulted* returned) + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1Ev(%struct.ImportDefaulted* %this) + // G64-DAG: define linkonce_odr dso_local void @_ZN15ImportDefaultedC1Ev(%struct.ImportDefaulted* %this) + // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportDefaulted* @"??0ImportDefaulted@@QAE@XZ"(%struct.ImportDefaulted* returned %this) + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1Ev(%struct.ImportDefaulted* %this) __declspec(dllimport) ImportDefaulted() = default; - // M32-DAG: declare dllimport x86_thiscallcc void @"\01??1ImportDefaulted@@QAE@XZ"(%struct.ImportDefaulted*) - // M64-DAG: declare dllimport void @"\01??1ImportDefaulted@@QEAA@XZ"(%struct.ImportDefaulted*) - // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN15ImportDefaultedD1Ev(%struct.ImportDefaulted* %this) - // G64-DAG: define linkonce_odr void @_ZN15ImportDefaultedD1Ev(%struct.ImportDefaulted* %this) - // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01??1ImportDefaulted@@QAE@XZ"(%struct.ImportDefaulted* %this) - // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN15ImportDefaultedD1Ev(%struct.ImportDefaulted* %this) + // M32-DAG: declare dllimport x86_thiscallcc void @"??1ImportDefaulted@@QAE@XZ"(%struct.ImportDefaulted*) + // M64-DAG: declare dllimport void @"??1ImportDefaulted@@QEAA@XZ"(%struct.ImportDefaulted*) + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedD1Ev(%struct.ImportDefaulted* %this) + // G64-DAG: define linkonce_odr dso_local void @_ZN15ImportDefaultedD1Ev(%struct.ImportDefaulted* %this) + // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"??1ImportDefaulted@@QAE@XZ"(%struct.ImportDefaulted* %this) + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedD1Ev(%struct.ImportDefaulted* %this) __declspec(dllimport) ~ImportDefaulted() = default; - // M32-DAG: declare dllimport x86_thiscallcc %struct.ImportDefaulted* @"\01??0ImportDefaulted@@QAE@ABU0@@Z"(%struct.ImportDefaulted* returned, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) - // M64-DAG: declare dllimport %struct.ImportDefaulted* @"\01??0ImportDefaulted@@QEAA@AEBU0@@Z"(%struct.ImportDefaulted* returned, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) - // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN15ImportDefaultedC1ERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) - // G64-DAG: define linkonce_odr void @_ZN15ImportDefaultedC1ERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) - // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportDefaulted* @"\01??0ImportDefaulted@@QAE@ABU0@@Z"(%struct.ImportDefaulted* returned %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) - // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN15ImportDefaultedC1ERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // M32-DAG: declare dllimport x86_thiscallcc %struct.ImportDefaulted* @"??0ImportDefaulted@@QAE@ABU0@@Z"(%struct.ImportDefaulted* returned, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // M64-DAG: declare dllimport %struct.ImportDefaulted* @"??0ImportDefaulted@@QEAA@AEBU0@@Z"(%struct.ImportDefaulted* returned, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1ERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // G64-DAG: define linkonce_odr dso_local void @_ZN15ImportDefaultedC1ERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportDefaulted* @"??0ImportDefaulted@@QAE@ABU0@@Z"(%struct.ImportDefaulted* returned %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1ERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) __declspec(dllimport) ImportDefaulted(const ImportDefaulted&) = default; - // M32-DAG: declare dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"\01??4ImportDefaulted@@QAEAAU0@ABU0@@Z"(%struct.ImportDefaulted*, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) - // M64-DAG: declare dllimport dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"\01??4ImportDefaulted@@QEAAAEAU0@AEBU0@@Z"(%struct.ImportDefaulted*, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) - // G32-DAG: define linkonce_odr x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) - // G64-DAG: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) - // MO1-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"\01??4ImportDefaulted@@QAEAAU0@ABU0@@Z"(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) - // GO1-DAG: define linkonce_odr x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // M32-DAG: declare dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"??4ImportDefaulted@@QAEAAU0@ABU0@@Z"(%struct.ImportDefaulted*, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // M64-DAG: declare dllimport dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"??4ImportDefaulted@@QEAAAEAU0@AEBU0@@Z"(%struct.ImportDefaulted*, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // G64-DAG: define linkonce_odr dso_local dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // MO1-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"??4ImportDefaulted@@QAEAAU0@ABU0@@Z"(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) __declspec(dllimport) ImportDefaulted& operator=(const ImportDefaulted&) = default; - // M32-DAG: declare dllimport x86_thiscallcc %struct.ImportDefaulted* @"\01??0ImportDefaulted@@QAE@$$QAU0@@Z"(%struct.ImportDefaulted* returned, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) - // M64-DAG: declare dllimport %struct.ImportDefaulted* @"\01??0ImportDefaulted@@QEAA@$$QEAU0@@Z"(%struct.ImportDefaulted* returned, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) - // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN15ImportDefaultedC1EOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) - // G64-DAG: define linkonce_odr void @_ZN15ImportDefaultedC1EOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) - // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportDefaulted* @"\01??0ImportDefaulted@@QAE@$$QAU0@@Z"(%struct.ImportDefaulted* returned %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) - // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN15ImportDefaultedC1EOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // M32-DAG: declare dllimport x86_thiscallcc %struct.ImportDefaulted* @"??0ImportDefaulted@@QAE@$$QAU0@@Z"(%struct.ImportDefaulted* returned, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // M64-DAG: declare dllimport %struct.ImportDefaulted* @"??0ImportDefaulted@@QEAA@$$QEAU0@@Z"(%struct.ImportDefaulted* returned, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1EOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // G64-DAG: define linkonce_odr dso_local void @_ZN15ImportDefaultedC1EOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportDefaulted* @"??0ImportDefaulted@@QAE@$$QAU0@@Z"(%struct.ImportDefaulted* returned %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1EOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) __declspec(dllimport) ImportDefaulted(ImportDefaulted&&) = default; - // M32-DAG: declare dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"\01??4ImportDefaulted@@QAEAAU0@$$QAU0@@Z"(%struct.ImportDefaulted*, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) - // M64-DAG: declare dllimport dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"\01??4ImportDefaulted@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ImportDefaulted*, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) - // G32-DAG: define linkonce_odr x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSEOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) - // G64-DAG: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSEOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) - // MO1-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"\01??4ImportDefaulted@@QAEAAU0@$$QAU0@@Z"(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) - // GO1-DAG: define linkonce_odr x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSEOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // M32-DAG: declare dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"??4ImportDefaulted@@QAEAAU0@$$QAU0@@Z"(%struct.ImportDefaulted*, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // M64-DAG: declare dllimport dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"??4ImportDefaulted@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ImportDefaulted*, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // G32-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSEOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // G64-DAG: define linkonce_odr dso_local dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSEOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // MO1-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"??4ImportDefaulted@@QAEAAU0@$$QAU0@@Z"(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) + // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSEOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}})) __declspec(dllimport) ImportDefaulted& operator=(ImportDefaulted&&) = default; ForceNonTrivial v; // ensure special members are non-trivial @@ -571,42 +571,42 @@ struct ImportDefaultedDefs { #ifdef MSABI // For MinGW, the function will not be dllimport, and we cannot add the attribute now. -// M32-DAG: declare dllimport x86_thiscallcc %struct.ImportDefaultedDefs* @"\01??0ImportDefaultedDefs@@QAE@XZ"(%struct.ImportDefaultedDefs* returned) -// M64-DAG: declare dllimport %struct.ImportDefaultedDefs* @"\01??0ImportDefaultedDefs@@QEAA@XZ"(%struct.ImportDefaultedDefs* returned) +// M32-DAG: declare dllimport x86_thiscallcc %struct.ImportDefaultedDefs* @"??0ImportDefaultedDefs@@QAE@XZ"(%struct.ImportDefaultedDefs* returned) +// M64-DAG: declare dllimport %struct.ImportDefaultedDefs* @"??0ImportDefaultedDefs@@QEAA@XZ"(%struct.ImportDefaultedDefs* returned) __declspec(dllimport) ImportDefaultedDefs::ImportDefaultedDefs() = default; #endif #ifdef MSABI // For MinGW, the function will not be dllimport, and we cannot add the attribute now. -// M32-DAG: declare dllimport x86_thiscallcc void @"\01??1ImportDefaultedDefs@@QAE@XZ"(%struct.ImportDefaultedDefs*) -// M64-DAG: declare dllimport void @"\01??1ImportDefaultedDefs@@QEAA@XZ"(%struct.ImportDefaultedDefs*) +// M32-DAG: declare dllimport x86_thiscallcc void @"??1ImportDefaultedDefs@@QAE@XZ"(%struct.ImportDefaultedDefs*) +// M64-DAG: declare dllimport void @"??1ImportDefaultedDefs@@QEAA@XZ"(%struct.ImportDefaultedDefs*) __declspec(dllimport) ImportDefaultedDefs::~ImportDefaultedDefs() = default; #endif -// M32-DAG: declare dllimport x86_thiscallcc %struct.ImportDefaultedDefs* @"\01??0ImportDefaultedDefs@@QAE@ABU0@@Z"(%struct.ImportDefaultedDefs* returned, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) -// M64-DAG: declare dllimport %struct.ImportDefaultedDefs* @"\01??0ImportDefaultedDefs@@QEAA@AEBU0@@Z"(%struct.ImportDefaultedDefs* returned, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN19ImportDefaultedDefsC1ERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G64-DAG: define linkonce_odr void @_ZN19ImportDefaultedDefsC1ERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) +// M32-DAG: declare dllimport x86_thiscallcc %struct.ImportDefaultedDefs* @"??0ImportDefaultedDefs@@QAE@ABU0@@Z"(%struct.ImportDefaultedDefs* returned, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) +// M64-DAG: declare dllimport %struct.ImportDefaultedDefs* @"??0ImportDefaultedDefs@@QEAA@AEBU0@@Z"(%struct.ImportDefaultedDefs* returned, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN19ImportDefaultedDefsC1ERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G64-DAG: define linkonce_odr dso_local void @_ZN19ImportDefaultedDefsC1ERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) inline ImportDefaultedDefs::ImportDefaultedDefs(const ImportDefaultedDefs&) = default; -// M32-DAG: declare dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @"\01??4ImportDefaultedDefs@@QAEAAU0@ABU0@@Z"(%struct.ImportDefaultedDefs*, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) -// M64-DAG: declare dllimport dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @"\01??4ImportDefaultedDefs@@QEAAAEAU0@AEBU0@@Z"(%struct.ImportDefaultedDefs*, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G32-DAG: define linkonce_odr x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G64-DAG: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) +// M32-DAG: declare dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @"??4ImportDefaultedDefs@@QAEAAU0@ABU0@@Z"(%struct.ImportDefaultedDefs*, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) +// M64-DAG: declare dllimport dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @"??4ImportDefaultedDefs@@QEAAAEAU0@AEBU0@@Z"(%struct.ImportDefaultedDefs*, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G32-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G64-DAG: define linkonce_odr dso_local dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) inline ImportDefaultedDefs& ImportDefaultedDefs::operator=(const ImportDefaultedDefs&) = default; -// M32-DAG: define dllexport x86_thiscallcc %struct.ImportDefaultedDefs* @"\01??0ImportDefaultedDefs@@QAE@$$QAU0@@Z"(%struct.ImportDefaultedDefs* returned %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) -// M64-DAG: define dllexport %struct.ImportDefaultedDefs* @"\01??0ImportDefaultedDefs@@QEAA@$$QEAU0@@Z"(%struct.ImportDefaultedDefs* returned %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G32-DAG: define x86_thiscallcc void @_ZN19ImportDefaultedDefsC1EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G64-DAG: define void @_ZN19ImportDefaultedDefsC1EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G32-DAG: define x86_thiscallcc void @_ZN19ImportDefaultedDefsC2EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G64-DAG: define void @_ZN19ImportDefaultedDefsC2EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) +// M32-DAG: define dso_local dllexport x86_thiscallcc %struct.ImportDefaultedDefs* @"??0ImportDefaultedDefs@@QAE@$$QAU0@@Z"(%struct.ImportDefaultedDefs* returned %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) +// M64-DAG: define dso_local dllexport %struct.ImportDefaultedDefs* @"??0ImportDefaultedDefs@@QEAA@$$QEAU0@@Z"(%struct.ImportDefaultedDefs* returned %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G32-DAG: define dso_local x86_thiscallcc void @_ZN19ImportDefaultedDefsC1EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G64-DAG: define dso_local void @_ZN19ImportDefaultedDefsC1EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G32-DAG: define dso_local x86_thiscallcc void @_ZN19ImportDefaultedDefsC2EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G64-DAG: define dso_local void @_ZN19ImportDefaultedDefsC2EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) ImportDefaultedDefs::ImportDefaultedDefs(ImportDefaultedDefs&&) = default; // dllimport ignored -// M32-DAG: define dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @"\01??4ImportDefaultedDefs@@QAEAAU0@$$QAU0@@Z"(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) -// M64-DAG: define dllexport dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @"\01??4ImportDefaultedDefs@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G32-DAG: define x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSEOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) -// G64-DAG: define dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSEOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) +// M32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @"??4ImportDefaultedDefs@@QAEAAU0@$$QAU0@@Z"(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) +// M64-DAG: define dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @"??4ImportDefaultedDefs@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G32-DAG: define dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSEOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) +// G64-DAG: define dso_local dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSEOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}})) ImportDefaultedDefs& ImportDefaultedDefs::operator=(ImportDefaultedDefs&&) = default; // dllimport ignored USESPECIALS(ImportDefaultedDefs) @@ -620,26 +620,26 @@ struct ImportAlloc { __declspec(dllimport) void operator delete[](void*); }; -// M32-DAG: declare dllimport i8* @"\01??2ImportAlloc@@SAPAXI@Z"(i32) -// M64-DAG: declare dllimport i8* @"\01??2ImportAlloc@@SAPEAX_K@Z"(i64) +// M32-DAG: declare dllimport i8* @"??2ImportAlloc@@SAPAXI@Z"(i32) +// M64-DAG: declare dllimport i8* @"??2ImportAlloc@@SAPEAX_K@Z"(i64) // G32-DAG: declare dllimport i8* @_ZN11ImportAllocnwEj(i32) // G64-DAG: declare dllimport i8* @_ZN11ImportAllocnwEy(i64) void UNIQ(use)() { new ImportAlloc(); } -// M32-DAG: declare dllimport i8* @"\01??_UImportAlloc@@SAPAXI@Z"(i32) -// M64-DAG: declare dllimport i8* @"\01??_UImportAlloc@@SAPEAX_K@Z"(i64) +// M32-DAG: declare dllimport i8* @"??_UImportAlloc@@SAPAXI@Z"(i32) +// M64-DAG: declare dllimport i8* @"??_UImportAlloc@@SAPEAX_K@Z"(i64) // G32-DAG: declare dllimport i8* @_ZN11ImportAllocnaEj(i32) // G64-DAG: declare dllimport i8* @_ZN11ImportAllocnaEy(i64) void UNIQ(use)() { new ImportAlloc[1]; } -// M32-DAG: declare dllimport void @"\01??3ImportAlloc@@SAXPAX@Z"(i8*) -// M64-DAG: declare dllimport void @"\01??3ImportAlloc@@SAXPEAX@Z"(i8*) +// M32-DAG: declare dllimport void @"??3ImportAlloc@@SAXPAX@Z"(i8*) +// M64-DAG: declare dllimport void @"??3ImportAlloc@@SAXPEAX@Z"(i8*) // G32-DAG: declare dllimport void @_ZN11ImportAllocdlEPv(i8*) // G64-DAG: declare dllimport void @_ZN11ImportAllocdlEPv(i8*) void UNIQ(use)(ImportAlloc* ptr) { delete ptr; } -// M32-DAG: declare dllimport void @"\01??_VImportAlloc@@SAXPAX@Z"(i8*) -// M64-DAG: declare dllimport void @"\01??_VImportAlloc@@SAXPEAX@Z"(i8*) +// M32-DAG: declare dllimport void @"??_VImportAlloc@@SAXPAX@Z"(i8*) +// M64-DAG: declare dllimport void @"??_VImportAlloc@@SAXPEAX@Z"(i8*) // G32-DAG: declare dllimport void @_ZN11ImportAllocdaEPv(i8*) // G64-DAG: declare dllimport void @_ZN11ImportAllocdaEPv(i8*) void UNIQ(use)(ImportAlloc* ptr) { delete[] ptr; } @@ -657,168 +657,168 @@ struct MemFunTmpl { }; // Import implicit instantiation of an imported member function template. -// M32-DAG: declare dllimport x86_thiscallcc void @"\01??$importedNormal@UImplicitInst_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) -// M64-DAG: declare dllimport void @"\01??$importedNormal@UImplicitInst_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) -// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI21ImplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this) -// G64-DAG: define linkonce_odr void @_ZN10MemFunTmpl14importedNormalI21ImplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this) +// M32-DAG: declare dllimport x86_thiscallcc void @"??$importedNormal@UImplicitInst_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) +// M64-DAG: declare dllimport void @"??$importedNormal@UImplicitInst_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) +// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI21ImplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this) +// G64-DAG: define linkonce_odr dso_local void @_ZN10MemFunTmpl14importedNormalI21ImplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this) USEMF(MemFunTmpl, importedNormal<ImplicitInst_Imported>) -// MSC-DAG: declare dllimport void @"\01??$importedStatic@UImplicitInst_Imported@@@MemFunTmpl@@SAXXZ"() -// GNU-DAG: define linkonce_odr void @_ZN10MemFunTmpl14importedStaticI21ImplicitInst_ImportedEEvv() +// MSC-DAG: declare dllimport void @"??$importedStatic@UImplicitInst_Imported@@@MemFunTmpl@@SAXXZ"() +// GNU-DAG: define linkonce_odr dso_local void @_ZN10MemFunTmpl14importedStaticI21ImplicitInst_ImportedEEvv() USE(MemFunTmpl::importedStatic<ImplicitInst_Imported>) // Import explicit instantiation declaration of an imported member function // template. -// M32-DAG: declare dllimport x86_thiscallcc void @"\01??$importedNormal@UExplicitDecl_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) -// M64-DAG: declare dllimport void @"\01??$importedNormal@UExplicitDecl_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) -// G32-DAG: declare x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI21ExplicitDecl_ImportedEEvv(%struct.MemFunTmpl*) -// G64-DAG: declare void @_ZN10MemFunTmpl14importedNormalI21ExplicitDecl_ImportedEEvv(%struct.MemFunTmpl*) +// M32-DAG: declare dllimport x86_thiscallcc void @"??$importedNormal@UExplicitDecl_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) +// M64-DAG: declare dllimport void @"??$importedNormal@UExplicitDecl_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) +// G32-DAG: declare dso_local x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI21ExplicitDecl_ImportedEEvv(%struct.MemFunTmpl*) +// G64-DAG: declare dso_local void @_ZN10MemFunTmpl14importedNormalI21ExplicitDecl_ImportedEEvv(%struct.MemFunTmpl*) extern template void MemFunTmpl::importedNormal<ExplicitDecl_Imported>(); USEMF(MemFunTmpl, importedNormal<ExplicitDecl_Imported>) -// MSC-DAG: declare dllimport void @"\01??$importedStatic@UExplicitDecl_Imported@@@MemFunTmpl@@SAXXZ"() -// GNU-DAG: declare void @_ZN10MemFunTmpl14importedStaticI21ExplicitDecl_ImportedEEvv() +// MSC-DAG: declare dllimport void @"??$importedStatic@UExplicitDecl_Imported@@@MemFunTmpl@@SAXXZ"() +// GNU-DAG: declare dso_local void @_ZN10MemFunTmpl14importedStaticI21ExplicitDecl_ImportedEEvv() extern template void MemFunTmpl::importedStatic<ExplicitDecl_Imported>(); USE(MemFunTmpl::importedStatic<ExplicitDecl_Imported>) // Import explicit instantiation definition of an imported member function // template. -// M32-DAG: declare dllimport x86_thiscallcc void @"\01??$importedNormal@UExplicitInst_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) -// M64-DAG: declare dllimport void @"\01??$importedNormal@UExplicitInst_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) -// G32-DAG: define weak_odr x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI21ExplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this) -// G64-DAG: define weak_odr void @_ZN10MemFunTmpl14importedNormalI21ExplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this) +// M32-DAG: declare dllimport x86_thiscallcc void @"??$importedNormal@UExplicitInst_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) +// M64-DAG: declare dllimport void @"??$importedNormal@UExplicitInst_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) +// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI21ExplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this) +// G64-DAG: define weak_odr dso_local void @_ZN10MemFunTmpl14importedNormalI21ExplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this) template void MemFunTmpl::importedNormal<ExplicitInst_Imported>(); USEMF(MemFunTmpl, importedNormal<ExplicitInst_Imported>) -// MSC-DAG: declare dllimport void @"\01??$importedStatic@UExplicitInst_Imported@@@MemFunTmpl@@SAXXZ"() -// GNU-DAG: define weak_odr void @_ZN10MemFunTmpl14importedStaticI21ExplicitInst_ImportedEEvv() +// MSC-DAG: declare dllimport void @"??$importedStatic@UExplicitInst_Imported@@@MemFunTmpl@@SAXXZ"() +// GNU-DAG: define weak_odr dso_local void @_ZN10MemFunTmpl14importedStaticI21ExplicitInst_ImportedEEvv() template void MemFunTmpl::importedStatic<ExplicitInst_Imported>(); USE(MemFunTmpl::importedStatic<ExplicitInst_Imported>) // Import specialization of an imported member function template. -// M32-DAG: declare dllimport x86_thiscallcc void @"\01??$importedNormal@UExplicitSpec_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) -// M64-DAG: declare dllimport void @"\01??$importedNormal@UExplicitSpec_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) +// M32-DAG: declare dllimport x86_thiscallcc void @"??$importedNormal@UExplicitSpec_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) +// M64-DAG: declare dllimport void @"??$importedNormal@UExplicitSpec_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) // G32-DAG: declare dllimport x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI21ExplicitSpec_ImportedEEvv(%struct.MemFunTmpl*) // G64-DAG: declare dllimport void @_ZN10MemFunTmpl14importedNormalI21ExplicitSpec_ImportedEEvv(%struct.MemFunTmpl*) template<> __declspec(dllimport) void MemFunTmpl::importedNormal<ExplicitSpec_Imported>(); USEMF(MemFunTmpl, importedNormal<ExplicitSpec_Imported>) -// M32-DAG-FIXME: declare dllimport x86_thiscallcc void @"\01??$importedNormal@UExplicitSpec_Def_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) -// M64-DAG-FIXME: declare dllimport void @"\01??$importedNormal@UExplicitSpec_Def_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) +// M32-DAG-FIXME: declare dllimport x86_thiscallcc void @"??$importedNormal@UExplicitSpec_Def_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) +// M64-DAG-FIXME: declare dllimport void @"??$importedNormal@UExplicitSpec_Def_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) #ifdef MSABI //template<> __declspec(dllimport) void MemFunTmpl::importedNormal<ExplicitSpec_Def_Imported>() {} //USEMF(MemFunTmpl, importedNormal<ExplicitSpec_Def_Imported>) #endif -// M32-DAG: declare dllimport x86_thiscallcc void @"\01??$importedNormal@UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) -// M64-DAG: declare dllimport void @"\01??$importedNormal@UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) -// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI31ExplicitSpec_InlineDef_ImportedEEvv(%struct.MemFunTmpl* %this) -// G64-DAG: define linkonce_odr void @_ZN10MemFunTmpl14importedNormalI31ExplicitSpec_InlineDef_ImportedEEvv(%struct.MemFunTmpl* %this) +// M32-DAG: declare dllimport x86_thiscallcc void @"??$importedNormal@UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) +// M64-DAG: declare dllimport void @"??$importedNormal@UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) +// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI31ExplicitSpec_InlineDef_ImportedEEvv(%struct.MemFunTmpl* %this) +// G64-DAG: define linkonce_odr dso_local void @_ZN10MemFunTmpl14importedNormalI31ExplicitSpec_InlineDef_ImportedEEvv(%struct.MemFunTmpl* %this) template<> __declspec(dllimport) inline void MemFunTmpl::importedNormal<ExplicitSpec_InlineDef_Imported>() {} USEMF(MemFunTmpl, importedNormal<ExplicitSpec_InlineDef_Imported>) -// MSC-DAG: declare dllimport void @"\01??$importedStatic@UExplicitSpec_Imported@@@MemFunTmpl@@SAXXZ"() +// MSC-DAG: declare dllimport void @"??$importedStatic@UExplicitSpec_Imported@@@MemFunTmpl@@SAXXZ"() // GNU-DAG: declare dllimport void @_ZN10MemFunTmpl14importedStaticI21ExplicitSpec_ImportedEEvv() template<> __declspec(dllimport) void MemFunTmpl::importedStatic<ExplicitSpec_Imported>(); USE(MemFunTmpl::importedStatic<ExplicitSpec_Imported>) -// MSC-DAG-FIXME: declare dllimport void @"\01??$importedStatic@UExplicitSpec_Def_Imported@@@MemFunTmpl@@SAXXZ"() +// MSC-DAG-FIXME: declare dllimport void @"??$importedStatic@UExplicitSpec_Def_Imported@@@MemFunTmpl@@SAXXZ"() #ifdef MSABI //template<> __declspec(dllimport) void MemFunTmpl::importedStatic<ExplicitSpec_Def_Imported>() {} //USE(MemFunTmpl::importedStatic<ExplicitSpec_Def_Imported>) #endif -// MSC-DAG: declare dllimport void @"\01??$importedStatic@UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@SAXXZ"() -// GNU-DAG: define linkonce_odr void @_ZN10MemFunTmpl14importedStaticI31ExplicitSpec_InlineDef_ImportedEEvv() +// MSC-DAG: declare dllimport void @"??$importedStatic@UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@SAXXZ"() +// GNU-DAG: define linkonce_odr dso_local void @_ZN10MemFunTmpl14importedStaticI31ExplicitSpec_InlineDef_ImportedEEvv() template<> __declspec(dllimport) inline void MemFunTmpl::importedStatic<ExplicitSpec_InlineDef_Imported>() {} USE(MemFunTmpl::importedStatic<ExplicitSpec_InlineDef_Imported>) // Not importing specialization of an imported member function template without // explicit dllimport. -// M32-DAG: define x86_thiscallcc void @"\01??$importedNormal@UExplicitSpec_NotImported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) -// M64-DAG: define void @"\01??$importedNormal@UExplicitSpec_NotImported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) -// G32-DAG: define x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI24ExplicitSpec_NotImportedEEvv(%struct.MemFunTmpl* %this) -// G64-DAG: define void @_ZN10MemFunTmpl14importedNormalI24ExplicitSpec_NotImportedEEvv(%struct.MemFunTmpl* %this) +// M32-DAG: define dso_local x86_thiscallcc void @"??$importedNormal@UExplicitSpec_NotImported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this) +// M64-DAG: define dso_local void @"??$importedNormal@UExplicitSpec_NotImported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this) +// G32-DAG: define dso_local x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI24ExplicitSpec_NotImportedEEvv(%struct.MemFunTmpl* %this) +// G64-DAG: define dso_local void @_ZN10MemFunTmpl14importedNormalI24ExplicitSpec_NotImportedEEvv(%struct.MemFunTmpl* %this) template<> void MemFunTmpl::importedNormal<ExplicitSpec_NotImported>() {} USEMF(MemFunTmpl, importedNormal<ExplicitSpec_NotImported>) -// MSC-DAG: define void @"\01??$importedStatic@UExplicitSpec_NotImported@@@MemFunTmpl@@SAXXZ"() -// GNU-DAG: define void @_ZN10MemFunTmpl14importedStaticI24ExplicitSpec_NotImportedEEvv() +// MSC-DAG: define dso_local void @"??$importedStatic@UExplicitSpec_NotImported@@@MemFunTmpl@@SAXXZ"() +// GNU-DAG: define dso_local void @_ZN10MemFunTmpl14importedStaticI24ExplicitSpec_NotImportedEEvv() template<> void MemFunTmpl::importedStatic<ExplicitSpec_NotImported>() {} USE(MemFunTmpl::importedStatic<ExplicitSpec_NotImported>) // Import explicit instantiation declaration of a non-imported member function // template. -// M32-DAG: declare dllimport x86_thiscallcc void @"\01??$normalDef@UExplicitDecl_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) -// M64-DAG: declare dllimport void @"\01??$normalDef@UExplicitDecl_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) -// G32-DAG: declare x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI21ExplicitDecl_ImportedEEvv(%struct.MemFunTmpl*) -// G64-DAG: declare void @_ZN10MemFunTmpl9normalDefI21ExplicitDecl_ImportedEEvv(%struct.MemFunTmpl*) +// M32-DAG: declare dllimport x86_thiscallcc void @"??$normalDef@UExplicitDecl_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) +// M64-DAG: declare dllimport void @"??$normalDef@UExplicitDecl_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) +// G32-DAG: declare dso_local x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI21ExplicitDecl_ImportedEEvv(%struct.MemFunTmpl*) +// G64-DAG: declare dso_local void @_ZN10MemFunTmpl9normalDefI21ExplicitDecl_ImportedEEvv(%struct.MemFunTmpl*) extern template __declspec(dllimport) void MemFunTmpl::normalDef<ExplicitDecl_Imported>(); USEMF(MemFunTmpl, normalDef<ExplicitDecl_Imported>) -// MSC-DAG: declare dllimport void @"\01??$staticDef@UExplicitDecl_Imported@@@MemFunTmpl@@SAXXZ"() -// GNU-DAG: declare void @_ZN10MemFunTmpl9staticDefI21ExplicitDecl_ImportedEEvv() +// MSC-DAG: declare dllimport void @"??$staticDef@UExplicitDecl_Imported@@@MemFunTmpl@@SAXXZ"() +// GNU-DAG: declare dso_local void @_ZN10MemFunTmpl9staticDefI21ExplicitDecl_ImportedEEvv() extern template __declspec(dllimport) void MemFunTmpl::staticDef<ExplicitDecl_Imported>(); USE(MemFunTmpl::staticDef<ExplicitDecl_Imported>) // Import explicit instantiation definition of a non-imported member function // template. -// M32-DAG: declare dllimport x86_thiscallcc void @"\01??$normalDef@UExplicitInst_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) -// M64-DAG: declare dllimport void @"\01??$normalDef@UExplicitInst_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) -// G32-DAG: define weak_odr x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI21ExplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this) -// G64-DAG: define weak_odr void @_ZN10MemFunTmpl9normalDefI21ExplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this) +// M32-DAG: declare dllimport x86_thiscallcc void @"??$normalDef@UExplicitInst_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) +// M64-DAG: declare dllimport void @"??$normalDef@UExplicitInst_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) +// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI21ExplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this) +// G64-DAG: define weak_odr dso_local void @_ZN10MemFunTmpl9normalDefI21ExplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this) template __declspec(dllimport) void MemFunTmpl::normalDef<ExplicitInst_Imported>(); USEMF(MemFunTmpl, normalDef<ExplicitInst_Imported>) -// MSC-DAG: declare dllimport void @"\01??$staticDef@UExplicitInst_Imported@@@MemFunTmpl@@SAXXZ"() -// GNU-DAG: define weak_odr void @_ZN10MemFunTmpl9staticDefI21ExplicitInst_ImportedEEvv() +// MSC-DAG: declare dllimport void @"??$staticDef@UExplicitInst_Imported@@@MemFunTmpl@@SAXXZ"() +// GNU-DAG: define weak_odr dso_local void @_ZN10MemFunTmpl9staticDefI21ExplicitInst_ImportedEEvv() template __declspec(dllimport) void MemFunTmpl::staticDef<ExplicitInst_Imported>(); USE(MemFunTmpl::staticDef<ExplicitInst_Imported>) // Import specialization of a non-imported member function template. -// M32-DAG: declare dllimport x86_thiscallcc void @"\01??$normalDef@UExplicitSpec_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) -// M64-DAG: declare dllimport void @"\01??$normalDef@UExplicitSpec_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) +// M32-DAG: declare dllimport x86_thiscallcc void @"??$normalDef@UExplicitSpec_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) +// M64-DAG: declare dllimport void @"??$normalDef@UExplicitSpec_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) // G32-DAG: declare dllimport x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI21ExplicitSpec_ImportedEEvv(%struct.MemFunTmpl*) // G64-DAG: declare dllimport void @_ZN10MemFunTmpl9normalDefI21ExplicitSpec_ImportedEEvv(%struct.MemFunTmpl*) template<> __declspec(dllimport) void MemFunTmpl::normalDef<ExplicitSpec_Imported>(); USEMF(MemFunTmpl, normalDef<ExplicitSpec_Imported>) -// M32-DAG-FIXME: declare dllimport x86_thiscallcc void @"\01??$normalDef@UExplicitSpec_Def_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) -// M64-DAG-FIXME: declare dllimport void @"\01??$normalDef@UExplicitSpec_Def_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) +// M32-DAG-FIXME: declare dllimport x86_thiscallcc void @"??$normalDef@UExplicitSpec_Def_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) +// M64-DAG-FIXME: declare dllimport void @"??$normalDef@UExplicitSpec_Def_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) #ifdef MSABI //template<> __declspec(dllimport) void MemFunTmpl::normalDef<ExplicitSpec_Def_Imported>() {} //USEMF(MemFunTmpl, normalDef<ExplicitSpec_Def_Imported>) #endif -// M32-DAG: declare dllimport x86_thiscallcc void @"\01??$normalDef@UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) -// M64-DAG: declare dllimport void @"\01??$normalDef@UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) -// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI31ExplicitSpec_InlineDef_ImportedEEvv(%struct.MemFunTmpl* %this) -// G64-DAG: define linkonce_odr void @_ZN10MemFunTmpl9normalDefI31ExplicitSpec_InlineDef_ImportedEEvv(%struct.MemFunTmpl* %this) +// M32-DAG: declare dllimport x86_thiscallcc void @"??$normalDef@UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*) +// M64-DAG: declare dllimport void @"??$normalDef@UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*) +// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI31ExplicitSpec_InlineDef_ImportedEEvv(%struct.MemFunTmpl* %this) +// G64-DAG: define linkonce_odr dso_local void @_ZN10MemFunTmpl9normalDefI31ExplicitSpec_InlineDef_ImportedEEvv(%struct.MemFunTmpl* %this) template<> __declspec(dllimport) inline void MemFunTmpl::normalDef<ExplicitSpec_InlineDef_Imported>() {} USEMF(MemFunTmpl, normalDef<ExplicitSpec_InlineDef_Imported>) -// MSC-DAG: declare dllimport void @"\01??$staticDef@UExplicitSpec_Imported@@@MemFunTmpl@@SAXXZ"() +// MSC-DAG: declare dllimport void @"??$staticDef@UExplicitSpec_Imported@@@MemFunTmpl@@SAXXZ"() // GNU-DAG: declare dllimport void @_ZN10MemFunTmpl9staticDefI21ExplicitSpec_ImportedEEvv() template<> __declspec(dllimport) void MemFunTmpl::staticDef<ExplicitSpec_Imported>(); USE(MemFunTmpl::staticDef<ExplicitSpec_Imported>) -// MSC-DAG-FIXME: declare dllimport void @"\01??$staticDef@UExplicitSpec_Def_Imported@@@MemFunTmpl@@SAXXZ"() +// MSC-DAG-FIXME: declare dllimport void @"??$staticDef@UExplicitSpec_Def_Imported@@@MemFunTmpl@@SAXXZ"() #ifdef MSABI //template<> __declspec(dllimport) void MemFunTmpl::staticDef<ExplicitSpec_Def_Imported>() {} //USE(MemFunTmpl::staticDef<ExplicitSpec_Def_Imported>) #endif -// MSC-DAG: declare dllimport void @"\01??$staticDef@UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@SAXXZ"() -// GNU-DAG: define linkonce_odr void @_ZN10MemFunTmpl9staticDefI31ExplicitSpec_InlineDef_ImportedEEvv() +// MSC-DAG: declare dllimport void @"??$staticDef@UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@SAXXZ"() +// GNU-DAG: define linkonce_odr dso_local void @_ZN10MemFunTmpl9staticDefI31ExplicitSpec_InlineDef_ImportedEEvv() template<> __declspec(dllimport) inline void MemFunTmpl::staticDef<ExplicitSpec_InlineDef_Imported>() {} USE(MemFunTmpl::staticDef<ExplicitSpec_InlineDef_Imported>) @@ -830,13 +830,13 @@ struct MemVarTmpl { }; // Import implicit instantiation of an imported member variable template. -// MSC-DAG: @"\01??$ImportedStaticVar@UImplicitInst_Imported@@@MemVarTmpl@@2HB" = available_externally dllimport constant i32 1, align 4 +// MSC-DAG: @"??$ImportedStaticVar@UImplicitInst_Imported@@@MemVarTmpl@@2HB" = available_externally dllimport constant i32 1, align 4 // GNU-DAG: @_ZN10MemVarTmpl17ImportedStaticVarI21ImplicitInst_ImportedEE = external dllimport constant i32 USEMV(MemVarTmpl, ImportedStaticVar<ImplicitInst_Imported>) // Import explicit instantiation declaration of an imported member variable // template. -// MSC-DAG: @"\01??$ImportedStaticVar@UExplicitDecl_Imported@@@MemVarTmpl@@2HB" = available_externally dllimport constant i32 1 +// MSC-DAG: @"??$ImportedStaticVar@UExplicitDecl_Imported@@@MemVarTmpl@@2HB" = available_externally dllimport constant i32 1 // GNU-DAG: @_ZN10MemVarTmpl17ImportedStaticVarI21ExplicitDecl_ImportedEE = external dllimport constant i32 extern template const int MemVarTmpl::ImportedStaticVar<ExplicitDecl_Imported>; USEMV(MemVarTmpl, ImportedStaticVar<ExplicitDecl_Imported>) @@ -846,22 +846,22 @@ USEMV(MemVarTmpl, ImportedStaticVar<ExplicitDecl_Imported>) // in-class initializer does not count. // Import specialization of an imported member variable template. -// MSC-DAG: @"\01??$ImportedStaticVar@UExplicitSpec_Imported@@@MemVarTmpl@@2HB" = external dllimport constant i32 +// MSC-DAG: @"??$ImportedStaticVar@UExplicitSpec_Imported@@@MemVarTmpl@@2HB" = external dllimport constant i32 // GNU-DAG: @_ZN10MemVarTmpl17ImportedStaticVarI21ExplicitSpec_ImportedEE = external dllimport constant i32 template<> __declspec(dllimport) const int MemVarTmpl::ImportedStaticVar<ExplicitSpec_Imported>; USEMV(MemVarTmpl, ImportedStaticVar<ExplicitSpec_Imported>) // Not importing specialization of a member variable template without explicit // dllimport. -// MSC-DAG: @"\01??$ImportedStaticVar@UExplicitSpec_NotImported@@@MemVarTmpl@@2HB" = external constant i32 -// GNU-DAG: @_ZN10MemVarTmpl17ImportedStaticVarI24ExplicitSpec_NotImportedEE = external constant i32 +// MSC-DAG: @"??$ImportedStaticVar@UExplicitSpec_NotImported@@@MemVarTmpl@@2HB" = external dso_local constant i32 +// GNU-DAG: @_ZN10MemVarTmpl17ImportedStaticVarI24ExplicitSpec_NotImportedEE = external dso_local constant i32 template<> const int MemVarTmpl::ImportedStaticVar<ExplicitSpec_NotImported>; USEMV(MemVarTmpl, ImportedStaticVar<ExplicitSpec_NotImported>) // Import explicit instantiation declaration of a non-imported member variable // template. -// MSC-DAG: @"\01??$StaticVar@UExplicitDecl_Imported@@@MemVarTmpl@@2HB" = available_externally dllimport constant i32 1 +// MSC-DAG: @"??$StaticVar@UExplicitDecl_Imported@@@MemVarTmpl@@2HB" = available_externally dllimport constant i32 1 // GNU-DAG: @_ZN10MemVarTmpl9StaticVarI21ExplicitDecl_ImportedEE = external dllimport constant i32 extern template __declspec(dllimport) const int MemVarTmpl::StaticVar<ExplicitDecl_Imported>; USEMV(MemVarTmpl, StaticVar<ExplicitDecl_Imported>) @@ -871,7 +871,7 @@ USEMV(MemVarTmpl, StaticVar<ExplicitDecl_Imported>) // in-class initializer does not count. // Import specialization of a non-imported member variable template. -// MSC-DAG: @"\01??$StaticVar@UExplicitSpec_Imported@@@MemVarTmpl@@2HB" = external dllimport constant i32 +// MSC-DAG: @"??$StaticVar@UExplicitSpec_Imported@@@MemVarTmpl@@2HB" = external dllimport constant i32 // GNU-DAG: @_ZN10MemVarTmpl9StaticVarI21ExplicitSpec_ImportedEE = external dllimport constant i32 template<> __declspec(dllimport) const int MemVarTmpl::StaticVar<ExplicitSpec_Imported>; USEMV(MemVarTmpl, StaticVar<ExplicitSpec_Imported>) diff --git a/test/CodeGenCXX/dllimport-memptr-global.cpp b/test/CodeGenCXX/dllimport-memptr-global.cpp index e64537b8b9f9e..91abfeb148385 100644 --- a/test/CodeGenCXX/dllimport-memptr-global.cpp +++ b/test/CodeGenCXX/dllimport-memptr-global.cpp @@ -40,19 +40,19 @@ auto mp_general_v = &General::virt; // All of the non-virtual globals need dynamic initializers. -// CHECK: @"\01?mp_single_nv@@3P8Single@@AEXXZQ1@" = global i8* null, align 4 -// CHECK: @"\01?mp_multi_nv@@3P8Multi@@AEXXZQ1@" = global { i8*, i32 } zeroinitializer, align 4 -// CHECK: @"\01?mp_virtual_nv@@3P8Virtual@@AEXXZQ1@" = global { i8*, i32, i32 } zeroinitializer, align 4 -// CHECK: @"\01?mp_general_nv@@3P8General@@AEXXZQ1@" = global { i8*, i32, i32, i32 } zeroinitializer, align 4 +// CHECK: @"?mp_single_nv@@3P8Single@@AEXXZQ1@" = dso_local global i8* null, align 4 +// CHECK: @"?mp_multi_nv@@3P8Multi@@AEXXZQ1@" = dso_local global { i8*, i32 } zeroinitializer, align 4 +// CHECK: @"?mp_virtual_nv@@3P8Virtual@@AEXXZQ1@" = dso_local global { i8*, i32, i32 } zeroinitializer, align 4 +// CHECK: @"?mp_general_nv@@3P8General@@AEXXZQ1@" = dso_local global { i8*, i32, i32, i32 } zeroinitializer, align 4 -// CHECK: @"\01?mp_single_v@@3P8Single@@AEXXZQ1@" = global i8* bitcast (void (%struct.Single*, ...)* @"\01??_9Single@@$BA@AE" to i8*), align 4 -// CHECK: @"\01?mp_multi_v@@3P8Multi@@AEXXZQ1@" = global { i8*, i32 } { i8* bitcast (void (%struct.Multi*, ...)* @"\01??_9Multi@@$BA@AE" to i8*), i32 0 }, align 4 -// CHECK: @"\01?mp_virtual_v@@3P8Virtual@@AEXXZQ1@" = global { i8*, i32, i32 } { i8* bitcast (void (%struct.Virtual*, ...)* @"\01??_9Virtual@@$BA@AE" to i8*), i32 0, i32 0 }, align 4 -// CHECK: @"\01?mp_general_v@@3P8General@@AEXXZQ1@" = global { i8*, i32, i32, i32 } { i8* bitcast (void (%struct.General*, ...)* @"\01??_9General@@$BA@AE" to i8*), i32 0, i32 0, i32 0 }, align 4 +// CHECK: @"?mp_single_v@@3P8Single@@AEXXZQ1@" = dso_local global i8* bitcast (void (%struct.Single*, ...)* @"??_9Single@@$BA@AE" to i8*), align 4 +// CHECK: @"?mp_multi_v@@3P8Multi@@AEXXZQ1@" = dso_local global { i8*, i32 } { i8* bitcast (void (%struct.Multi*, ...)* @"??_9Multi@@$BA@AE" to i8*), i32 0 }, align 4 +// CHECK: @"?mp_virtual_v@@3P8Virtual@@AEXXZQ1@" = dso_local global { i8*, i32, i32 } { i8* bitcast (void (%struct.Virtual*, ...)* @"??_9Virtual@@$BA@AE" to i8*), i32 0, i32 0 }, align 4 +// CHECK: @"?mp_general_v@@3P8General@@AEXXZQ1@" = dso_local global { i8*, i32, i32, i32 } { i8* bitcast (void (%struct.General*, ...)* @"??_9General@@$BA@AE" to i8*), i32 0, i32 0, i32 0 }, align 4 // CHECK: define internal void @_GLOBAL__sub_I{{.*}}() {{.*}} { -// CHECK: call void @"\01??__Emp_single_nv@@YAXXZ"() -// CHECK: call void @"\01??__Emp_multi_nv@@YAXXZ"() -// CHECK: call void @"\01??__Emp_virtual_nv@@YAXXZ"() -// CHECK: call void @"\01??__Emp_general_nv@@YAXXZ"() +// CHECK: call void @"??__Emp_single_nv@@YAXXZ"() +// CHECK: call void @"??__Emp_multi_nv@@YAXXZ"() +// CHECK: call void @"??__Emp_virtual_nv@@YAXXZ"() +// CHECK: call void @"??__Emp_general_nv@@YAXXZ"() // CHECK: } diff --git a/test/CodeGenCXX/dllimport-missing-key.cpp b/test/CodeGenCXX/dllimport-missing-key.cpp new file mode 100644 index 0000000000000..d8ef7aa7ea680 --- /dev/null +++ b/test/CodeGenCXX/dllimport-missing-key.cpp @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -triple i686-windows-gnu -emit-llvm -std=c++1y -O0 -o - %s -w | FileCheck --check-prefix=GNU %s + +class __declspec(dllimport) QObjectData { +public: + virtual ~QObjectData() = 0; + void *ptr; + + int method() const; +}; + +class LocalClass : public QObjectData { +}; + +void call() { + (new LocalClass())->method(); +} + +// GNU-DAG: @_ZTV11QObjectData = available_externally dllimport +// GNU-DAG: @_ZTS11QObjectData = linkonce_odr +// GNU-DAG: @_ZTI11QObjectData = linkonce_odr diff --git a/test/CodeGenCXX/dllimport-rtti.cpp b/test/CodeGenCXX/dllimport-rtti.cpp index 91e747ae1c15f..d8e6f8e1b9ab7 100644 --- a/test/CodeGenCXX/dllimport-rtti.cpp +++ b/test/CodeGenCXX/dllimport-rtti.cpp @@ -5,14 +5,14 @@ struct __declspec(dllimport) S { virtual void f() {} } s; // MSVC: [[VF_S:.*]] = private unnamed_addr constant { [2 x i8*] } -// MSVC-DAG: @"\01??_SS@@6B@" = unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* [[VF_S]], i32 0, i32 0, i32 1) -// MSVC-DAG: @"\01??_R0?AUS@@@8" = linkonce_odr -// MSVC-DAG: @"\01??_R1A@?0A@EA@S@@8" = linkonce_odr -// MSVC-DAG: @"\01??_R2S@@8" = linkonce_odr -// MSVC-DAG: @"\01??_R3S@@8" = linkonce_odr +// MSVC-DAG: @"??_SS@@6B@" = unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* [[VF_S]], i32 0, i32 0, i32 1) +// MSVC-DAG: @"??_R0?AUS@@@8" = linkonce_odr +// MSVC-DAG: @"??_R1A@?0A@EA@S@@8" = linkonce_odr +// MSVC-DAG: @"??_R2S@@8" = linkonce_odr +// MSVC-DAG: @"??_R3S@@8" = linkonce_odr // GNU-DAG: @_ZTV1S = available_externally dllimport -// GNU-DAG: @_ZTI1S = external dllimport +// GNU-DAG: @_ZTI1S = linkonce_odr dso_local struct U : S { } u; @@ -21,13 +21,13 @@ struct __declspec(dllimport) V { virtual void f(); } v; // GNU-DAG: @_ZTV1V = available_externally dllimport -// GNU-DAG: @_ZTS1V = linkonce_odr -// GNU-DAG: @_ZTI1V = linkonce_odr +// GNU-DAG: @_ZTS1V = linkonce_odr dso_local +// GNU-DAG: @_ZTI1V = linkonce_odr dso_local struct W { __declspec(dllimport) virtual void f(); virtual void g(); } w; -// GNU-DAG: @_ZTV1W = linkonce_odr -// GNU-DAG: @_ZTS1W = linkonce_odr -// GNU-DAG: @_ZTI1W = linkonce_odr +// GNU-DAG: @_ZTV1W = linkonce_odr dso_local +// GNU-DAG: @_ZTS1W = linkonce_odr dso_local +// GNU-DAG: @_ZTI1W = linkonce_odr dso_local diff --git a/test/CodeGenCXX/dllimport-template-sdm.cpp b/test/CodeGenCXX/dllimport-template-sdm.cpp new file mode 100644 index 0000000000000..33cbdf6b7e4ba --- /dev/null +++ b/test/CodeGenCXX/dllimport-template-sdm.cpp @@ -0,0 +1,53 @@ +// RUN: %clang_cc1 -triple x86_64-windows-msvc -emit-llvm -std=c++14 -fms-extensions -o - %s | FileCheck %s --check-prefix=IMPORT +// RUN: %clang_cc1 -triple x86_64-windows-msvc -emit-llvm -std=c++14 -fms-extensions -o - %s -DTEST_EXPORT | FileCheck %s --check-prefix=EXPORT + +#ifndef TEST_EXPORT +#define DLLATTR __declspec(dllimport) +#else +#define DLLATTR __declspec(dllexport) +#endif + +// PR37232: When a dllimport attribute is propagated from a derived class to a +// base class that happens to be a template specialization, it is only applied +// to template *methods*, and not static data members. If a dllexport attribute +// is propagated, it still applies to static data members. + +// IMPORT-DAG: @"?sdm@Exporter@@2HB" = available_externally dllimport constant i32 2, align 4 +// IMPORT-DAG: @"?csdm@?$A@H@@2HB" = linkonce_odr dso_local constant i32 2, comdat, align 4 +// IMPORT-DAG: @"?sdm@?$A@H@@2HA" = linkonce_odr dso_local global i32 1, comdat, align 4 +// IMPORT-DAG: @"?sdm@?$B@H@@2HB" = available_externally dllimport constant i32 2, align 4 +// IMPORT-DAG: @"?sdm@?$C@H@@2HB" = available_externally dllimport constant i32 2, align 4 + +// EXPORT-DAG: @"?sdm@Exporter@@2HB" = weak_odr dso_local dllexport constant i32 2, comdat, align 4 +// EXPORT-DAG: @"?csdm@?$A@H@@2HB" = weak_odr dso_local dllexport constant i32 2, comdat, align 4 +// EXPORT-DAG: @"?sdm@?$A@H@@2HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4 +// EXPORT-DAG: @"?sdm@?$B@H@@2HB" = weak_odr dso_local dllexport constant i32 2, comdat, align 4 +// EXPORT-DAG: @"?sdm@?$C@H@@2HB" = weak_odr dso_local dllexport constant i32 2, comdat, align 4 + + +template <typename T> struct A { + static constexpr int csdm = 2; + static int sdm; +}; +template <typename T> int A<T>::sdm = 1; + +struct DLLATTR Exporter : A<int> { + static constexpr int sdm = 2; +}; + +template <typename T> struct DLLATTR B { static constexpr int sdm = 2; }; + +template <typename T> struct DLLATTR C; +template <typename T> struct C { static constexpr int sdm = 2; }; + +void takeRef(const int &_Args) {} + +int main() { + takeRef(Exporter::sdm); + takeRef(A<int>::csdm); + takeRef(A<int>::sdm); + takeRef(B<int>::sdm); + takeRef(C<int>::sdm); + + return 1; +} diff --git a/test/CodeGenCXX/dllimport.cpp b/test/CodeGenCXX/dllimport.cpp index 14558aec39a4e..74f58cc3b1719 100644 --- a/test/CodeGenCXX/dllimport.cpp +++ b/test/CodeGenCXX/dllimport.cpp @@ -38,38 +38,38 @@ struct ExplicitSpec_NotImported {}; //===----------------------------------------------------------------------===// // Import declaration. -// MSC-DAG: @"\01?ExternGlobalDecl@@3HA" = external dllimport global i32 +// MSC-DAG: @"?ExternGlobalDecl@@3HA" = external dllimport global i32 // GNU-DAG: @ExternGlobalDecl = external dllimport global i32 __declspec(dllimport) extern int ExternGlobalDecl; USEVAR(ExternGlobalDecl) // dllimport implies a declaration. -// MSC-DAG: @"\01?GlobalDecl@@3HA" = external dllimport global i32 +// MSC-DAG: @"?GlobalDecl@@3HA" = external dllimport global i32 // GNU-DAG: @GlobalDecl = external dllimport global i32 __declspec(dllimport) int GlobalDecl; USEVAR(GlobalDecl) // Redeclarations -// MSC-DAG: @"\01?GlobalRedecl1@@3HA" = external dllimport global i32 +// MSC-DAG: @"?GlobalRedecl1@@3HA" = external dllimport global i32 // GNU-DAG: @GlobalRedecl1 = external dllimport global i32 __declspec(dllimport) extern int GlobalRedecl1; __declspec(dllimport) extern int GlobalRedecl1; USEVAR(GlobalRedecl1) -// MSC-DAG: @"\01?GlobalRedecl2a@@3HA" = external dllimport global i32 +// MSC-DAG: @"?GlobalRedecl2a@@3HA" = external dllimport global i32 // GNU-DAG: @GlobalRedecl2a = external dllimport global i32 __declspec(dllimport) int GlobalRedecl2a; __declspec(dllimport) int GlobalRedecl2a; USEVAR(GlobalRedecl2a) -// M32-DAG: @"\01?GlobalRedecl2b@@3PAHA" = external dllimport global i32* -// M64-DAG: @"\01?GlobalRedecl2b@@3PEAHEA" = external dllimport global i32* +// M32-DAG: @"?GlobalRedecl2b@@3PAHA" = external dllimport global i32* +// M64-DAG: @"?GlobalRedecl2b@@3PEAHEA" = external dllimport global i32* // GNU-DAG: @GlobalRedecl2b = external dllimport global i32* int *__attribute__((dllimport)) GlobalRedecl2b; int *__attribute__((dllimport)) GlobalRedecl2b; USEVARTYPE(int*, GlobalRedecl2b) -// MSC-DAG: @"\01?GlobalRedecl2c@@3HA" = external dllimport global i32 +// MSC-DAG: @"?GlobalRedecl2c@@3HA" = external dllimport global i32 // GNU-DAG: @GlobalRedecl2c = external dllimport global i32 int GlobalRedecl2c __attribute__((dllimport)); int GlobalRedecl2c __attribute__((dllimport)); @@ -77,20 +77,20 @@ USEVAR(GlobalRedecl2c) // NB: MSC issues a warning and makes GlobalRedecl3 dllexport. We follow GCC // and drop the dllimport with a warning. -// MSC-DAG: @"\01?GlobalRedecl3@@3HA" = external global i32 -// GNU-DAG: @GlobalRedecl3 = external global i32 +// MSC-DAG: @"?GlobalRedecl3@@3HA" = external dso_local global i32 +// GNU-DAG: @GlobalRedecl3 = external dso_local global i32 __declspec(dllimport) extern int GlobalRedecl3; extern int GlobalRedecl3; // dllimport ignored USEVAR(GlobalRedecl3) -// MSC-DAG: @"\01?ExternalGlobal@ns@@3HA" = external dllimport global i32 +// MSC-DAG: @"?ExternalGlobal@ns@@3HA" = external dllimport global i32 // GNU-DAG: @_ZN2ns14ExternalGlobalE = external dllimport global i32 namespace ns { __declspec(dllimport) int ExternalGlobal; } USEVAR(ns::ExternalGlobal) int __declspec(dllimport) f(); -// MO1-DAG: @"\01?x@?1??inlineStaticLocalsFunc@@YAHXZ@4HA" = available_externally dllimport global i32 0 -// MO1-DAG: @"\01??_B?1??inlineStaticLocalsFunc@@YAHXZ@51" = available_externally dllimport global i32 0 +// MO1-DAG: @"?x@?1??inlineStaticLocalsFunc@@YAHXZ@4HA" = available_externally dllimport global i32 0 +// MO1-DAG: @"??_B?1??inlineStaticLocalsFunc@@YAHXZ@51" = available_externally dllimport global i32 0 inline int __declspec(dllimport) inlineStaticLocalsFunc() { static int x = f(); return x++; @@ -98,7 +98,7 @@ inline int __declspec(dllimport) inlineStaticLocalsFunc() { USE(inlineStaticLocalsFunc); // The address of a dllimport global cannot be used in constant initialization. -// M32-DAG: @"\01?arr@?1??initializationFunc@@YAPAHXZ@4QBQAHB" = internal global [1 x i32*] zeroinitializer +// M32-DAG: @"?arr@?1??initializationFunc@@YAPAHXZ@4QBQAHB" = internal global [1 x i32*] zeroinitializer // GNU-DAG: @_ZZ18initializationFuncvE3arr = internal global [1 x i32*] zeroinitializer int *initializationFunc() { static int *const arr[] = {&ExternGlobalDecl}; @@ -112,38 +112,38 @@ USE(initializationFunc); //===----------------------------------------------------------------------===// // Import declaration. -// MSC-DAG: @"\01??$ExternVarTmplDecl@UImplicitInst_Imported@@@@3HA" = external dllimport global i32 +// MSC-DAG: @"??$ExternVarTmplDecl@UImplicitInst_Imported@@@@3HA" = external dllimport global i32 // GNU-DAG: @_Z17ExternVarTmplDeclI21ImplicitInst_ImportedE = external dllimport global i32 template<typename T> __declspec(dllimport) extern int ExternVarTmplDecl; USEVAR(ExternVarTmplDecl<ImplicitInst_Imported>) // dllimport implies a declaration. -// MSC-DAG: @"\01??$VarTmplDecl@UImplicitInst_Imported@@@@3HA" = external dllimport global i32 +// MSC-DAG: @"??$VarTmplDecl@UImplicitInst_Imported@@@@3HA" = external dllimport global i32 // GNU-DAG: @_Z11VarTmplDeclI21ImplicitInst_ImportedE = external dllimport global i32 template<typename T> __declspec(dllimport) int VarTmplDecl; USEVAR(VarTmplDecl<ImplicitInst_Imported>) // Redeclarations -// MSC-DAG: @"\01??$VarTmplRedecl1@UImplicitInst_Imported@@@@3HA" = external dllimport global i32 +// MSC-DAG: @"??$VarTmplRedecl1@UImplicitInst_Imported@@@@3HA" = external dllimport global i32 // GNU-DAG: @_Z14VarTmplRedecl1I21ImplicitInst_ImportedE = external dllimport global i32 template<typename T> __declspec(dllimport) extern int VarTmplRedecl1; template<typename T> __declspec(dllimport) extern int VarTmplRedecl1; USEVAR(VarTmplRedecl1<ImplicitInst_Imported>) -// MSC-DAG: @"\01??$VarTmplRedecl2@UImplicitInst_Imported@@@@3HA" = external dllimport global i32 +// MSC-DAG: @"??$VarTmplRedecl2@UImplicitInst_Imported@@@@3HA" = external dllimport global i32 // GNU-DAG: @_Z14VarTmplRedecl2I21ImplicitInst_ImportedE = external dllimport global i32 template<typename T> __declspec(dllimport) int VarTmplRedecl2; template<typename T> __declspec(dllimport) int VarTmplRedecl2; USEVAR(VarTmplRedecl2<ImplicitInst_Imported>) -// MSC-DAG: @"\01??$VarTmplRedecl3@UImplicitInst_Imported@@@@3HA" = external global i32 -// GNU-DAG: @_Z14VarTmplRedecl3I21ImplicitInst_ImportedE = external global i32 +// MSC-DAG: @"??$VarTmplRedecl3@UImplicitInst_Imported@@@@3HA" = external dso_local global i32 +// GNU-DAG: @_Z14VarTmplRedecl3I21ImplicitInst_ImportedE = external dso_local global i32 template<typename T> __declspec(dllimport) extern int VarTmplRedecl3; template<typename T> extern int VarTmplRedecl3; // dllimport ignored USEVAR(VarTmplRedecl3<ImplicitInst_Imported>) -// MSC-DAG: @"\01??$ExternalVarTmpl@UImplicitInst_Imported@@@ns@@3HA" = external dllimport global i32 +// MSC-DAG: @"??$ExternalVarTmpl@UImplicitInst_Imported@@@ns@@3HA" = external dllimport global i32 // GNU-DAG: @_ZN2ns15ExternalVarTmplI21ImplicitInst_ImportedEE = external dllimport global i32 namespace ns { template<typename T> __declspec(dllimport) int ExternalVarTmpl; } USEVAR(ns::ExternalVarTmpl<ImplicitInst_Imported>) @@ -153,12 +153,12 @@ template<typename T> int VarTmpl; template<typename T> __declspec(dllimport) int ImportedVarTmpl; // Import implicit instantiation of an imported variable template. -// MSC-DAG: @"\01??$ImportedVarTmpl@UImplicitInst_Imported@@@@3HA" = external dllimport global i32 +// MSC-DAG: @"??$ImportedVarTmpl@UImplicitInst_Imported@@@@3HA" = external dllimport global i32 // GNU-DAG: @_Z15ImportedVarTmplI21ImplicitInst_ImportedE = external dllimport global i32 USEVAR(ImportedVarTmpl<ImplicitInst_Imported>) // Import explicit instantiation declaration of an imported variable template. -// MSC-DAG: @"\01??$ImportedVarTmpl@UExplicitDecl_Imported@@@@3HA" = external dllimport global i32 +// MSC-DAG: @"??$ImportedVarTmpl@UExplicitDecl_Imported@@@@3HA" = external dllimport global i32 // GNU-DAG: @_Z15ImportedVarTmplI21ExplicitDecl_ImportedE = external dllimport global i32 extern template int ImportedVarTmpl<ExplicitDecl_Imported>; USEVAR(ImportedVarTmpl<ExplicitDecl_Imported>) @@ -167,32 +167,32 @@ USEVAR(ImportedVarTmpl<ExplicitDecl_Imported>) // be imported because the template must be defined which is illegal. // Import specialization of an imported variable template. -// MSC-DAG: @"\01??$ImportedVarTmpl@UExplicitSpec_Imported@@@@3HA" = external dllimport global i32 +// MSC-DAG: @"??$ImportedVarTmpl@UExplicitSpec_Imported@@@@3HA" = external dllimport global i32 // GNU-DAG: @_Z15ImportedVarTmplI21ExplicitSpec_ImportedE = external dllimport global i32 template<> __declspec(dllimport) int ImportedVarTmpl<ExplicitSpec_Imported>; USEVAR(ImportedVarTmpl<ExplicitSpec_Imported>) // Not importing specialization of an imported variable template without // explicit dllimport. -// MSC-DAG: @"\01??$ImportedVarTmpl@UExplicitSpec_NotImported@@@@3HA" = global i32 0, align 4 -// GNU-DAG: @_Z15ImportedVarTmplI24ExplicitSpec_NotImportedE = global i32 0, align 4 +// MSC-DAG: @"??$ImportedVarTmpl@UExplicitSpec_NotImported@@@@3HA" = dso_local global i32 0, align 4 +// GNU-DAG: @_Z15ImportedVarTmplI24ExplicitSpec_NotImportedE = dso_local global i32 0, align 4 template<> int ImportedVarTmpl<ExplicitSpec_NotImported>; USEVAR(ImportedVarTmpl<ExplicitSpec_NotImported>) // Import explicit instantiation declaration of a non-imported variable template. -// MSC-DAG: @"\01??$VarTmpl@UExplicitDecl_Imported@@@@3HA" = external dllimport global i32 +// MSC-DAG: @"??$VarTmpl@UExplicitDecl_Imported@@@@3HA" = external dllimport global i32 // GNU-DAG: @_Z7VarTmplI21ExplicitDecl_ImportedE = external dllimport global i32 extern template __declspec(dllimport) int VarTmpl<ExplicitDecl_Imported>; USEVAR(VarTmpl<ExplicitDecl_Imported>) // Import explicit instantiation definition of a non-imported variable template. -// MSC-DAG: @"\01??$VarTmpl@UExplicitInst_Imported@@@@3HA" = external dllimport global i32 +// MSC-DAG: @"??$VarTmpl@UExplicitInst_Imported@@@@3HA" = external dllimport global i32 // GNU-DAG: @_Z7VarTmplI21ExplicitInst_ImportedE = external dllimport global i32 template __declspec(dllimport) int VarTmpl<ExplicitInst_Imported>; USEVAR(VarTmpl<ExplicitInst_Imported>) // Import specialization of a non-imported variable template. -// MSC-DAG: @"\01??$VarTmpl@UExplicitSpec_Imported@@@@3HA" = external dllimport global i32 +// MSC-DAG: @"??$VarTmpl@UExplicitSpec_Imported@@@@3HA" = external dllimport global i32 // GNU-DAG: @_Z7VarTmplI21ExplicitSpec_ImportedE = external dllimport global i32 template<> __declspec(dllimport) int VarTmpl<ExplicitSpec_Imported>; USEVAR(VarTmpl<ExplicitSpec_Imported>) @@ -203,8 +203,10 @@ USEVAR(VarTmpl<ExplicitSpec_Imported>) // Functions //===----------------------------------------------------------------------===// +// GNU-DAG: declare dso_local void @_ZdlPv(i8*) + // Import function declaration. -// MSC-DAG: declare dllimport void @"\01?decl@@YAXXZ"() +// MSC-DAG: declare dllimport void @"?decl@@YAXXZ"() // GNU-DAG: declare dllimport void @_Z4declv() __declspec(dllimport) void decl(); USE(decl) @@ -216,42 +218,42 @@ extern "C" __declspec(dllimport) void externC(); USE(externC) // Import inline function. -// MSC-DAG: declare dllimport void @"\01?inlineFunc@@YAXXZ"() -// GNU-DAG: define linkonce_odr void @_Z10inlineFuncv() -// MO1-DAG: define available_externally dllimport void @"\01?inlineFunc@@YAXXZ"() -// GO1-DAG: define linkonce_odr void @_Z10inlineFuncv() +// MSC-DAG: declare dllimport void @"?inlineFunc@@YAXXZ"() +// GNU-DAG: define linkonce_odr dso_local void @_Z10inlineFuncv() +// MO1-DAG: define available_externally dllimport void @"?inlineFunc@@YAXXZ"() +// GO1-DAG: define linkonce_odr dso_local void @_Z10inlineFuncv() __declspec(dllimport) inline void inlineFunc() {} USE(inlineFunc) -// MSC-DAG: declare dllimport void @"\01?inlineDecl@@YAXXZ"() -// GNU-DAG: define linkonce_odr void @_Z10inlineDeclv() -// MO1-DAG: define available_externally dllimport void @"\01?inlineDecl@@YAXXZ"() -// GO1-DAG: define linkonce_odr void @_Z10inlineDeclv() +// MSC-DAG: declare dllimport void @"?inlineDecl@@YAXXZ"() +// GNU-DAG: define linkonce_odr dso_local void @_Z10inlineDeclv() +// MO1-DAG: define available_externally dllimport void @"?inlineDecl@@YAXXZ"() +// GO1-DAG: define linkonce_odr dso_local void @_Z10inlineDeclv() __declspec(dllimport) inline void inlineDecl(); void inlineDecl() {} USE(inlineDecl) -// MSC-DAG: declare dllimport void @"\01?inlineDef@@YAXXZ"() -// GNU-DAG: define linkonce_odr void @_Z9inlineDefv() -// MO1-DAG: define available_externally dllimport void @"\01?inlineDef@@YAXXZ"() -// GO1-DAG: define linkonce_odr void @_Z9inlineDefv() +// MSC-DAG: declare dllimport void @"?inlineDef@@YAXXZ"() +// GNU-DAG: define linkonce_odr dso_local void @_Z9inlineDefv() +// MO1-DAG: define available_externally dllimport void @"?inlineDef@@YAXXZ"() +// GO1-DAG: define linkonce_odr dso_local void @_Z9inlineDefv() __declspec(dllimport) void inlineDef(); inline void inlineDef() {} USE(inlineDef) // inline attributes -// MSC-DAG: declare dllimport void @"\01?noinline@@YAXXZ"() -// GNU-DAG: define linkonce_odr void @_Z8noinlinev() +// MSC-DAG: declare dllimport void @"?noinline@@YAXXZ"() +// GNU-DAG: define linkonce_odr dso_local void @_Z8noinlinev() __declspec(dllimport) __attribute__((noinline)) inline void noinline() {} USE(noinline) -// MSC2-NOT: @"\01?alwaysInline@@YAXXZ"() +// MSC2-NOT: @"?alwaysInline@@YAXXZ"() // GNU2-NOT: @_Z12alwaysInlinev() __declspec(dllimport) __attribute__((always_inline)) inline void alwaysInline() {} USE(alwaysInline) // Redeclarations -// MSC-DAG: declare dllimport void @"\01?redecl1@@YAXXZ"() +// MSC-DAG: declare dllimport void @"?redecl1@@YAXXZ"() // GNU-DAG: declare dllimport void @_Z7redecl1v() __declspec(dllimport) void redecl1(); __declspec(dllimport) void redecl1(); @@ -259,30 +261,30 @@ USE(redecl1) // NB: MSC issues a warning and makes redecl2/redecl3 dllexport. We follow GCC // and drop the dllimport with a warning. -// MSC-DAG: declare void @"\01?redecl2@@YAXXZ"() -// GNU-DAG: declare void @_Z7redecl2v() +// MSC-DAG: declare dso_local void @"?redecl2@@YAXXZ"() +// GNU-DAG: declare dso_local void @_Z7redecl2v() __declspec(dllimport) void redecl2(); void redecl2(); USE(redecl2) -// MSC-DAG: define dllexport void @"\01?redecl3@@YAXXZ"() -// GNU-DAG: define void @_Z7redecl3v() +// MSC-DAG: define dso_local dllexport void @"?redecl3@@YAXXZ"() +// GNU-DAG: define dso_local void @_Z7redecl3v() __declspec(dllimport) void redecl3(); void redecl3() {} // dllimport ignored USE(redecl3) // Friend functions -// MSC-DAG: declare dllimport void @"\01?friend1@@YAXXZ"() -// GNU-DAG: declare dllimport void @_Z7friend1v() -// MSC-DAG: declare void @"\01?friend2@@YAXXZ"() -// GNU-DAG: declare void @_Z7friend2v() -// MSC-DAG: define dllexport void @"\01?friend3@@YAXXZ"() -// GNU-DAG: define void @_Z7friend3v() -// MSC-DAG: declare void @"\01?friend4@@YAXXZ"() -// GNU-DAG: declare void @_Z7friend4v() -// MSC-DAG: declare dllimport void @"\01?friend5@@YAXXZ"() -// GNU-DAG: declare dllimport void @_Z7friend5v() +// MSC-DAG: declare dllimport void @"?friend1@@YAXXZ"() +// GNU-DAG: declare dllimport void @_Z7friend1v() +// MSC-DAG: declare dso_local void @"?friend2@@YAXXZ"() +// GNU-DAG: declare dso_local void @_Z7friend2v() +// MSC-DAG: define dso_local dllexport void @"?friend3@@YAXXZ"() +// GNU-DAG: define dso_local void @_Z7friend3v() +// MSC-DAG: declare dso_local void @"?friend4@@YAXXZ"() +// GNU-DAG: declare dso_local void @_Z7friend4v() +// MSC-DAG: declare dllimport void @"?friend5@@YAXXZ"() +// GNU-DAG: declare dllimport void @_Z7friend5v() struct FuncFriend { friend __declspec(dllimport) void friend1(); @@ -306,12 +308,12 @@ USE(friend4) USE(friend5) // Implicit declarations can be redeclared with dllimport. -// MSC-DAG: declare dllimport noalias i8* @"\01??2@{{YAPAXI|YAPEAX_K}}@Z"( +// MSC-DAG: declare dllimport noalias i8* @"??2@{{YAPAXI|YAPEAX_K}}@Z"( // GNU-DAG: declare dllimport noalias i8* @_Znw{{[yj]}}( __declspec(dllimport) void* operator new(__SIZE_TYPE__ n); void UNIQ(use)() { ::operator new(42); } -// MSC-DAG: declare dllimport void @"\01?externalFunc@ns@@YAXXZ"() +// MSC-DAG: declare dllimport void @"?externalFunc@ns@@YAXXZ"() // GNU-DAG: declare dllimport void @_ZN2ns12externalFuncEv() namespace ns { __declspec(dllimport) void externalFunc(); } USE(ns::externalFunc) @@ -325,17 +327,17 @@ int NonImportedFunc(); struct ClassWithNonImportedMethod { int f(); }; __declspec(dllimport) inline int ReferencingImportedVar() { return ImportedVar; } -// MO1-DAG: define available_externally dllimport i32 @"\01?ReferencingImportedVar@@YAHXZ" +// MO1-DAG: define available_externally dllimport i32 @"?ReferencingImportedVar@@YAHXZ" __declspec(dllimport) inline int ReferencingNonImportedVar() { return NonImportedVar; } -// MO1-DAG: declare dllimport i32 @"\01?ReferencingNonImportedVar@@YAHXZ"() +// MO1-DAG: declare dllimport i32 @"?ReferencingNonImportedVar@@YAHXZ"() __declspec(dllimport) inline int ReferencingImportedFunc() { return ImportedFunc(); } -// MO1-DAG: define available_externally dllimport i32 @"\01?ReferencingImportedFunc@@YAHXZ" +// MO1-DAG: define available_externally dllimport i32 @"?ReferencingImportedFunc@@YAHXZ" __declspec(dllimport) inline int ReferencingNonImportedFunc() { return NonImportedFunc(); } -// MO1-DAG: declare dllimport i32 @"\01?ReferencingNonImportedFunc@@YAHXZ"() +// MO1-DAG: declare dllimport i32 @"?ReferencingNonImportedFunc@@YAHXZ"() __declspec(dllimport) inline int ReferencingNonImportedMethod(ClassWithNonImportedMethod *x) { return x->f(); } -// MO1-DAG: declare dllimport i32 @"\01?ReferencingNonImportedMethod +// MO1-DAG: declare dllimport i32 @"?ReferencingNonImportedMethod __declspec(dllimport) inline int ReferencingClassMemberPtr(int (ClassWithNonImportedMethod::*p)(), ClassWithNonImportedMethod *x) { return (x->*p)(); } -// MO1-DAG: define available_externally dllimport i32 @"\01?ReferencingClassMemberPtr@@YAHP8ClassWithNonImportedMethod@@AEHXZPAU1@@Z" +// MO1-DAG: define available_externally dllimport i32 @"?ReferencingClassMemberPtr@@YAHP8ClassWithNonImportedMethod@@AEHXZPAU1@@Z" USE(ReferencingImportedVar) USE(ReferencingNonImportedVar) USE(ReferencingImportedFunc) @@ -344,17 +346,17 @@ USE1(ReferencingNonImportedMethod) void UNIQ(use)() { ReferencingClassMemberPtr(&ClassWithNonImportedMethod::f, nullptr); } // References to operator new and delete count too, despite not being DeclRefExprs. __declspec(dllimport) inline int *ReferencingNonImportedNew() { return new int[2]; } -// MO1-DAG: declare dllimport i32* @"\01?ReferencingNonImportedNew@@YAPAHXZ" +// MO1-DAG: declare dllimport i32* @"?ReferencingNonImportedNew@@YAPAHXZ" __declspec(dllimport) inline int *ReferencingNonImportedDelete() { delete (int*)nullptr; } -// MO1-DAG: declare dllimport i32* @"\01?ReferencingNonImportedDelete@@YAPAHXZ" +// MO1-DAG: declare dllimport i32* @"?ReferencingNonImportedDelete@@YAPAHXZ" USE(ReferencingNonImportedNew) USE(ReferencingNonImportedDelete) __declspec(dllimport) void* operator new[](__SIZE_TYPE__); __declspec(dllimport) void operator delete(void*); __declspec(dllimport) inline int *ReferencingImportedNew() { return new int[2]; } -// MO1-DAG: define available_externally dllimport i32* @"\01?ReferencingImportedNew@@YAPAHXZ" +// MO1-DAG: define available_externally dllimport i32* @"?ReferencingImportedNew@@YAPAHXZ" __declspec(dllimport) inline int *ReferencingImportedDelete() { delete (int*)nullptr; } -// MO1-DAG: define available_externally dllimport i32* @"\01?ReferencingImportedDelete@@YAPAHXZ" +// MO1-DAG: define available_externally dllimport i32* @"?ReferencingImportedDelete@@YAPAHXZ" USE(ReferencingImportedNew) USE(ReferencingImportedDelete) struct ClassWithDtor { ~ClassWithDtor() {} }; @@ -362,25 +364,25 @@ struct __declspec(dllimport) ClassWithNonDllImportField { using X = ClassWithDto struct __declspec(dllimport) ClassWithNonDllImportBase : public ClassWithDtor { }; USECLASS(ClassWithNonDllImportField); USECLASS(ClassWithNonDllImportBase); -// MO1-DAG: declare dllimport x86_thiscallcc void @"\01??1ClassWithNonDllImportBase@@QAE@XZ"(%struct.ClassWithNonDllImportBase*) -// MO1-DAG: declare dllimport x86_thiscallcc void @"\01??1ClassWithNonDllImportField@@QAE@XZ"(%struct.ClassWithNonDllImportField*) +// MO1-DAG: declare dllimport x86_thiscallcc void @"??1ClassWithNonDllImportBase@@QAE@XZ"(%struct.ClassWithNonDllImportBase*) +// MO1-DAG: declare dllimport x86_thiscallcc void @"??1ClassWithNonDllImportField@@QAE@XZ"(%struct.ClassWithNonDllImportField*) struct ClassWithCtor { ClassWithCtor() {} }; struct __declspec(dllimport) ClassWithNonDllImportFieldWithCtor { ClassWithCtor t; }; USECLASS(ClassWithNonDllImportFieldWithCtor); -// MO1-DAG: declare dllimport x86_thiscallcc %struct.ClassWithNonDllImportFieldWithCtor* @"\01??0ClassWithNonDllImportFieldWithCtor@@QAE@XZ"(%struct.ClassWithNonDllImportFieldWithCtor* returned) +// MO1-DAG: declare dllimport x86_thiscallcc %struct.ClassWithNonDllImportFieldWithCtor* @"??0ClassWithNonDllImportFieldWithCtor@@QAE@XZ"(%struct.ClassWithNonDllImportFieldWithCtor* returned) struct ClassWithImplicitDtor { __declspec(dllimport) ClassWithImplicitDtor(); ClassWithDtor member; }; __declspec(dllimport) inline void ReferencingDtorThroughDefinition() { ClassWithImplicitDtor x; }; USE(ReferencingDtorThroughDefinition) -// MO1-DAG: declare dllimport void @"\01?ReferencingDtorThroughDefinition@@YAXXZ"() +// MO1-DAG: declare dllimport void @"?ReferencingDtorThroughDefinition@@YAXXZ"() __declspec(dllimport) inline void ReferencingDtorThroughTemporary() { ClassWithImplicitDtor(); }; USE(ReferencingDtorThroughTemporary) -// MO1-DAG: declare dllimport void @"\01?ReferencingDtorThroughTemporary@@YAXXZ"() +// MO1-DAG: declare dllimport void @"?ReferencingDtorThroughTemporary@@YAXXZ"() // A dllimport function with a TLS variable must not be available_externally. __declspec(dllimport) inline void FunctionWithTLSVar() { static __thread int x = 42; } -// MO1-DAG: declare dllimport void @"\01?FunctionWithTLSVar@@YAXXZ" +// MO1-DAG: declare dllimport void @"?FunctionWithTLSVar@@YAXXZ" __declspec(dllimport) inline void FunctionWithNormalVar() { static int x = 42; } -// MO1-DAG: define available_externally dllimport void @"\01?FunctionWithNormalVar@@YAXXZ" +// MO1-DAG: define available_externally dllimport void @"?FunctionWithNormalVar@@YAXXZ" USE(FunctionWithTLSVar) USE(FunctionWithNormalVar) @@ -390,7 +392,7 @@ USE(FunctionWithNormalVar) //===----------------------------------------------------------------------===// // Import function template declaration. -// MSC-DAG: declare dllimport void @"\01??$funcTmplDecl@UImplicitInst_Imported@@@@YAXXZ"() +// MSC-DAG: declare dllimport void @"??$funcTmplDecl@UImplicitInst_Imported@@@@YAXXZ"() // GNU-DAG: declare dllimport void @_Z12funcTmplDeclI21ImplicitInst_ImportedEvv() template<typename T> __declspec(dllimport) void funcTmplDecl(); USE(funcTmplDecl<ImplicitInst_Imported>) @@ -398,66 +400,66 @@ USE(funcTmplDecl<ImplicitInst_Imported>) // Function template definitions cannot be imported. // Import inline function template. -// MSC-DAG: declare dllimport void @"\01??$inlineFuncTmpl1@UImplicitInst_Imported@@@@YAXXZ"() -// GNU-DAG: define linkonce_odr void @_Z15inlineFuncTmpl1I21ImplicitInst_ImportedEvv() -// MO1-DAG: define available_externally dllimport void @"\01??$inlineFuncTmpl1@UImplicitInst_Imported@@@@YAXXZ"() -// GO1-DAG: define linkonce_odr void @_Z15inlineFuncTmpl1I21ImplicitInst_ImportedEvv() +// MSC-DAG: declare dllimport void @"??$inlineFuncTmpl1@UImplicitInst_Imported@@@@YAXXZ"() +// GNU-DAG: define linkonce_odr dso_local void @_Z15inlineFuncTmpl1I21ImplicitInst_ImportedEvv() +// MO1-DAG: define available_externally dllimport void @"??$inlineFuncTmpl1@UImplicitInst_Imported@@@@YAXXZ"() +// GO1-DAG: define linkonce_odr dso_local void @_Z15inlineFuncTmpl1I21ImplicitInst_ImportedEvv() template<typename T> __declspec(dllimport) inline void inlineFuncTmpl1() {} USE(inlineFuncTmpl1<ImplicitInst_Imported>) -// MSC-DAG: declare dllimport void @"\01??$inlineFuncTmpl2@UImplicitInst_Imported@@@@YAXXZ"() -// GNU-DAG: define linkonce_odr void @_Z15inlineFuncTmpl2I21ImplicitInst_ImportedEvv() -// MO1-DAG: define available_externally dllimport void @"\01??$inlineFuncTmpl2@UImplicitInst_Imported@@@@YAXXZ"() -// GO1-DAG: define linkonce_odr void @_Z15inlineFuncTmpl2I21ImplicitInst_ImportedEvv() +// MSC-DAG: declare dllimport void @"??$inlineFuncTmpl2@UImplicitInst_Imported@@@@YAXXZ"() +// GNU-DAG: define linkonce_odr dso_local void @_Z15inlineFuncTmpl2I21ImplicitInst_ImportedEvv() +// MO1-DAG: define available_externally dllimport void @"??$inlineFuncTmpl2@UImplicitInst_Imported@@@@YAXXZ"() +// GO1-DAG: define linkonce_odr dso_local void @_Z15inlineFuncTmpl2I21ImplicitInst_ImportedEvv() template<typename T> inline void __attribute__((dllimport)) inlineFuncTmpl2() {} USE(inlineFuncTmpl2<ImplicitInst_Imported>) -// MSC-DAG: define linkonce_odr void @"\01??$inlineFuncTmplDecl@UImplicitInst_Imported@@@@YAXXZ"() -// GNU-DAG: define linkonce_odr void @_Z18inlineFuncTmplDeclI21ImplicitInst_ImportedEvv() -// MO1-DAG: define linkonce_odr void @"\01??$inlineFuncTmplDecl@UImplicitInst_Imported@@@@YAXXZ"() -// GO1-DAG: define linkonce_odr void @_Z18inlineFuncTmplDeclI21ImplicitInst_ImportedEvv() +// MSC-DAG: define linkonce_odr dso_local void @"??$inlineFuncTmplDecl@UImplicitInst_Imported@@@@YAXXZ"() +// GNU-DAG: define linkonce_odr dso_local void @_Z18inlineFuncTmplDeclI21ImplicitInst_ImportedEvv() +// MO1-DAG: define linkonce_odr dso_local void @"??$inlineFuncTmplDecl@UImplicitInst_Imported@@@@YAXXZ"() +// GO1-DAG: define linkonce_odr dso_local void @_Z18inlineFuncTmplDeclI21ImplicitInst_ImportedEvv() template<typename T> __declspec(dllimport) inline void inlineFuncTmplDecl(); template<typename T> void inlineFuncTmplDecl() {} USE(inlineFuncTmplDecl<ImplicitInst_Imported>) -// MSC-DAG: define linkonce_odr void @"\01??$inlineFuncTmplDef@UImplicitInst_Imported@@@@YAXXZ"() -// GNU-DAG: define linkonce_odr void @_Z17inlineFuncTmplDefI21ImplicitInst_ImportedEvv() -// MO1-DAG: define linkonce_odr void @"\01??$inlineFuncTmplDef@UImplicitInst_Imported@@@@YAXXZ"() -// GO1-DAG: define linkonce_odr void @_Z17inlineFuncTmplDefI21ImplicitInst_ImportedEvv() +// MSC-DAG: define linkonce_odr dso_local void @"??$inlineFuncTmplDef@UImplicitInst_Imported@@@@YAXXZ"() +// GNU-DAG: define linkonce_odr dso_local void @_Z17inlineFuncTmplDefI21ImplicitInst_ImportedEvv() +// MO1-DAG: define linkonce_odr dso_local void @"??$inlineFuncTmplDef@UImplicitInst_Imported@@@@YAXXZ"() +// GO1-DAG: define linkonce_odr dso_local void @_Z17inlineFuncTmplDefI21ImplicitInst_ImportedEvv() template<typename T> __declspec(dllimport) void inlineFuncTmplDef(); template<typename T> inline void inlineFuncTmplDef() {} USE(inlineFuncTmplDef<ImplicitInst_Imported>) // Redeclarations -// MSC-DAG: declare dllimport void @"\01??$funcTmplRedecl1@UImplicitInst_Imported@@@@YAXXZ"() +// MSC-DAG: declare dllimport void @"??$funcTmplRedecl1@UImplicitInst_Imported@@@@YAXXZ"() // GNU-DAG: declare dllimport void @_Z15funcTmplRedecl1I21ImplicitInst_ImportedEvv() template<typename T> __declspec(dllimport) void funcTmplRedecl1(); template<typename T> __declspec(dllimport) void funcTmplRedecl1(); USE(funcTmplRedecl1<ImplicitInst_Imported>) -// MSC-DAG: declare void @"\01??$funcTmplRedecl2@UImplicitInst_NotImported@@@@YAXXZ"() -// GNU-DAG: declare void @_Z15funcTmplRedecl2I24ImplicitInst_NotImportedEvv() +// MSC-DAG: declare dso_local void @"??$funcTmplRedecl2@UImplicitInst_NotImported@@@@YAXXZ"() +// GNU-DAG: declare dso_local void @_Z15funcTmplRedecl2I24ImplicitInst_NotImportedEvv() template<typename T> __declspec(dllimport) void funcTmplRedecl2(); template<typename T> void funcTmplRedecl2(); // dllimport ignored USE(funcTmplRedecl2<ImplicitInst_NotImported>) -// MSC-DAG: define linkonce_odr void @"\01??$funcTmplRedecl3@UImplicitInst_NotImported@@@@YAXXZ"() -// GNU-DAG: define linkonce_odr void @_Z15funcTmplRedecl3I24ImplicitInst_NotImportedEvv() +// MSC-DAG: define linkonce_odr dso_local void @"??$funcTmplRedecl3@UImplicitInst_NotImported@@@@YAXXZ"() +// GNU-DAG: define linkonce_odr dso_local void @_Z15funcTmplRedecl3I24ImplicitInst_NotImportedEvv() template<typename T> __declspec(dllimport) void funcTmplRedecl3(); template<typename T> void funcTmplRedecl3() {} // dllimport ignored USE(funcTmplRedecl3<ImplicitInst_NotImported>) // Function template friends -// MSC-DAG: declare dllimport void @"\01??$funcTmplFriend1@UImplicitInst_Imported@@@@YAXXZ"() +// MSC-DAG: declare dllimport void @"??$funcTmplFriend1@UImplicitInst_Imported@@@@YAXXZ"() // GNU-DAG: declare dllimport void @_Z15funcTmplFriend1I21ImplicitInst_ImportedEvv() -// MSC-DAG: declare void @"\01??$funcTmplFriend2@UImplicitInst_NotImported@@@@YAXXZ"() -// GNU-DAG: declare void @_Z15funcTmplFriend2I24ImplicitInst_NotImportedEvv() -// MSC-DAG: define linkonce_odr void @"\01??$funcTmplFriend3@UImplicitInst_NotImported@@@@YAXXZ"() -// GNU-DAG: define linkonce_odr void @_Z15funcTmplFriend3I24ImplicitInst_NotImportedEvv() -// MSC-DAG: define linkonce_odr void @"\01??$funcTmplFriend4@UImplicitInst_Imported@@@@YAXXZ"() -// GNU-DAG: define linkonce_odr void @_Z15funcTmplFriend4I21ImplicitInst_ImportedEvv() +// MSC-DAG: declare dso_local void @"??$funcTmplFriend2@UImplicitInst_NotImported@@@@YAXXZ"() +// GNU-DAG: declare dso_local void @_Z15funcTmplFriend2I24ImplicitInst_NotImportedEvv() +// MSC-DAG: define linkonce_odr dso_local void @"??$funcTmplFriend3@UImplicitInst_NotImported@@@@YAXXZ"() +// GNU-DAG: define linkonce_odr dso_local void @_Z15funcTmplFriend3I24ImplicitInst_NotImportedEvv() +// MSC-DAG: define linkonce_odr dso_local void @"??$funcTmplFriend4@UImplicitInst_Imported@@@@YAXXZ"() +// GNU-DAG: define linkonce_odr dso_local void @_Z15funcTmplFriend4I21ImplicitInst_ImportedEvv() struct FuncTmplFriend { template<typename T> friend __declspec(dllimport) void funcTmplFriend1(); template<typename T> friend __declspec(dllimport) void funcTmplFriend2(); @@ -473,7 +475,7 @@ USE(funcTmplFriend2<ImplicitInst_NotImported>) USE(funcTmplFriend3<ImplicitInst_NotImported>) USE(funcTmplFriend4<ImplicitInst_Imported>) -// MSC-DAG: declare dllimport void @"\01??$externalFuncTmpl@UImplicitInst_Imported@@@ns@@YAXXZ"() +// MSC-DAG: declare dllimport void @"??$externalFuncTmpl@UImplicitInst_Imported@@@ns@@YAXXZ"() // GNU-DAG: declare dllimport void @_ZN2ns16externalFuncTmplI21ImplicitInst_ImportedEEvv() namespace ns { template<typename T> __declspec(dllimport) void externalFuncTmpl(); } USE(ns::externalFuncTmpl<ImplicitInst_Imported>) @@ -485,89 +487,89 @@ template<typename T> __declspec(dllimport) void importedFuncTmplDecl(); template<typename T> __declspec(dllimport) inline void importedFuncTmpl() {} // Import implicit instantiation of an imported function template. -// MSC-DAG: declare dllimport void @"\01??$importedFuncTmplDecl@UImplicitInst_Imported@@@@YAXXZ"() +// MSC-DAG: declare dllimport void @"??$importedFuncTmplDecl@UImplicitInst_Imported@@@@YAXXZ"() // GNU-DAG: declare dllimport void @_Z20importedFuncTmplDeclI21ImplicitInst_ImportedEvv() USE(importedFuncTmplDecl<ImplicitInst_Imported>) -// MSC-DAG: declare dllimport void @"\01??$importedFuncTmpl@UImplicitInst_Imported@@@@YAXXZ"() -// GNU-DAG: define linkonce_odr void @_Z16importedFuncTmplI21ImplicitInst_ImportedEvv() -// MO1-DAG: define available_externally dllimport void @"\01??$importedFuncTmpl@UImplicitInst_Imported@@@@YAXXZ"() -// GO1-DAG: define linkonce_odr void @_Z16importedFuncTmplI21ImplicitInst_ImportedEvv() +// MSC-DAG: declare dllimport void @"??$importedFuncTmpl@UImplicitInst_Imported@@@@YAXXZ"() +// GNU-DAG: define linkonce_odr dso_local void @_Z16importedFuncTmplI21ImplicitInst_ImportedEvv() +// MO1-DAG: define available_externally dllimport void @"??$importedFuncTmpl@UImplicitInst_Imported@@@@YAXXZ"() +// GO1-DAG: define linkonce_odr dso_local void @_Z16importedFuncTmplI21ImplicitInst_ImportedEvv() USE(importedFuncTmpl<ImplicitInst_Imported>) // Import explicit instantiation declaration of an imported function template. -// MSC-DAG: declare dllimport void @"\01??$importedFuncTmpl@UExplicitDecl_Imported@@@@YAXXZ"() -// GNU-DAG: declare void @_Z16importedFuncTmplI21ExplicitDecl_ImportedEvv() -// MO1-DAG: define available_externally dllimport void @"\01??$importedFuncTmpl@UExplicitDecl_Imported@@@@YAXXZ"() -// GO1-DAG: define available_externally void @_Z16importedFuncTmplI21ExplicitDecl_ImportedEvv() +// MSC-DAG: declare dllimport void @"??$importedFuncTmpl@UExplicitDecl_Imported@@@@YAXXZ"() +// GNU-DAG: declare dso_local void @_Z16importedFuncTmplI21ExplicitDecl_ImportedEvv() +// MO1-DAG: define available_externally dllimport void @"??$importedFuncTmpl@UExplicitDecl_Imported@@@@YAXXZ"() +// GO1-DAG: define available_externally dso_local void @_Z16importedFuncTmplI21ExplicitDecl_ImportedEvv() extern template void importedFuncTmpl<ExplicitDecl_Imported>(); USE(importedFuncTmpl<ExplicitDecl_Imported>) // Import explicit instantiation definition of an imported function template. -// MSC-DAG: declare dllimport void @"\01??$importedFuncTmpl@UExplicitInst_Imported@@@@YAXXZ"() -// GNU-DAG: define weak_odr void @_Z16importedFuncTmplI21ExplicitInst_ImportedEvv() -// MO1-DAG: define available_externally dllimport void @"\01??$importedFuncTmpl@UExplicitInst_Imported@@@@YAXXZ"() -// GO1-DAG: define weak_odr void @_Z16importedFuncTmplI21ExplicitInst_ImportedEvv() +// MSC-DAG: declare dllimport void @"??$importedFuncTmpl@UExplicitInst_Imported@@@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local void @_Z16importedFuncTmplI21ExplicitInst_ImportedEvv() +// MO1-DAG: define available_externally dllimport void @"??$importedFuncTmpl@UExplicitInst_Imported@@@@YAXXZ"() +// GO1-DAG: define weak_odr dso_local void @_Z16importedFuncTmplI21ExplicitInst_ImportedEvv() template void importedFuncTmpl<ExplicitInst_Imported>(); USE(importedFuncTmpl<ExplicitInst_Imported>) // Import specialization of an imported function template. -// MSC-DAG: declare dllimport void @"\01??$importedFuncTmplDecl@UExplicitSpec_Imported@@@@YAXXZ"() +// MSC-DAG: declare dllimport void @"??$importedFuncTmplDecl@UExplicitSpec_Imported@@@@YAXXZ"() // GNU-DAG: declare dllimport void @_Z20importedFuncTmplDeclI21ExplicitSpec_ImportedEvv() template<> __declspec(dllimport) void importedFuncTmplDecl<ExplicitSpec_Imported>(); USE(importedFuncTmplDecl<ExplicitSpec_Imported>) -// MSC-DAG-FIXME: declare dllimport void @"\01??$importedFuncTmplDecl@UExplicitSpec_Def_Imported@@@@YAXXZ"() -// MO1-DAG-FIXME: define available_externally dllimport void @"\01??$importedFuncTmplDecl@UExplicitSpec_Def_Imported@@@@YAXXZ"() +// MSC-DAG-FIXME: declare dllimport void @"??$importedFuncTmplDecl@UExplicitSpec_Def_Imported@@@@YAXXZ"() +// MO1-DAG-FIXME: define available_externally dllimport void @"??$importedFuncTmplDecl@UExplicitSpec_Def_Imported@@@@YAXXZ"() #ifdef MSABI //template<> __declspec(dllimport) void importedFuncTmplDecl<ExplicitSpec_Def_Imported>() {} //USE(importedFuncTmplDecl<ExplicitSpec_Def_Imported>) #endif -// MSC-DAG: declare dllimport void @"\01??$importedFuncTmplDecl@UExplicitSpec_InlineDef_Imported@@@@YAXXZ"() -// GNU-DAG: define linkonce_odr void @_Z20importedFuncTmplDeclI31ExplicitSpec_InlineDef_ImportedEvv() -// MO1-DAG: define available_externally dllimport void @"\01??$importedFuncTmplDecl@UExplicitSpec_InlineDef_Imported@@@@YAXXZ"() -// GO1-DAG: define linkonce_odr void @_Z20importedFuncTmplDeclI31ExplicitSpec_InlineDef_ImportedEvv() +// MSC-DAG: declare dllimport void @"??$importedFuncTmplDecl@UExplicitSpec_InlineDef_Imported@@@@YAXXZ"() +// GNU-DAG: define linkonce_odr dso_local void @_Z20importedFuncTmplDeclI31ExplicitSpec_InlineDef_ImportedEvv() +// MO1-DAG: define available_externally dllimport void @"??$importedFuncTmplDecl@UExplicitSpec_InlineDef_Imported@@@@YAXXZ"() +// GO1-DAG: define linkonce_odr dso_local void @_Z20importedFuncTmplDeclI31ExplicitSpec_InlineDef_ImportedEvv() template<> __declspec(dllimport) inline void importedFuncTmplDecl<ExplicitSpec_InlineDef_Imported>() {} USE(importedFuncTmplDecl<ExplicitSpec_InlineDef_Imported>) -// MSC-DAG: declare dllimport void @"\01??$importedFuncTmpl@UExplicitSpec_Imported@@@@YAXXZ"() +// MSC-DAG: declare dllimport void @"??$importedFuncTmpl@UExplicitSpec_Imported@@@@YAXXZ"() // GNU-DAG: declare dllimport void @_Z16importedFuncTmplI21ExplicitSpec_ImportedEvv() template<> __declspec(dllimport) void importedFuncTmpl<ExplicitSpec_Imported>(); USE(importedFuncTmpl<ExplicitSpec_Imported>) -// MSC-DAG-FIXME: declare dllimport void @"\01??$importedFuncTmpl@UExplicitSpec_Def_Imported@@@@YAXXZ"() -// MO1-DAG-FIXME: define available_externally dllimport void @"\01??$importedFuncTmpl@UExplicitSpec_Def_Imported@@@@YAXXZ"() +// MSC-DAG-FIXME: declare dllimport void @"??$importedFuncTmpl@UExplicitSpec_Def_Imported@@@@YAXXZ"() +// MO1-DAG-FIXME: define available_externally dllimport void @"??$importedFuncTmpl@UExplicitSpec_Def_Imported@@@@YAXXZ"() #ifdef MSABI //template<> __declspec(dllimport) void importedFuncTmpl<ExplicitSpec_Def_Imported>() {} //USE(importedFuncTmpl<ExplicitSpec_Def_Imported>) #endif -// MSC-DAG: declare dllimport void @"\01??$importedFuncTmpl@UExplicitSpec_InlineDef_Imported@@@@YAXXZ"() -// GNU-DAG: define linkonce_odr void @_Z16importedFuncTmplI31ExplicitSpec_InlineDef_ImportedEvv() -// MO1-DAG: define available_externally dllimport void @"\01??$importedFuncTmpl@UExplicitSpec_InlineDef_Imported@@@@YAXXZ"() -// GO1-DAG: define linkonce_odr void @_Z16importedFuncTmplI31ExplicitSpec_InlineDef_ImportedEvv() +// MSC-DAG: declare dllimport void @"??$importedFuncTmpl@UExplicitSpec_InlineDef_Imported@@@@YAXXZ"() +// GNU-DAG: define linkonce_odr dso_local void @_Z16importedFuncTmplI31ExplicitSpec_InlineDef_ImportedEvv() +// MO1-DAG: define available_externally dllimport void @"??$importedFuncTmpl@UExplicitSpec_InlineDef_Imported@@@@YAXXZ"() +// GO1-DAG: define linkonce_odr dso_local void @_Z16importedFuncTmplI31ExplicitSpec_InlineDef_ImportedEvv() template<> __declspec(dllimport) inline void importedFuncTmpl<ExplicitSpec_InlineDef_Imported>() {} USE(importedFuncTmpl<ExplicitSpec_InlineDef_Imported>) // Not importing specialization of an imported function template without // explicit dllimport. -// MSC-DAG: define void @"\01??$importedFuncTmpl@UExplicitSpec_NotImported@@@@YAXXZ"() -// GNU-DAG: define void @_Z16importedFuncTmplI24ExplicitSpec_NotImportedEvv() +// MSC-DAG: define dso_local void @"??$importedFuncTmpl@UExplicitSpec_NotImported@@@@YAXXZ"() +// GNU-DAG: define dso_local void @_Z16importedFuncTmplI24ExplicitSpec_NotImportedEvv() template<> void importedFuncTmpl<ExplicitSpec_NotImported>() {} USE(importedFuncTmpl<ExplicitSpec_NotImported>) // Import explicit instantiation declaration of a non-imported function template. -// MSC-DAG: declare dllimport void @"\01??$funcTmpl@UExplicitDecl_Imported@@@@YAXXZ"() -// MSC-DAG: declare dllimport void @"\01??$inlineFuncTmpl@UExplicitDecl_Imported@@@@YAXXZ"() +// MSC-DAG: declare dllimport void @"??$funcTmpl@UExplicitDecl_Imported@@@@YAXXZ"() +// MSC-DAG: declare dllimport void @"??$inlineFuncTmpl@UExplicitDecl_Imported@@@@YAXXZ"() // GNU-DAG: declare dllimport void @_Z8funcTmplI21ExplicitDecl_ImportedEvv() -// GNU-DAG: declare void @_Z14inlineFuncTmplI21ExplicitDecl_ImportedEvv() -// MO1-DAG: define available_externally dllimport void @"\01??$inlineFuncTmpl@UExplicitDecl_Imported@@@@YAXXZ"() -// GO1-DAG: define available_externally void @_Z14inlineFuncTmplI21ExplicitDecl_ImportedEvv() +// GNU-DAG: declare dso_local void @_Z14inlineFuncTmplI21ExplicitDecl_ImportedEvv() +// MO1-DAG: define available_externally dllimport void @"??$inlineFuncTmpl@UExplicitDecl_Imported@@@@YAXXZ"() +// GO1-DAG: define available_externally dso_local void @_Z14inlineFuncTmplI21ExplicitDecl_ImportedEvv() extern template __declspec(dllimport) void funcTmpl<ExplicitDecl_Imported>(); extern template __declspec(dllimport) void inlineFuncTmpl<ExplicitDecl_Imported>(); USE(funcTmpl<ExplicitDecl_Imported>) @@ -575,14 +577,14 @@ USE(inlineFuncTmpl<ExplicitDecl_Imported>) // Import explicit instantiation definition of a non-imported function template. -// MSC-DAG: declare dllimport void @"\01??$funcTmpl@UExplicitInst_Imported@@@@YAXXZ"() -// MSC-DAG: declare dllimport void @"\01??$inlineFuncTmpl@UExplicitInst_Imported@@@@YAXXZ"() +// MSC-DAG: declare dllimport void @"??$funcTmpl@UExplicitInst_Imported@@@@YAXXZ"() +// MSC-DAG: declare dllimport void @"??$inlineFuncTmpl@UExplicitInst_Imported@@@@YAXXZ"() // GNU-DAG: declare dllimport void @_Z8funcTmplI21ExplicitInst_ImportedEvv() -// GNU-DAG: define weak_odr void @_Z14inlineFuncTmplI21ExplicitInst_ImportedEvv() -// MO1-DAG: declare dllimport void @"\01??$funcTmpl@UExplicitInst_Imported@@@@YAXXZ"() -// MO1-DAG: define available_externally dllimport void @"\01??$inlineFuncTmpl@UExplicitInst_Imported@@@@YAXXZ"() +// GNU-DAG: define weak_odr dso_local void @_Z14inlineFuncTmplI21ExplicitInst_ImportedEvv() +// MO1-DAG: declare dllimport void @"??$funcTmpl@UExplicitInst_Imported@@@@YAXXZ"() +// MO1-DAG: define available_externally dllimport void @"??$inlineFuncTmpl@UExplicitInst_Imported@@@@YAXXZ"() // GO1-DAG: define available_externally dllimport void @_Z8funcTmplI21ExplicitInst_ImportedEvv() -// GO1-DAG: define weak_odr void @_Z14inlineFuncTmplI21ExplicitInst_ImportedEvv() +// GO1-DAG: define weak_odr dso_local void @_Z14inlineFuncTmplI21ExplicitInst_ImportedEvv() template __declspec(dllimport) void funcTmpl<ExplicitInst_Imported>(); template __declspec(dllimport) void inlineFuncTmpl<ExplicitInst_Imported>(); USE(funcTmpl<ExplicitInst_Imported>) @@ -590,22 +592,22 @@ USE(inlineFuncTmpl<ExplicitInst_Imported>) // Import specialization of a non-imported function template. -// MSC-DAG: declare dllimport void @"\01??$funcTmpl@UExplicitSpec_Imported@@@@YAXXZ"() +// MSC-DAG: declare dllimport void @"??$funcTmpl@UExplicitSpec_Imported@@@@YAXXZ"() // GNU-DAG: declare dllimport void @_Z8funcTmplI21ExplicitSpec_ImportedEvv() template<> __declspec(dllimport) void funcTmpl<ExplicitSpec_Imported>(); USE(funcTmpl<ExplicitSpec_Imported>) -// MSC-DAG-FIXME: declare dllimport void @"\01??$funcTmpl@UExplicitSpec_Def_Imported@@@@YAXXZ"() -// MO1-DAG-FIXME: define available_externally dllimport void @"\01??$funcTmpl@UExplicitSpec_Def_Imported@@@@YAXXZ"() +// MSC-DAG-FIXME: declare dllimport void @"??$funcTmpl@UExplicitSpec_Def_Imported@@@@YAXXZ"() +// MO1-DAG-FIXME: define available_externally dllimport void @"??$funcTmpl@UExplicitSpec_Def_Imported@@@@YAXXZ"() #ifdef MSABI //template<> __declspec(dllimport) void funcTmpl<ExplicitSpec_Def_Imported>() {} //USE(funcTmpl<ExplicitSpec_Def_Imported>) #endif -// MSC-DAG: declare dllimport void @"\01??$funcTmpl@UExplicitSpec_InlineDef_Imported@@@@YAXXZ"() -// GNU-DAG: define linkonce_odr void @_Z8funcTmplI31ExplicitSpec_InlineDef_ImportedEvv() -// MO1-DAG: define available_externally dllimport void @"\01??$funcTmpl@UExplicitSpec_InlineDef_Imported@@@@YAXXZ"() -// GO1-DAG: define linkonce_odr void @_Z8funcTmplI31ExplicitSpec_InlineDef_ImportedEvv() +// MSC-DAG: declare dllimport void @"??$funcTmpl@UExplicitSpec_InlineDef_Imported@@@@YAXXZ"() +// GNU-DAG: define linkonce_odr dso_local void @_Z8funcTmplI31ExplicitSpec_InlineDef_ImportedEvv() +// MO1-DAG: define available_externally dllimport void @"??$funcTmpl@UExplicitSpec_InlineDef_Imported@@@@YAXXZ"() +// GO1-DAG: define linkonce_odr dso_local void @_Z8funcTmplI31ExplicitSpec_InlineDef_ImportedEvv() template<> __declspec(dllimport) inline void funcTmpl<ExplicitSpec_InlineDef_Imported>() {} USE(funcTmpl<ExplicitSpec_InlineDef_Imported>) @@ -626,22 +628,22 @@ template void S<X>::foo(X*); // Cannot be instantiated because X is incomplete; struct __declspec(dllimport) T { void a() {} - // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?a@T@@QAEXXZ" + // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?a@T@@QAEXXZ" static void StaticMethod(); - // MSC-DAG: declare dllimport void @"\01?StaticMethod@T@@SAXXZ"() + // MSC-DAG: declare dllimport void @"?StaticMethod@T@@SAXXZ"() // GNU-DAG: declare dllimport void @_ZN1T12StaticMethodEv() static int b; - // MO1-DAG: @"\01?b@T@@2HA" = external dllimport global i32 + // MO1-DAG: @"?b@T@@2HA" = external dllimport global i32 T& operator=(T&) = default; - // MO1-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.T* @"\01??4T@@QAEAAU0@AAU0@@Z" + // MO1-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.T* @"??4T@@QAEAAU0@AAU0@@Z" T& operator=(T&&) = default; // Note: Don't mark inline move operators dllimport because current MSVC versions don't export them. - // M18-DAG: define linkonce_odr x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.T* @"\01??4T@@QAEAAU0@$$QAU0@@Z" - // M19-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.T* @"\01??4T@@QAEAAU0@$$QAU0@@Z" + // M18-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.T* @"??4T@@QAEAAU0@$$QAU0@@Z" + // M19-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.T* @"??4T@@QAEAAU0@$$QAU0@@Z" }; USEMEMFUNC(T, a) USESTATICMEMFUNC(T, StaticMethod) @@ -650,14 +652,14 @@ USECOPYASSIGN(T) USEMOVEASSIGN(T) template <typename T> struct __declspec(dllimport) U { void foo() {} }; -// MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?foo@?$U@H@@QAEXXZ" +// MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?foo@?$U@H@@QAEXXZ" struct __declspec(dllimport) V : public U<int> { }; USEMEMFUNC(V, foo) struct __declspec(dllimport) W { virtual void foo() {} }; USECLASS(W) // vftable: -// MO1-DAG: @"\01??_SW@@6B@" = linkonce_odr unnamed_addr constant { [1 x i8*] } { [1 x i8*] [i8* bitcast (void (%struct.W*)* @"\01?foo@W@@UAEXXZ" to i8*)] } +// MO1-DAG: @"??_SW@@6B@" = linkonce_odr unnamed_addr constant { [1 x i8*] } { [1 x i8*] [i8* bitcast (void (%struct.W*)* @"?foo@W@@UAEXXZ" to i8*)] } // GO1-DAG: @_ZTV1W = available_externally dllimport unnamed_addr constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* null, i8* bitcast (void (%struct.W*)* @_ZN1W3fooEv to i8*)] } struct __declspec(dllimport) KeyFuncClass { @@ -670,7 +672,7 @@ extern constexpr KeyFuncClass keyFuncClassVar = {}; struct __declspec(dllimport) X : public virtual W {}; USECLASS(X) // vbtable: -// MO1-DAG: @"\01??_8X@@7B@" = available_externally dllimport unnamed_addr constant [2 x i32] [i32 0, i32 4] +// MO1-DAG: @"??_8X@@7B@" = available_externally dllimport unnamed_addr constant [2 x i32] [i32 0, i32 4] struct __declspec(dllimport) Y { int x; @@ -679,7 +681,7 @@ struct __declspec(dllimport) Y { struct __declspec(dllimport) Z { virtual ~Z() {} }; USECLASS(Z) // User-defined dtor: -// MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01??1Z@@UAE@XZ" +// MO1-DAG: define available_externally dllimport x86_thiscallcc void @"??1Z@@UAE@XZ" namespace DontUseDtorAlias { struct __declspec(dllimport) A { ~A(); }; @@ -687,13 +689,13 @@ namespace DontUseDtorAlias { inline A::~A() { } inline B::~B() { } // Emit a real definition of B's constructor; don't alias it to A's. - // MO1-DAG: available_externally dllimport x86_thiscallcc void @"\01??1B@DontUseDtorAlias@@QAE@XZ" + // MO1-DAG: available_externally dllimport x86_thiscallcc void @"??1B@DontUseDtorAlias@@QAE@XZ" USECLASS(B) } namespace Vtordisp { // Don't dllimport the vtordisp. - // MO1-DAG: define linkonce_odr x86_thiscallcc void @"\01?f@?$C@H@Vtordisp@@$4PPPPPPPM@A@AEXXZ" + // MO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @"?f@?$C@H@Vtordisp@@$4PPPPPPPM@A@AEXXZ" class __declspec(dllimport) Base { virtual void f() {} @@ -713,7 +715,7 @@ namespace ClassTemplateStaticDef { static int x; }; template <typename T> int S<T>::x; - // MSC-DAG: @"\01?x@?$S@H@ClassTemplateStaticDef@@2HA" = external dllimport global i32 + // MSC-DAG: @"?x@?$S@H@ClassTemplateStaticDef@@2HA" = external dllimport global i32 int f() { return S<int>::x; } // Partial class template specialization static field: @@ -736,21 +738,21 @@ namespace PR19933 { template <typename T> NonPOD A<T>::x; template struct __declspec(dllimport) A<int>; USEVARTYPE(NonPOD, A<int>::x); - // MSC-DAG: @"\01?x@?$A@H@PR19933@@2UNonPOD@2@A" = external dllimport global %"struct.PR19933::NonPOD" + // MSC-DAG: @"?x@?$A@H@PR19933@@2UNonPOD@2@A" = external dllimport global %"struct.PR19933::NonPOD" int f(); template <typename T> struct B { static int x; }; template <typename T> int B<T>::x = f(); template struct __declspec(dllimport) B<int>; USEVAR(B<int>::x); - // MSC-DAG: @"\01?x@?$B@H@PR19933@@2HA" = external dllimport global i32 + // MSC-DAG: @"?x@?$B@H@PR19933@@2HA" = external dllimport global i32 constexpr int g() { return 42; } template <typename T> struct C { static int x; }; template <typename T> int C<T>::x = g(); template struct __declspec(dllimport) C<int>; USEVAR(C<int>::x); - // MSC-DAG: @"\01?x@?$C@H@PR19933@@2HA" = external dllimport global i32 + // MSC-DAG: @"?x@?$C@H@PR19933@@2HA" = external dllimport global i32 template <int I> struct D { static int x, y; }; template <int I> int D<I>::x = I + 1; @@ -758,8 +760,8 @@ namespace PR19933 { template struct __declspec(dllimport) D<42>; USEVAR(D<42>::x); USEVAR(D<42>::y); - // MSC-DAG: @"\01?x@?$D@$0CK@@PR19933@@2HA" = external dllimport global i32 - // MSC-DAG: @"\01?y@?$D@$0CK@@PR19933@@2HA" = external dllimport global i32 + // MSC-DAG: @"?x@?$D@$0CK@@PR19933@@2HA" = external dllimport global i32 + // MSC-DAG: @"?y@?$D@$0CK@@PR19933@@2HA" = external dllimport global i32 } namespace PR21355 { @@ -793,59 +795,59 @@ namespace PR27319 { }; extern template struct __declspec(dllimport) A<int>; void f() { new A<int>(); } - // MO1-DAG: @"\01??_S?$A@H@PR27319@@6B@" = linkonce_odr unnamed_addr constant { [1 x i8*] } + // MO1-DAG: @"??_S?$A@H@PR27319@@6B@" = linkonce_odr unnamed_addr constant { [1 x i8*] } } // MS ignores DLL attributes on partial specializations. template <typename T> struct PartiallySpecializedClassTemplate {}; template <typename T> struct __declspec(dllimport) PartiallySpecializedClassTemplate<T*> { void f(); }; USEMEMFUNC(PartiallySpecializedClassTemplate<void*>, f); -// M32-DAG: declare x86_thiscallcc void @"\01?f@?$PartiallySpecializedClassTemplate@PAX@@QAEXXZ" +// M32-DAG: declare dso_local x86_thiscallcc void @"?f@?$PartiallySpecializedClassTemplate@PAX@@QAEXXZ" // G32-DAG: declare dllimport x86_thiscallcc void @_ZN33PartiallySpecializedClassTemplateIPvE1fEv // Attributes on explicit specializations are honored. template <typename T> struct ExplicitlySpecializedClassTemplate {}; template <> struct __declspec(dllimport) ExplicitlySpecializedClassTemplate<void*> { void f(); }; USEMEMFUNC(ExplicitlySpecializedClassTemplate<void*>, f); -// M32-DAG: declare dllimport x86_thiscallcc void @"\01?f@?$ExplicitlySpecializedClassTemplate@PAX@@QAEXXZ" +// M32-DAG: declare dllimport x86_thiscallcc void @"?f@?$ExplicitlySpecializedClassTemplate@PAX@@QAEXXZ" // G32-DAG: declare dllimport x86_thiscallcc void @_ZN34ExplicitlySpecializedClassTemplateIPvE1fEv // MS inherits DLL attributes to partial specializations. template <typename T> struct __declspec(dllimport) PartiallySpecializedImportedClassTemplate {}; template <typename T> struct PartiallySpecializedImportedClassTemplate<T*> { void f() {} }; USEMEMFUNC(PartiallySpecializedImportedClassTemplate<void*>, f); -// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"\01?f@?$PartiallySpecializedImportedClassTemplate@PAX@@QAEXXZ" -// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN41PartiallySpecializedImportedClassTemplateIPvE1fEv +// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"?f@?$PartiallySpecializedImportedClassTemplate@PAX@@QAEXXZ" +// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN41PartiallySpecializedImportedClassTemplateIPvE1fEv // Attributes on the instantiation take precedence over attributes on the template. template <typename T> struct __declspec(dllexport) ExplicitlyInstantiatedWithDifferentAttr { void f() {} }; template struct __declspec(dllimport) ExplicitlyInstantiatedWithDifferentAttr<int>; USEMEMFUNC(ExplicitlyInstantiatedWithDifferentAttr<int>, f); -// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"\01?f@?$ExplicitlyInstantiatedWithDifferentAttr@H@@QAEXXZ" +// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"?f@?$ExplicitlyInstantiatedWithDifferentAttr@H@@QAEXXZ" template <typename T> struct ExplicitInstantiationDeclImportedDefTemplate { void f() {} ExplicitInstantiationDeclImportedDefTemplate() {}}; extern template struct ExplicitInstantiationDeclImportedDefTemplate<int>; template struct __declspec(dllimport) ExplicitInstantiationDeclImportedDefTemplate<int>; USECLASS(ExplicitInstantiationDeclImportedDefTemplate<int>); USEMEMFUNC(ExplicitInstantiationDeclImportedDefTemplate<int>, f); -// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"\01?f@?$ExplicitInstantiationDeclImportedDefTemplate@H@@QAEXXZ" -// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc %struct.ExplicitInstantiationDeclImportedDefTemplate* @"\01??0?$ExplicitInstantiationDeclImportedDefTemplate@H@@QAE@XZ" -// G32-DAG: define weak_odr x86_thiscallcc void @_ZN44ExplicitInstantiationDeclImportedDefTemplateIiE1fEv +// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"?f@?$ExplicitInstantiationDeclImportedDefTemplate@H@@QAEXXZ" +// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc %struct.ExplicitInstantiationDeclImportedDefTemplate* @"??0?$ExplicitInstantiationDeclImportedDefTemplate@H@@QAE@XZ" +// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN44ExplicitInstantiationDeclImportedDefTemplateIiE1fEv template <typename T> struct __declspec(dllimport) ExplicitInstantiationDeclExportedDefImportedTemplate { void f() {} ExplicitInstantiationDeclExportedDefImportedTemplate() {} }; extern template struct __declspec(dllimport) ExplicitInstantiationDeclExportedDefImportedTemplate <int>; template struct __declspec(dllexport) ExplicitInstantiationDeclExportedDefImportedTemplate<int>; USECLASS(ExplicitInstantiationDeclExportedDefImportedTemplate<int>); USEMEMFUNC(ExplicitInstantiationDeclExportedDefImportedTemplate<int>, f); -// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"\01?f@?$ExplicitInstantiationDeclExportedDefImportedTemplate@H@@QAEXXZ" -// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc %struct.ExplicitInstantiationDeclExportedDefImportedTemplate* @"\01??0?$ExplicitInstantiationDeclExportedDefImportedTemplate@H@@QAE@XZ" +// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"?f@?$ExplicitInstantiationDeclExportedDefImportedTemplate@H@@QAEXXZ" +// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc %struct.ExplicitInstantiationDeclExportedDefImportedTemplate* @"??0?$ExplicitInstantiationDeclExportedDefImportedTemplate@H@@QAE@XZ" template <typename T> struct PR23770BaseTemplate { void f() {} }; template <typename T> struct PR23770DerivedTemplate : PR23770BaseTemplate<int> {}; extern template struct PR23770DerivedTemplate<int>; template struct __declspec(dllimport) PR23770DerivedTemplate<int>; USEMEMFUNC(PR23770BaseTemplate<int>, f); -// M32-DAG: declare dllimport x86_thiscallcc void @"\01?f@?$PR23770BaseTemplate@H@@QAEXXZ" +// M32-DAG: declare dllimport x86_thiscallcc void @"?f@?$PR23770BaseTemplate@H@@QAEXXZ" namespace PR27810 { template <class T> @@ -861,7 +863,7 @@ namespace PR27810 { // functions are emitted unless they are used. USEMEMFUNC(basic_ostream<char>::sentry, foo); - // M32-DAG: define linkonce_odr x86_thiscallcc void @"\01?foo@sentry@?$basic_ostream@D@PR27810@@QAEXXZ" + // M32-DAG: define linkonce_odr dso_local x86_thiscallcc void @"?foo@sentry@?$basic_ostream@D@PR27810@@QAEXXZ" // M32-NOT: ??0sentry@?$basic_ostream@D@PR27810@@QAE@XZ } @@ -906,69 +908,69 @@ template struct __declspec(dllimport) ExplicitlyImportInstantiatedTemplate<int>; // MS: ClassTemplate<int> gets imported. struct __declspec(dllimport) DerivedFromTemplate : public ClassTemplate<int> {}; USEMEMFUNC(ClassTemplate<int>, func) -// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"\01?func@?$ClassTemplate@H@@QAEXXZ" -// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ClassTemplateIiE4funcEv +// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"?func@?$ClassTemplate@H@@QAEXXZ" +// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ClassTemplateIiE4funcEv // ImportedTemplate is explicitly imported. struct __declspec(dllimport) DerivedFromImportedTemplate : public ImportedClassTemplate<int> {}; USEMEMFUNC(ImportedClassTemplate<int>, func) -// M32-DAG: declare dllimport x86_thiscallcc void @"\01?func@?$ImportedClassTemplate@H@@QAEXXZ" +// M32-DAG: declare dllimport x86_thiscallcc void @"?func@?$ImportedClassTemplate@H@@QAEXXZ" // G32-DAG: declare dllimport x86_thiscallcc void @_ZN21ImportedClassTemplateIiE4funcEv // ExportedTemplate is explicitly exported. struct __declspec(dllimport) DerivedFromExportedTemplate : public ExportedClassTemplate<int> {}; USEMEMFUNC(ExportedClassTemplate<int>, func) -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?func@?$ExportedClassTemplate@H@@QAEXXZ" -// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN21ExportedClassTemplateIiE4funcEv +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?func@?$ExportedClassTemplate@H@@QAEXXZ" +// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN21ExportedClassTemplateIiE4funcEv // Base class already implicitly instantiated without attribute. struct DerivedFromTemplateD : public ClassTemplate<double> {}; struct __declspec(dllimport) DerivedFromTemplateD2 : public ClassTemplate<double> {}; USEMEMFUNC(ClassTemplate<double>, func) -// M32-DAG: declare dllimport x86_thiscallcc void @"\01?func@?$ClassTemplate@N@@QAEXXZ" -// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ClassTemplateIdE4funcEv +// M32-DAG: declare dllimport x86_thiscallcc void @"?func@?$ClassTemplate@N@@QAEXXZ" +// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ClassTemplateIdE4funcEv // MS: Base class already instantiated with dfferent attribute. struct __declspec(dllexport) DerivedFromTemplateB : public ClassTemplate<bool> {}; struct __declspec(dllimport) DerivedFromTemplateB2 : public ClassTemplate<bool> {}; USEMEMFUNC(ClassTemplate<bool>, func) -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?func@?$ClassTemplate@_N@@QAEXXZ" -// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ClassTemplateIbE4funcEv +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?func@?$ClassTemplate@_N@@QAEXXZ" +// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ClassTemplateIbE4funcEv // Base class already specialized without dll attribute. struct __declspec(dllimport) DerivedFromExplicitlySpecializedTemplate : public ExplicitlySpecializedTemplate<int> {}; USEMEMFUNC(ExplicitlySpecializedTemplate<int>, func) -// M32-DAG: define linkonce_odr x86_thiscallcc void @"\01?func@?$ExplicitlySpecializedTemplate@H@@QAEXXZ" -// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN29ExplicitlySpecializedTemplateIiE4funcEv +// M32-DAG: define linkonce_odr dso_local x86_thiscallcc void @"?func@?$ExplicitlySpecializedTemplate@H@@QAEXXZ" +// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN29ExplicitlySpecializedTemplateIiE4funcEv // Base class alredy specialized with export attribute. struct __declspec(dllimport) DerivedFromExplicitlyExportSpecializedTemplate : public ExplicitlyExportSpecializedTemplate<int> {}; USEMEMFUNC(ExplicitlyExportSpecializedTemplate<int>, func) -// M32-DAG: define dllexport x86_thiscallcc void @"\01?func@?$ExplicitlyExportSpecializedTemplate@H@@QAEXXZ" -// G32-DAG: define dllexport x86_thiscallcc void @_ZN35ExplicitlyExportSpecializedTemplateIiE4funcEv +// M32-DAG: define dso_local dllexport x86_thiscallcc void @"?func@?$ExplicitlyExportSpecializedTemplate@H@@QAEXXZ" +// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN35ExplicitlyExportSpecializedTemplateIiE4funcEv // Base class already specialized with import attribute. struct __declspec(dllimport) DerivedFromExplicitlyImportSpecializedTemplate : public ExplicitlyImportSpecializedTemplate<int> {}; USEMEMFUNC(ExplicitlyImportSpecializedTemplate<int>, func) -// M32-DAG: declare dllimport x86_thiscallcc void @"\01?func@?$ExplicitlyImportSpecializedTemplate@H@@QAEXXZ" +// M32-DAG: declare dllimport x86_thiscallcc void @"?func@?$ExplicitlyImportSpecializedTemplate@H@@QAEXXZ" // G32-DAG: declare dllimport x86_thiscallcc void @_ZN35ExplicitlyImportSpecializedTemplateIiE4funcEv // Base class already instantiated without dll attribute. struct __declspec(dllimport) DerivedFromExplicitlyInstantiatedTemplate : public ExplicitlyInstantiatedTemplate<int> {}; USEMEMFUNC(ExplicitlyInstantiatedTemplate<int>, func) -// M32-DAG: define weak_odr x86_thiscallcc void @"\01?func@?$ExplicitlyInstantiatedTemplate@H@@QAEXXZ" -// G32-DAG: define weak_odr x86_thiscallcc void @_ZN30ExplicitlyInstantiatedTemplateIiE4funcEv +// M32-DAG: define weak_odr dso_local x86_thiscallcc void @"?func@?$ExplicitlyInstantiatedTemplate@H@@QAEXXZ" +// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN30ExplicitlyInstantiatedTemplateIiE4funcEv // Base class already instantiated with export attribute. struct __declspec(dllimport) DerivedFromExplicitlyExportInstantiatedTemplate : public ExplicitlyExportInstantiatedTemplate<int> {}; USEMEMFUNC(ExplicitlyExportInstantiatedTemplate<int>, func) -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?func@?$ExplicitlyExportInstantiatedTemplate@H@@QAEXXZ" -// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN36ExplicitlyExportInstantiatedTemplateIiE4funcEv +// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"?func@?$ExplicitlyExportInstantiatedTemplate@H@@QAEXXZ" +// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN36ExplicitlyExportInstantiatedTemplateIiE4funcEv // Base class already instantiated with import attribute. struct __declspec(dllimport) DerivedFromExplicitlyImportInstantiatedTemplate : public ExplicitlyImportInstantiatedTemplate<int> {}; USEMEMFUNC(ExplicitlyImportInstantiatedTemplate<int>, func) -// M32-DAG: declare dllimport x86_thiscallcc void @"\01?func@?$ExplicitlyImportInstantiatedTemplate@H@@QAEXXZ" +// M32-DAG: declare dllimport x86_thiscallcc void @"?func@?$ExplicitlyImportInstantiatedTemplate@H@@QAEXXZ" // G32-DAG: declare dllimport x86_thiscallcc void @_ZN36ExplicitlyImportInstantiatedTemplateIiE4funcEv // MS: A dll attribute propagates through multiple levels of instantiation. @@ -976,21 +978,21 @@ template <typename T> struct TopClass { void func() {} }; template <typename T> struct MiddleClass : public TopClass<T> { }; struct __declspec(dllimport) BottomClass : public MiddleClass<int> { }; USEMEMFUNC(TopClass<int>, func) -// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"\01?func@?$TopClass@H@@QAEXXZ" -// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN8TopClassIiE4funcEv +// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"?func@?$TopClass@H@@QAEXXZ" +// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN8TopClassIiE4funcEv template <typename T> struct ExplicitInstantiationDeclTemplateBase { void func() {} }; extern template struct ExplicitInstantiationDeclTemplateBase<int>; struct __declspec(dllimport) DerivedFromExplicitInstantiationDeclTemplateBase : public ExplicitInstantiationDeclTemplateBase<int> {}; template struct ExplicitInstantiationDeclTemplateBase<int>; USEMEMFUNC(ExplicitInstantiationDeclTemplateBase<int>, func) -// M32-DAG: declare dllimport x86_thiscallcc void @"\01?func@?$ExplicitInstantiationDeclTemplateBase@H@@QAEXXZ" -// G32-DAG: define weak_odr x86_thiscallcc void @_ZN37ExplicitInstantiationDeclTemplateBaseIiE4funcEv +// M32-DAG: declare dllimport x86_thiscallcc void @"?func@?$ExplicitInstantiationDeclTemplateBase@H@@QAEXXZ" +// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN37ExplicitInstantiationDeclTemplateBaseIiE4funcEv template <typename T> struct ExplicitInstantiationDeclTemplateBase2 { void func() {} }; extern template struct ExplicitInstantiationDeclTemplateBase2<int>; struct __declspec(dllimport) DerivedFromExplicitInstantiationDeclTemplateBase2 : public ExplicitInstantiationDeclTemplateBase2<int> {}; template struct __declspec(dllexport) ExplicitInstantiationDeclTemplateBase2<int>; USEMEMFUNC(ExplicitInstantiationDeclTemplateBase2<int>, func) -// M32-DAG: declare dllimport x86_thiscallcc void @"\01?func@?$ExplicitInstantiationDeclTemplateBase2@H@@QAEXXZ" -// G32-DAG: define weak_odr x86_thiscallcc void @_ZN38ExplicitInstantiationDeclTemplateBase2IiE4funcEv +// M32-DAG: declare dllimport x86_thiscallcc void @"?func@?$ExplicitInstantiationDeclTemplateBase2@H@@QAEXXZ" +// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN38ExplicitInstantiationDeclTemplateBase2IiE4funcEv diff --git a/test/CodeGenCXX/dso-local-executable.cpp b/test/CodeGenCXX/dso-local-executable.cpp new file mode 100644 index 0000000000000..cc8d50f09c9ec --- /dev/null +++ b/test/CodeGenCXX/dso-local-executable.cpp @@ -0,0 +1,62 @@ +// RUN: %clang_cc1 -triple x86_64-pc-linux -mrelocation-model static -O1 -emit-llvm %s -o - | FileCheck --check-prefix=STATIC %s +// RUN: %clang_cc1 -triple x86_64-pc-linux -mrelocation-model static -fno-plt -O1 -emit-llvm %s -o - | FileCheck --check-prefix=NOPLT %s + +// STATIC-DAG: @_ZTV1C = linkonce_odr dso_local unnamed_addr constant +// STATIC-DAG: @_ZTS1C = linkonce_odr dso_local constant +// STATIC-DAG: @_ZTI1C = linkonce_odr dso_local constant +// STATIC-DAG: @_ZZ14useStaticLocalvE3obj = linkonce_odr dso_local global +// STATIC-DAG: @_ZGVZN5guard1gEvE1a = linkonce_odr dso_local global +// STATIC-DAG: define dso_local void @_ZN1CC2Ev( +// STATIC-DAG: define dso_local void @_ZN1CC1Ev( +// STATIC-DAG: define linkonce_odr dso_local void @_ZN1C3fooEv( + +// NOPLT-DAG: @_ZTV1C = linkonce_odr dso_local unnamed_addr constant +// NOPLT-DAG: @_ZTS1C = linkonce_odr dso_local constant +// NOPLT-DAG: @_ZTI1C = linkonce_odr dso_local constant +// NOPLT-DAG: @_ZZ14useStaticLocalvE3obj = linkonce_odr dso_local global +// NOPLT-DAG: @_ZGVZN5guard1gEvE1a = linkonce_odr dso_local global +// NOPLT-DAG: define dso_local void @_ZN1CC2Ev( +// NOPLT-DAG: define dso_local void @_ZN1CC1Ev( +// NOPLT-DAG: define linkonce_odr dso_local void @_ZN1C3fooEv( + +struct C { + C(); + virtual void foo() {} +}; +C::C() {} + +struct HasVTable { + virtual void f(); +}; +inline HasVTable &useStaticLocal() { + static HasVTable obj; + return obj; +} +void useit() { + useStaticLocal(); +} + +namespace guard { +int f(); +inline int g() { + static int a = f(); + return a; +} +int h() { + return g(); +} +} // namespace guard + + +// STATIC-DAG: define available_externally dso_local void @_ZN5test23barIcEC1Ev( +// NOPLT-DAG: define available_externally void @_ZN5test23barIcEC1Ev( +namespace test2 { +void foo(); +template <typename T> +struct bar { + virtual void zed(); + bar() { foo(); } +}; +extern template class bar<char>; +bar<char> abc; +} // namespace test2 diff --git a/test/CodeGenCXX/duplicate-mangled-name.cpp b/test/CodeGenCXX/duplicate-mangled-name.cpp index 8c8f6e0311c3b..741e021db9847 100644 --- a/test/CodeGenCXX/duplicate-mangled-name.cpp +++ b/test/CodeGenCXX/duplicate-mangled-name.cpp @@ -11,7 +11,7 @@ class MyClass { }; void MyClass::meth() { } // expected-note {{previous}} extern "C" { - void _ZN7MyClass4methEv() { } // expected-error {{definition with same mangled name as another definition}} + void _ZN7MyClass4methEv() { } // expected-error {{definition with same mangled name '_ZN7MyClass4methEv' as another definition}} } #elif TEST2 @@ -34,7 +34,7 @@ extern "C" { namespace nm { float abc = 2; } -// CHECK: @_ZN2nm3abcE = global float +// CHECK: @_ZN2nm3abcE = {{(dso_local )?}}global float float foo() { _ZN1TD1Ev(); @@ -49,7 +49,7 @@ float foo() { extern "C" void _ZN2T2D2Ev() {}; // expected-note {{previous definition is here}} struct T2 { - ~T2() {} // expected-error {{definition with same mangled name as another definition}} + ~T2() {} // expected-error {{definition with same mangled name '_ZN2T2D2Ev' as another definition}} }; void foo() { @@ -64,7 +64,7 @@ extern "C" { } namespace nm { - float abc = 2; // expected-error {{definition with same mangled name as another definition}} + float abc = 2; // expected-error {{definition with same mangled name '_ZN2nm3abcE' as another definition}} } float foo() { @@ -73,7 +73,7 @@ float foo() { #else -#error Unknwon test +#error Unknown test #endif diff --git a/test/CodeGenCXX/eh.cpp b/test/CodeGenCXX/eh.cpp index dfbe48c372397..d393ee13b1cad 100644 --- a/test/CodeGenCXX/eh.cpp +++ b/test/CodeGenCXX/eh.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -triple x86_64-apple-darwin -std=c++11 -emit-llvm %s -o %t.ll -// RUN: FileCheck --input-file=%t.ll %s +// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -triple x86_64-apple-darwin -std=c++11 -emit-llvm %s -o - \ +// RUN: | FileCheck %s struct test1_D { double d; @@ -13,7 +13,7 @@ void test1() { // CHECK: [[EXNOBJ:%.*]] = call i8* @__cxa_allocate_exception(i64 8) // CHECK-NEXT: [[EXN:%.*]] = bitcast i8* [[EXNOBJ]] to [[DSTAR:%[^*]*\*]] // CHECK-NEXT: [[EXN2:%.*]] = bitcast [[DSTAR]] [[EXN]] to i8* -// CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[EXN2]], i8* bitcast ([[DSTAR]] @d1 to i8*), i64 8, i32 8, i1 false) +// CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 [[EXN2]], i8* align 8 bitcast ([[DSTAR]] @d1 to i8*), i64 8, i1 false) // CHECK-NEXT: call void @__cxa_throw(i8* [[EXNOBJ]], i8* bitcast ({ i8*, i8* }* @_ZTI7test1_D to i8*), i8* null) [[NR:#[0-9]+]] // CHECK-NEXT: unreachable @@ -466,7 +466,7 @@ int foo() { // CHECK: [[T0:%.*]] = call i8* @__cxa_allocate_exception(i64 16) // CHECK-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to %"class.test17::DerivedException"* // CHECK-NEXT: [[T2:%.*]] = bitcast %"class.test17::DerivedException"* [[T1]] to i8* - // CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* [[T2]], i8 0, i64 16, i32 16, i1 false) + // CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* align 16 [[T2]], i8 0, i64 16, i1 false) } } diff --git a/test/CodeGenCXX/exceptions-cxx-ehsc.cpp b/test/CodeGenCXX/exceptions-cxx-ehsc.cpp index c660d145393a1..ae1f463d386c9 100644 --- a/test/CodeGenCXX/exceptions-cxx-ehsc.cpp +++ b/test/CodeGenCXX/exceptions-cxx-ehsc.cpp @@ -11,9 +11,9 @@ void caller() { may_throw(); } } -// CHECK-LABEL: define void @"\01?caller@test1@@YAXXZ"( +// CHECK-LABEL: define dso_local void @"?caller@test1@@YAXXZ"( // CHECK: call void @never_throws( -// CHECK: invoke void @"\01?may_throw@test1@@YAXXZ"( +// CHECK: invoke void @"?may_throw@test1@@YAXXZ"( namespace test2 { struct Cleanup { ~Cleanup(); }; @@ -26,6 +26,6 @@ void caller() { may_throw(); } } -// CHECK-LABEL: define void @"\01?caller@test2@@YAXXZ"( +// CHECK-LABEL: define dso_local void @"?caller@test2@@YAXXZ"( // CHECK: invoke void @throws_int( -// CHECK: invoke void @"\01?may_throw@test2@@YAXXZ"( +// CHECK: invoke void @"?may_throw@test2@@YAXXZ"( diff --git a/test/CodeGenCXX/exceptions-cxx-new.cpp b/test/CodeGenCXX/exceptions-cxx-new.cpp index 9836da8e540b7..4906a7b19098c 100644 --- a/test/CodeGenCXX/exceptions-cxx-new.cpp +++ b/test/CodeGenCXX/exceptions-cxx-new.cpp @@ -12,16 +12,16 @@ void test_catch() { } } -// CHECK-LABEL: define void @"\01?test_catch@@YAXXZ"( -// CHECK: invoke i32 @"\01?f@@YAHH@Z"(i32 1) +// CHECK-LABEL: define dso_local void @"?test_catch@@YAXXZ"( +// CHECK: invoke i32 @"?f@@YAHH@Z"(i32 1) // CHECK: to label %[[NORMAL:.*]] unwind label %[[CATCHSWITCH:.*]] // CHECK: [[CATCHSWITCH]] // CHECK: %[[CATCHSWITCHPAD:.*]] = catchswitch within none [label %[[CATCH_INT:.*]], label %[[CATCH_DOUBLE:.*]]] unwind to caller // CHECK: [[CATCH_INT]] -// CHECK: %[[CATCHPAD_INT:.*]] = catchpad within %[[CATCHSWITCHPAD]] [%rtti.TypeDescriptor2* @"\01??_R0H@8", i32 0, i8* null] -// CHECK: call i32 @"\01?f@@YAHH@Z"(i32 2) +// CHECK: %[[CATCHPAD_INT:.*]] = catchpad within %[[CATCHSWITCHPAD]] [%rtti.TypeDescriptor2* @"??_R0H@8", i32 0, i8* null] +// CHECK: call i32 @"?f@@YAHH@Z"(i32 2) // CHECK: catchret from %[[CATCHPAD_INT]] to label %[[LEAVE_INT_CATCH:.*]] // CHECK: [[LEAVE_INT_CATCH]] @@ -31,8 +31,8 @@ void test_catch() { // CHECK: ret void // CHECK: [[CATCH_DOUBLE]] -// CHECK: %[[CATCHPAD_DOUBLE:.*]] = catchpad within %[[CATCHSWITCHPAD]] [%rtti.TypeDescriptor2* @"\01??_R0N@8", i32 0, i8* null] -// CHECK: call i32 @"\01?f@@YAHH@Z"(i32 3) +// CHECK: %[[CATCHPAD_DOUBLE:.*]] = catchpad within %[[CATCHSWITCHPAD]] [%rtti.TypeDescriptor2* @"??_R0N@8", i32 0, i8* null] +// CHECK: call i32 @"?f@@YAHH@Z"(i32 3) // CHECK: catchret from %[[CATCHPAD_DOUBLE]] to label %[[LEAVE_DOUBLE_CATCH:.*]] // CHECK: [[LEAVE_DOUBLE_CATCH]] @@ -50,22 +50,22 @@ void test_cleanup() { f(1); } -// CHECK-LABEL: define {{.*}} @"\01?test_cleanup@@YAXXZ"( -// CHECK: invoke i32 @"\01?f@@YAHH@Z"(i32 1) +// CHECK-LABEL: define dso_local {{.*}} @"?test_cleanup@@YAXXZ"( +// CHECK: invoke i32 @"?f@@YAHH@Z"(i32 1) // CHECK: to label %[[LEAVE_FUNC:.*]] unwind label %[[CLEANUP:.*]] // CHECK: [[LEAVE_FUNC]] -// CHECK: call x86_thiscallcc void @"\01??_DCleanup@@QAEXXZ"( +// CHECK: call x86_thiscallcc void @"??1Cleanup@@QAE@XZ"( // CHECK: ret void // CHECK: [[CLEANUP]] // CHECK: %[[CLEANUPPAD:.*]] = cleanuppad within none [] -// CHECK: call x86_thiscallcc void @"\01??_DCleanup@@QAEXXZ"( +// CHECK: call x86_thiscallcc void @"??1Cleanup@@QAE@XZ"( // CHECK: cleanupret from %[[CLEANUPPAD]] unwind to caller -// CHECK-LABEL: define {{.*}} void @"\01??1Cleanup@@QAE@XZ"( -// CHECK: invoke i32 @"\01?f@@YAHH@Z"(i32 -1) +// CHECK-LABEL: define {{.*}} void @"??1Cleanup@@QAE@XZ"( +// CHECK: invoke i32 @"?f@@YAHH@Z"(i32 -1) // CHECK: to label %[[LEAVE_FUNC:.*]] unwind label %[[TERMINATE:.*]] // CHECK: [[LEAVE_FUNC]] @@ -73,5 +73,5 @@ void test_cleanup() { // CHECK: [[TERMINATE]] // CHECK: %[[CLEANUPPAD:.*]] = cleanuppad within none [] -// CHECK-NEXT: call void @"\01?terminate@@YAXXZ"() {{.*}} [ "funclet"(token %[[CLEANUPPAD]]) ] +// CHECK-NEXT: call void @"?terminate@@YAXXZ"() {{.*}} [ "funclet"(token %[[CLEANUPPAD]]) ] diff --git a/test/CodeGenCXX/exceptions-seh-filter-captures.cpp b/test/CodeGenCXX/exceptions-seh-filter-captures.cpp index ab75a87698ab0..0e97662208280 100644 --- a/test/CodeGenCXX/exceptions-seh-filter-captures.cpp +++ b/test/CodeGenCXX/exceptions-seh-filter-captures.cpp @@ -14,19 +14,19 @@ extern "C" void test_freefunc(int p1) { } } -// CHECK-LABEL: define void @test_freefunc(i32 %p1) +// CHECK-LABEL: define dso_local void @test_freefunc(i32 %p1) // CHECK: @llvm.localescape(i32* %[[p1_ptr:[^, ]*]], i32* %[[l1_ptr:[^, ]*]]) // CHECK: store i32 %p1, i32* %[[p1_ptr]], align 4 // CHECK: store i32 13, i32* %[[l1_ptr]], align 4 // CHECK: invoke void @might_crash() -// CHECK-LABEL: define internal i32 @"\01?filt$0@0@test_freefunc@@"(i8* %exception_pointers, i8* %frame_pointer) +// CHECK-LABEL: define internal i32 @"?filt$0@0@test_freefunc@@"(i8* %exception_pointers, i8* %frame_pointer) // CHECK: %[[fp:[^ ]*]] = call i8* @llvm.x86.seh.recoverfp(i8* bitcast (void (i32)* @test_freefunc to i8*), i8* %frame_pointer) // CHECK: %[[p1_i8:[^ ]*]] = call i8* @llvm.localrecover(i8* bitcast (void (i32)* @test_freefunc to i8*), i8* %[[fp]], i32 0) // CHECK: %[[p1_ptr:[^ ]*]] = bitcast i8* %[[p1_i8]] to i32* // CHECK: %[[l1_i8:[^ ]*]] = call i8* @llvm.localrecover(i8* bitcast (void (i32)* @test_freefunc to i8*), i8* %[[fp]], i32 1) // CHECK: %[[l1_ptr:[^ ]*]] = bitcast i8* %[[l1_i8]] to i32* -// CHECK: %[[s1:[^ ]*]] = load i32, i32* @"\01?s1@?1??test_freefunc@@9@4HA", align 4 +// CHECK: %[[s1:[^ ]*]] = load i32, i32* @"?s1@?1??test_freefunc@@9@4HA", align 4 // CHECK: %[[l1:[^ ]*]] = load i32, i32* %[[l1_ptr]] // CHECK: %[[p1:[^ ]*]] = load i32, i32* %[[p1_ptr]] // CHECK: call i32 (i32, ...) @basic_filter(i32 %[[p1]], i32 %[[l1]], i32 %[[s1]]) @@ -45,14 +45,14 @@ void S::test_method() { } } -// CHECK-LABEL: define void @"\01?test_method@S@@QEAAXXZ"(%struct.S* %this) +// CHECK-LABEL: define dso_local void @"?test_method@S@@QEAAXXZ"(%struct.S* %this) // CHECK: @llvm.localescape(i32* %[[l1_addr:[^, ]*]]) // CHECK: store i32 13, i32* %[[l1_addr]], align 4 // CHECK: invoke void @might_crash() -// CHECK-LABEL: define internal i32 @"\01?filt$0@0@test_method@S@@"(i8* %exception_pointers, i8* %frame_pointer) -// CHECK: %[[fp:[^ ]*]] = call i8* @llvm.x86.seh.recoverfp(i8* bitcast (void (%struct.S*)* @"\01?test_method@S@@QEAAXXZ" to i8*), i8* %frame_pointer) -// CHECK: %[[l1_i8:[^ ]*]] = call i8* @llvm.localrecover(i8* bitcast (void (%struct.S*)* @"\01?test_method@S@@QEAAXXZ" to i8*), i8* %[[fp]], i32 0) +// CHECK-LABEL: define internal i32 @"?filt$0@0@test_method@S@@"(i8* %exception_pointers, i8* %frame_pointer) +// CHECK: %[[fp:[^ ]*]] = call i8* @llvm.x86.seh.recoverfp(i8* bitcast (void (%struct.S*)* @"?test_method@S@@QEAAXXZ" to i8*), i8* %frame_pointer) +// CHECK: %[[l1_i8:[^ ]*]] = call i8* @llvm.localrecover(i8* bitcast (void (%struct.S*)* @"?test_method@S@@QEAAXXZ" to i8*), i8* %[[fp]], i32 0) // CHECK: %[[l1_ptr:[^ ]*]] = bitcast i8* %[[l1_i8]] to i32* // CHECK: %[[l1:[^ ]*]] = load i32, i32* %[[l1_ptr]] // CHECK: call i32 (i32, ...) @basic_filter(i32 %[[l1]]) @@ -70,14 +70,14 @@ void test_lambda() { lambda(); } -// CHECK-LABEL: define internal void @"\01??R<lambda_0>@?0??test_lambda@@YAXXZ@QEBA@XZ"(%class.anon* %this) +// CHECK-LABEL: define internal void @"??R<lambda_0>@?0??test_lambda@@YAXXZ@QEBA@XZ"(%class.anon* %this) // CHECK: @llvm.localescape(i32* %[[l2_addr:[^, ]*]]) // CHECK: store i32 42, i32* %[[l2_addr]], align 4 // CHECK: invoke void @might_crash() -// CHECK-LABEL: define internal i32 @"\01?filt$0@0@?R<lambda_0>@?0??test_lambda@@YAXXZ@"(i8* %exception_pointers, i8* %frame_pointer) -// CHECK: %[[fp:[^ ]*]] = call i8* @llvm.x86.seh.recoverfp(i8* bitcast (void (%class.anon*)* @"\01??R<lambda_0>@?0??test_lambda@@YAXXZ@QEBA@XZ" to i8*), i8* %frame_pointer) -// CHECK: %[[l2_i8:[^ ]*]] = call i8* @llvm.localrecover(i8* bitcast (void (%class.anon*)* @"\01??R<lambda_0>@?0??test_lambda@@YAXXZ@QEBA@XZ" to i8*), i8* %[[fp]], i32 0) +// CHECK-LABEL: define internal i32 @"?filt$0@0@?R<lambda_0>@?0??test_lambda@@YAXXZ@"(i8* %exception_pointers, i8* %frame_pointer) +// CHECK: %[[fp:[^ ]*]] = call i8* @llvm.x86.seh.recoverfp(i8* bitcast (void (%class.anon*)* @"??R<lambda_0>@?0??test_lambda@@YAXXZ@QEBA@XZ" to i8*), i8* %frame_pointer) +// CHECK: %[[l2_i8:[^ ]*]] = call i8* @llvm.localrecover(i8* bitcast (void (%class.anon*)* @"??R<lambda_0>@?0??test_lambda@@YAXXZ@QEBA@XZ" to i8*), i8* %[[fp]], i32 0) // CHECK: %[[l2_ptr:[^ ]*]] = bitcast i8* %[[l2_i8]] to i32* // CHECK: %[[l2:[^ ]*]] = load i32, i32* %[[l2_ptr]] // CHECK: call i32 (i32, ...) @basic_filter(i32 %[[l2]]) diff --git a/test/CodeGenCXX/exceptions-seh.cpp b/test/CodeGenCXX/exceptions-seh.cpp index fa2d834c1e38e..5f88a7b629789 100644 --- a/test/CodeGenCXX/exceptions-seh.cpp +++ b/test/CodeGenCXX/exceptions-seh.cpp @@ -21,28 +21,28 @@ extern "C" void use_cxx() { // Make sure we use __CxxFrameHandler3 for C++ EH. -// CXXEH-LABEL: define void @use_cxx() +// CXXEH-LABEL: define dso_local void @use_cxx() // CXXEH-SAME: personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) -// CXXEH: call %struct.HasCleanup* @"\01??0HasCleanup@@QEAA@XZ"(%struct.HasCleanup* %{{.*}}) +// CXXEH: call %struct.HasCleanup* @"??0HasCleanup@@QEAA@XZ"(%struct.HasCleanup* %{{.*}}) // CXXEH: invoke void @might_throw() // CXXEH: to label %[[cont:[^ ]*]] unwind label %[[lpad:[^ ]*]] // // CXXEH: [[cont]] -// CXXEH: call void @"\01??1HasCleanup@@QEAA@XZ"(%struct.HasCleanup* %{{.*}}) +// CXXEH: call void @"??1HasCleanup@@QEAA@XZ"(%struct.HasCleanup* %{{.*}}) // CXXEH: ret void // // CXXEH: [[lpad]] // CXXEH: cleanuppad -// CXXEH: call void @"\01??1HasCleanup@@QEAA@XZ"(%struct.HasCleanup* %{{.*}}) +// CXXEH: call void @"??1HasCleanup@@QEAA@XZ"(%struct.HasCleanup* %{{.*}}) // CXXEH: cleanupret -// NOCXX-LABEL: define void @use_cxx() +// NOCXX-LABEL: define dso_local void @use_cxx() // NOCXX-NOT: invoke -// NOCXX: call %struct.HasCleanup* @"\01??0HasCleanup@@QEAA@XZ"(%struct.HasCleanup* %{{.*}}) +// NOCXX: call %struct.HasCleanup* @"??0HasCleanup@@QEAA@XZ"(%struct.HasCleanup* %{{.*}}) // NOCXX-NOT: invoke // NOCXX: call void @might_throw() // NOCXX-NOT: invoke -// NOCXX: call void @"\01??1HasCleanup@@QEAA@XZ"(%struct.HasCleanup* %{{.*}}) +// NOCXX: call void @"??1HasCleanup@@QEAA@XZ"(%struct.HasCleanup* %{{.*}}) // NOCXX-NOT: invoke // NOCXX: ret void @@ -55,7 +55,7 @@ extern "C" void use_seh() { // Make sure we use __C_specific_handler for SEH. -// CHECK-LABEL: define void @use_seh() +// CHECK-LABEL: define dso_local void @use_seh() // CHECK-SAME: personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) // CHECK: invoke void @might_throw() #[[NOINLINE:[0-9]+]] // CHECK: to label %[[cont:[^ ]*]] unwind label %[[lpad:[^ ]*]] @@ -87,15 +87,15 @@ extern "C" void nested_finally() { } } -// CHECK-LABEL: define void @nested_finally() #{{[0-9]+}} +// CHECK-LABEL: define dso_local void @nested_finally() #{{[0-9]+}} // CHECK-SAME: personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) // CHECK: invoke void @might_throw() -// CHECK: call void @"\01?fin$0@0@nested_finally@@"(i8 1, i8* {{.*}}) +// CHECK: call void @"?fin$0@0@nested_finally@@"(i8 1, i8* {{.*}}) -// CHECK-LABEL: define internal void @"\01?fin$0@0@nested_finally@@" +// CHECK-LABEL: define internal void @"?fin$0@0@nested_finally@@" // CHECK-SAME: personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) // CHECK: invoke void @might_throw() -// CHECK: call void @"\01?fin$1@0@nested_finally@@"(i8 1, i8* {{.*}}) +// CHECK: call void @"?fin$1@0@nested_finally@@"(i8 1, i8* {{.*}}) void use_seh_in_lambda() { ([]() { @@ -108,15 +108,15 @@ void use_seh_in_lambda() { might_throw(); } -// CXXEH-LABEL: define void @"\01?use_seh_in_lambda@@YAXXZ"() +// CXXEH-LABEL: define dso_local void @"?use_seh_in_lambda@@YAXXZ"() // CXXEH-SAME: personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) // CXXEH: cleanuppad -// NOCXX-LABEL: define void @"\01?use_seh_in_lambda@@YAXXZ"() +// NOCXX-LABEL: define dso_local void @"?use_seh_in_lambda@@YAXXZ"() // NOCXX-NOT: invoke // NOCXX: ret void -// CHECK-LABEL: define internal void @"\01??R<lambda_0>@?0??use_seh_in_lambda@@YAXXZ@QEBA@XZ"(%class.anon* %this) +// CHECK-LABEL: define internal void @"??R<lambda_0>@?0??use_seh_in_lambda@@YAXXZ@QEBA@XZ"(%class.anon* %this) // CXXEH-SAME: personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) // CHECK: invoke void @might_throw() #[[NOINLINE]] // CHECK: catchpad @@ -139,28 +139,28 @@ void use_inline() { use_seh_in_inline_func(); } -// CHECK-LABEL: define linkonce_odr void @use_seh_in_inline_func() #{{[0-9]+}} +// CHECK-LABEL: define linkonce_odr dso_local void @use_seh_in_inline_func() #{{[0-9]+}} // CHECK-SAME: personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) // CHECK: invoke void @might_throw() // -// CHECK: catchpad {{.*}} [i8* bitcast (i32 (i8*, i8*)* @"\01?filt$0@0@use_seh_in_inline_func@@" to i8*)] +// CHECK: catchpad {{.*}} [i8* bitcast (i32 (i8*, i8*)* @"?filt$0@0@use_seh_in_inline_func@@" to i8*)] // // CHECK: invoke void @might_throw() // // CHECK: %[[fp:[^ ]*]] = call i8* @llvm.localaddress() -// CHECK: call void @"\01?fin$0@0@use_seh_in_inline_func@@"(i8 0, i8* %[[fp]]) +// CHECK: call void @"?fin$0@0@use_seh_in_inline_func@@"(i8 0, i8* %[[fp]]) // CHECK: ret void // // CHECK: cleanuppad // CHECK: %[[fp:[^ ]*]] = call i8* @llvm.localaddress() -// CHECK: call void @"\01?fin$0@0@use_seh_in_inline_func@@"(i8 1, i8* %[[fp]]) +// CHECK: call void @"?fin$0@0@use_seh_in_inline_func@@"(i8 1, i8* %[[fp]]) -// CHECK-LABEL: define internal i32 @"\01?filt$0@0@use_seh_in_inline_func@@"(i8* %exception_pointers, i8* %frame_pointer) #{{[0-9]+}} +// CHECK-LABEL: define internal i32 @"?filt$0@0@use_seh_in_inline_func@@"(i8* %exception_pointers, i8* %frame_pointer) #{{[0-9]+}} // CHECK: icmp eq i32 %{{.*}}, 424242 // CHECK: zext i1 %{{.*}} to i32 // CHECK: ret i32 -// CHECK-LABEL: define internal void @"\01?fin$0@0@use_seh_in_inline_func@@"(i8 %abnormal_termination, i8* %frame_pointer) #{{[0-9]+}} +// CHECK-LABEL: define internal void @"?fin$0@0@use_seh_in_inline_func@@"(i8 %abnormal_termination, i8* %frame_pointer) #{{[0-9]+}} // CHECK: store i32 1234, i32* @my_unique_global // CHECK: attributes #[[NOINLINE]] = { {{.*noinline.*}} } diff --git a/test/CodeGenCXX/explicit-instantiation.cpp b/test/CodeGenCXX/explicit-instantiation.cpp index ad20abde8f117..07c5f7265acd6 100644 --- a/test/CodeGenCXX/explicit-instantiation.cpp +++ b/test/CodeGenCXX/explicit-instantiation.cpp @@ -119,14 +119,14 @@ namespace NestedClasses { // definition of Inner. template struct Outer<int>; // CHECK: define weak_odr void @_ZN13NestedClasses5OuterIiE5Inner1fEv - // CHECK-MS: define weak_odr x86_thiscallcc void @"\01?f@Inner@?$Outer@H@NestedClasses@@QAEXXZ" + // CHECK-MS: define weak_odr dso_local x86_thiscallcc void @"?f@Inner@?$Outer@H@NestedClasses@@QAEXXZ" // Explicit instantiation declaration of Outer causes explicit instantiation // declaration of Inner, but not in MSVC mode. extern template struct Outer<char>; auto use = &Outer<char>::Inner::f; // CHECK: {{declare|define available_externally}} void @_ZN13NestedClasses5OuterIcE5Inner1fEv - // CHECK-MS: define linkonce_odr x86_thiscallcc void @"\01?f@Inner@?$Outer@D@NestedClasses@@QAEXXZ" + // CHECK-MS: define linkonce_odr dso_local x86_thiscallcc void @"?f@Inner@?$Outer@D@NestedClasses@@QAEXXZ" } // Check that we emit definitions from explicit instantiations even when they diff --git a/test/CodeGenCXX/extern-c.cpp b/test/CodeGenCXX/extern-c.cpp index 1046915fcaa2c..b80d3257e5de6 100644 --- a/test/CodeGenCXX/extern-c.cpp +++ b/test/CodeGenCXX/extern-c.cpp @@ -7,7 +7,7 @@ extern "C" int a; // CHECK-NOT: @_ZN3foo1bE = global extern int b; -// CHECK: @_ZN3foo1cE = global +// CHECK: @_ZN3foo1cE = {{(dso_local )?}}global int c = 5; // CHECK-NOT: @_ZN3foo1dE @@ -16,21 +16,21 @@ extern "C" struct d; // CHECK-NOT: should_not_appear extern "C++" int should_not_appear; -// CHECK: @_ZN3foo10extern_cxxE = global +// CHECK: @_ZN3foo10extern_cxxE = {{(dso_local )?}}global extern "C++" int extern_cxx = 0; } -// CHECK-NOT: @global_a = global +// CHECK-NOT: @global_a = {{(dso_local )?}}global extern "C" int global_a; -// CHECK: @global_b = global +// CHECK: @global_b = {{(dso_local )?}}global extern "C" int global_b = 0; // CHECK-NOT: should_not_appear extern "C++" int should_not_appear; -// CHECK: @extern_cxx = global +// CHECK: @extern_cxx = {{(dso_local )?}}global extern "C++" int extern_cxx = 0; namespace test1 { @@ -38,11 +38,11 @@ namespace test1 { struct X {}; } extern "C" { - // CHECK: @test1_b = global + // CHECK: @test1_b = {{(dso_local )?}}global X test1_b = X(); } void *use = &test1_b; - // CHECK: @_ZN5test13useE = global + // CHECK: @_ZN5test13useE = {{(dso_local )?}}global } namespace test2 { @@ -50,7 +50,7 @@ namespace test2 { struct X {}; } - // CHECK: @test2_b = global + // CHECK: @test2_b = {{(dso_local )?}}global extern "C" X test2_b; X test2_b; } diff --git a/test/CodeGenCXX/finegrain-bitfield-type.cpp b/test/CodeGenCXX/finegrain-bitfield-type.cpp new file mode 100644 index 0000000000000..ff02d46de5e4e --- /dev/null +++ b/test/CodeGenCXX/finegrain-bitfield-type.cpp @@ -0,0 +1,22 @@ +// RUN: %clang_cc1 -triple x86_64-linux-gnu -ffine-grained-bitfield-accesses \ +// RUN: -emit-llvm -o - %s | FileCheck %s +struct S4 { + unsigned long f1:28; + unsigned long f2:4; + unsigned long f3:12; +}; +struct S4 a4; + +struct S5 { + unsigned long f1:28; + unsigned long f2:4; + unsigned long f3:28; + unsigned long f4:4; + unsigned long f5:12; +}; +struct S5 a5; + +// CHECK: %struct.S4 = type { i32, i16 } +// CHECK-NOT: %struct.S4 = type { i48 } +// CHECK: %struct.S5 = type { i32, i32, i16, [6 x i8] } +// CHECK-NOT: %struct.S5 = type { i80 }
\ No newline at end of file diff --git a/test/CodeGenCXX/float128-declarations.cpp b/test/CodeGenCXX/float128-declarations.cpp index f1db8f41c608c..07e73b2817281 100644 --- a/test/CodeGenCXX/float128-declarations.cpp +++ b/test/CodeGenCXX/float128-declarations.cpp @@ -12,6 +12,10 @@ // RUN: %s -o - | FileCheck %s -check-prefix=CHECK-X86 // RUN: %clang_cc1 -emit-llvm -triple amd64-pc-openbsd -std=c++11 \ // RUN: %s -o - | FileCheck %s -check-prefix=CHECK-X86 +// RUN: %clang_cc1 -emit-llvm -triple i386-pc-solaris2.11 -std=c++11 \ +// RUN: %s -o - | FileCheck %s -check-prefix=CHECK-X86 +// RUN: %clang_cc1 -emit-llvm -triple x86_64-pc-solaris2.11 -std=c++11 \ +// RUN: %s -o - | FileCheck %s -check-prefix=CHECK-X86 // /* Various contexts where type __float128 can appear. The different check prefixes are due to different mangling on X86 and different calling diff --git a/test/CodeGenCXX/float16-declarations.cpp b/test/CodeGenCXX/float16-declarations.cpp index 87ef139f8634b..1d6999fef073b 100644 --- a/test/CodeGenCXX/float16-declarations.cpp +++ b/test/CodeGenCXX/float16-declarations.cpp @@ -29,18 +29,18 @@ namespace { /* File */ _Float16 f1f; -// CHECK-AARCH64-DAG: @f1f = global half 0xH0000, align 2 -// CHECK-X86-DAG: @f1f = global half 0xH0000, align 2 +// CHECK-AARCH64-DAG: @f1f = dso_local global half 0xH0000, align 2 +// CHECK-X86-DAG: @f1f = dso_local global half 0xH0000, align 2 _Float16 f2f = 32.4; -// CHECK-DAG: @f2f = global half 0xH500D, align 2 +// CHECK-DAG: @f2f = dso_local global half 0xH500D, align 2 _Float16 arr1f[10]; -// CHECK-AARCH64-DAG: @arr1f = global [10 x half] zeroinitializer, align 2 -// CHECK-X86-DAG: @arr1f = global [10 x half] zeroinitializer, align 16 +// CHECK-AARCH64-DAG: @arr1f = dso_local global [10 x half] zeroinitializer, align 2 +// CHECK-X86-DAG: @arr1f = dso_local global [10 x half] zeroinitializer, align 16 _Float16 arr2f[] = { -1.2, -3.0, -3.e4 }; -// CHECK-DAG: @arr2f = global [3 x half] [half 0xHBCCD, half 0xHC200, half 0xHF753], align 2 +// CHECK-DAG: @arr2f = dso_local global [3 x half] [half 0xHBCCD, half 0xHC200, half 0xHF753], align 2 _Float16 func1f(_Float16 arg); @@ -51,24 +51,24 @@ class C1 { _Float16 f1c; static const _Float16 f2c; -// CHECK-DAG: @_ZN2C13f2cE = external constant half, align 2 +// CHECK-DAG: @_ZN2C13f2cE = external dso_local constant half, align 2 volatile _Float16 f3c; public: C1(_Float16 arg) : f1c(arg), f3c(arg) { } // Check that we mangle _Float16 to DF16_ -// CHECK-DAG: define linkonce_odr void @_ZN2C1C2EDF16_(%class.C1*{{.*}}, half{{.*}}) +// CHECK-DAG: define linkonce_odr dso_local void @_ZN2C1C2EDF16_(%class.C1*{{.*}}, half{{.*}}) _Float16 func1c(_Float16 arg ) { return f1c + arg; } -// CHECK-DAG: define linkonce_odr half @_ZN2C16func1cEDF16_(%class.C1*{{.*}}, half{{.*}}) +// CHECK-DAG: define linkonce_odr dso_local half @_ZN2C16func1cEDF16_(%class.C1*{{.*}}, half{{.*}}) static _Float16 func2c(_Float16 arg) { return arg * C1::f2c; } -// CHECK-DAG: define linkonce_odr half @_ZN2C16func2cEDF16_(half{{.*}}) +// CHECK-DAG: define linkonce_odr dso_local half @_ZN2C16func2cEDF16_(half{{.*}}) }; /* Template */ @@ -76,7 +76,7 @@ public: template <class C> C func1t(C arg) { return arg * 2.f16; } -// CHECK-DAG: define linkonce_odr half @_Z6func1tIDF16_ET_S0_(half{{.*}}) +// CHECK-DAG: define linkonce_odr dso_local half @_Z6func1tIDF16_ET_S0_(half{{.*}}) template <class C> struct S1 { C mem1; @@ -103,12 +103,12 @@ int main(void) { C1 c1(f1l); // CHECK-DAG: [[F1L:%[a-z0-9]+]] = load half, half* %{{.*}}, align 2 -// CHECK-DAG: call void @_ZN2C1C2EDF16_(%class.C1* %{{.*}}, half %{{.*}}) +// CHECK-DAG: call void @_ZN2C1C1EDF16_(%class.C1* %{{.*}}, half %{{.*}}) S1<_Float16> s1 = { 132.f16 }; // CHECK-DAG: @_ZZ4mainE2s1 = private unnamed_addr constant %struct.S1 { half 0xH5820 }, align 2 // CHECK-DAG: [[S1:%[0-9]+]] = bitcast %struct.S1* %{{.*}} to i8* -// CHECK-DAG: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[S1]], i8* bitcast (%struct.S1* @_ZZ4mainE2s1 to i8*), i64 2, i32 2, i1 false) +// CHECK-DAG: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 2 [[S1]], i8* align 2 bitcast (%struct.S1* @_ZZ4mainE2s1 to i8*), i64 2, i1 false) _Float16 f4l = func1n(f1l) + func1f(f2l) + c1.func1c(f3l) + c1.func2c(f1l) + func1t(f1l) + s1.mem2 - f1n + f2n; diff --git a/test/CodeGenCXX/funcsig.cpp b/test/CodeGenCXX/funcsig.cpp index 16e5f7e1c9b14..5328ff9462068 100644 --- a/test/CodeGenCXX/funcsig.cpp +++ b/test/CodeGenCXX/funcsig.cpp @@ -12,24 +12,24 @@ int printf(const char *, ...); void funcNoProto() { printf("__FUNCSIG__ %s\n\n", __FUNCSIG__); } -// CHECK-C: @"\01??_C@_0BL@IHLLLCAO@void?5__cdecl?5funcNoProto?$CI?$CJ?$AA@" = linkonce_odr unnamed_addr constant [27 x i8] c"void __cdecl funcNoProto()\00" -// CHECK-CXX: @"\01??_C@_0BP@PJOECCJN@void?5__cdecl?5funcNoProto?$CIvoid?$CJ?$AA@" = linkonce_odr unnamed_addr constant [31 x i8] c"void __cdecl funcNoProto(void)\00" +// CHECK-C: @"??_C@_0BL@IHLLLCAO@void?5__cdecl?5funcNoProto?$CI?$CJ?$AA@" = linkonce_odr dso_local unnamed_addr constant [27 x i8] c"void __cdecl funcNoProto()\00" +// CHECK-CXX: @"??_C@_0BP@PJOECCJN@void?5__cdecl?5funcNoProto?$CIvoid?$CJ?$AA@" = linkonce_odr dso_local unnamed_addr constant [31 x i8] c"void __cdecl funcNoProto(void)\00" void funcNoParams(void) { printf("__FUNCSIG__ %s\n\n", __FUNCSIG__); } -// CHECK: @"\01??_C@_0CA@GBIDFNBN@void?5__cdecl?5funcNoParams?$CIvoid?$CJ?$AA@" = linkonce_odr unnamed_addr constant [32 x i8] c"void __cdecl funcNoParams(void)\00" +// CHECK: @"??_C@_0CA@GBIDFNBN@void?5__cdecl?5funcNoParams?$CIvoid?$CJ?$AA@" = linkonce_odr dso_local unnamed_addr constant [32 x i8] c"void __cdecl funcNoParams(void)\00" void freeFunc(int *p, char c) { printf("__FUNCSIG__ %s\n\n", __FUNCSIG__); } -// CHECK: @"\01??_C@_0CD@KLGMNNL@void?5__cdecl?5freeFunc?$CIint?5?$CK?0?5cha@" = linkonce_odr unnamed_addr constant [{{.*}} x i8] c"void __cdecl freeFunc(int *, char)\00" +// CHECK: @"??_C@_0CD@KLGMNNL@void?5__cdecl?5freeFunc?$CIint?5?$CK?0?5cha@" = linkonce_odr dso_local unnamed_addr constant [{{.*}} x i8] c"void __cdecl freeFunc(int *, char)\00" #ifdef __cplusplus void funcVarargs(...) { printf("__FUNCSIG__ %s\n\n", __FUNCSIG__); } -// CHECK-CXX: @"\01??_C@_0BO@BOBPLEKP@void?5__cdecl?5funcVarargs?$CI?4?4?4?$CJ?$AA@" = linkonce_odr unnamed_addr constant [30 x i8] c"void __cdecl funcVarargs(...)\00" +// CHECK-CXX: @"??_C@_0BO@BOBPLEKP@void?5__cdecl?5funcVarargs?$CI?4?4?4?$CJ?$AA@" = linkonce_odr dso_local unnamed_addr constant [30 x i8] c"void __cdecl funcVarargs(...)\00" struct TopLevelClass { void topLevelMethod(int *, char); @@ -37,7 +37,7 @@ struct TopLevelClass { void TopLevelClass::topLevelMethod(int *, char) { printf("__FUNCSIG__ %s\n\n", __FUNCSIG__); } -// CHECK-CXX: @"\01??_C@_0DL@OBHNMDP@void?5__thiscall?5TopLevelClass?3?3t@" = linkonce_odr unnamed_addr constant [{{.*}} x i8] c"void __thiscall TopLevelClass::topLevelMethod(int *, char)\00" +// CHECK-CXX: @"??_C@_0DL@OBHNMDP@void?5__thiscall?5TopLevelClass?3?3t@" = linkonce_odr dso_local unnamed_addr constant [{{.*}} x i8] c"void __thiscall TopLevelClass::topLevelMethod(int *, char)\00" namespace NS { struct NamespacedClass { @@ -46,6 +46,6 @@ struct NamespacedClass { void NamespacedClass::namespacedMethod(int *, char) { printf("__FUNCSIG__ %s\n\n", __FUNCSIG__); } -// CHECK-CXX: @"\01??_C@_0ED@PFDKIEBA@void?5__thiscall?5NS?3?3NamespacedCl@" = linkonce_odr unnamed_addr constant [{{.*}} x i8] c"void __thiscall NS::NamespacedClass::namespacedMethod(int *, char)\00" +// CHECK-CXX: @"??_C@_0ED@PFDKIEBA@void?5__thiscall?5NS?3?3NamespacedCl@" = linkonce_odr dso_local unnamed_addr constant [{{.*}} x i8] c"void __thiscall NS::NamespacedClass::namespacedMethod(int *, char)\00" } #endif diff --git a/test/CodeGenCXX/global-llvm-constant.cpp b/test/CodeGenCXX/global-llvm-constant.cpp index 55933eecfc3ee..877683eead072 100644 --- a/test/CodeGenCXX/global-llvm-constant.cpp +++ b/test/CodeGenCXX/global-llvm-constant.cpp @@ -15,7 +15,7 @@ struct X { int add(int x, int y) { return x + y; } -// CHECK: @x2 = constant +// CHECK: @x2 = {{(dso_local )?}}constant extern const X x2; const X x2 = { &add }; @@ -27,6 +27,6 @@ struct X2 { X1 array[3]; }; -// CHECK: @x2b = global +// CHECK: @x2b = {{(dso_local )?}}global extern const X2 x2b; const X2 x2b = { { { 1 }, { 2 }, { 3 } } }; diff --git a/test/CodeGenCXX/hidden-dllimport.cpp b/test/CodeGenCXX/hidden-dllimport.cpp new file mode 100644 index 0000000000000..573b4210bfb39 --- /dev/null +++ b/test/CodeGenCXX/hidden-dllimport.cpp @@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -emit-llvm -fvisibility-inlines-hidden -o - %s | FileCheck %s + +// We used to declare this hidden dllimport, which is contradictory. + +// CHECK: declare dllimport void @"?bar@foo@@QEAAXXZ"(%struct.foo*) + +struct __attribute__((dllimport)) foo { + void bar() {} +}; +void zed(foo *p) { p->bar(); } diff --git a/test/CodeGenCXX/homogeneous-aggregates.cpp b/test/CodeGenCXX/homogeneous-aggregates.cpp index 1338b25e21ae1..05fb7f1d20a4b 100644 --- a/test/CodeGenCXX/homogeneous-aggregates.cpp +++ b/test/CodeGenCXX/homogeneous-aggregates.cpp @@ -41,13 +41,13 @@ struct D5 : I1, I2, I3 {}; // homogeneous aggregate // PPC: define void @_Z7func_D12D1(%struct.D1* noalias sret %agg.result, [3 x i64] %x.coerce) // ARM32: define arm_aapcs_vfpcc void @_Z7func_D12D1(%struct.D1* noalias sret %agg.result, [3 x i64] %x.coerce) // ARM64: define void @_Z7func_D12D1(%struct.D1* noalias sret %agg.result, %struct.D1* %x) -// X64: define x86_vectorcallcc void @"\01_Z7func_D12D1@@24"(%struct.D1* noalias sret %agg.result, %struct.D1* %x) +// X64: define dso_local x86_vectorcallcc void @"\01_Z7func_D12D1@@24"(%struct.D1* noalias sret %agg.result, %struct.D1* %x) D1 CC func_D1(D1 x) { return x; } // PPC: define [3 x double] @_Z7func_D22D2([3 x double] %x.coerce) // ARM32: define arm_aapcs_vfpcc %struct.D2 @_Z7func_D22D2(%struct.D2 %x.coerce) // ARM64: define %struct.D2 @_Z7func_D22D2([3 x double] %x.coerce) -// X64: define x86_vectorcallcc %struct.D2 @"\01_Z7func_D22D2@@24"(%struct.D2 inreg %x.coerce) +// X64: define dso_local x86_vectorcallcc %struct.D2 @"\01_Z7func_D22D2@@24"(%struct.D2 inreg %x.coerce) D2 CC func_D2(D2 x) { return x; } // PPC: define void @_Z7func_D32D3(%struct.D3* noalias sret %agg.result, [4 x i64] %x.coerce) @@ -92,7 +92,7 @@ struct HVAWithEmptyBase : Float1, Empty, Float2 { float z; }; void CC with_empty_base(HVAWithEmptyBase a) {} // FIXME: MSVC doesn't consider this an HVA because of the empty base. -// X64: define x86_vectorcallcc void @"\01_Z15with_empty_base16HVAWithEmptyBase@@16"(%struct.HVAWithEmptyBase inreg %a.coerce) +// X64: define dso_local x86_vectorcallcc void @"\01_Z15with_empty_base16HVAWithEmptyBase@@16"(%struct.HVAWithEmptyBase inreg %a.coerce) struct HVAWithEmptyBitField : Float1, Float2 { int : 0; // Takes no space. @@ -102,5 +102,5 @@ struct HVAWithEmptyBitField : Float1, Float2 { // PPC: define void @_Z19with_empty_bitfield20HVAWithEmptyBitField([3 x float] %a.coerce) // ARM64: define void @_Z19with_empty_bitfield20HVAWithEmptyBitField([3 x float] %a.coerce) // ARM32: define arm_aapcs_vfpcc void @_Z19with_empty_bitfield20HVAWithEmptyBitField(%struct.HVAWithEmptyBitField %a.coerce) -// X64: define x86_vectorcallcc void @"\01_Z19with_empty_bitfield20HVAWithEmptyBitField@@16"(%struct.HVAWithEmptyBitField inreg %a.coerce) +// X64: define dso_local x86_vectorcallcc void @"\01_Z19with_empty_bitfield20HVAWithEmptyBitField@@16"(%struct.HVAWithEmptyBitField inreg %a.coerce) void CC with_empty_bitfield(HVAWithEmptyBitField a) {} diff --git a/test/CodeGenCXX/inheriting-constructor.cpp b/test/CodeGenCXX/inheriting-constructor.cpp index 1be59b9305d33..fa3e5ab8aab75 100644 --- a/test/CodeGenCXX/inheriting-constructor.cpp +++ b/test/CodeGenCXX/inheriting-constructor.cpp @@ -18,8 +18,8 @@ D d(123); // ITANIUM-LABEL: define void @_ZN1BD2Ev // ITANIUM-LABEL: define void @_ZN1BD1Ev // ITANIUM-LABEL: define void @_ZN1BD0Ev -// WIN32-LABEL: define {{.*}}void @"\01??1B@@UAE@XZ" -// WIN64-LABEL: define {{.*}}void @"\01??1B@@UEAA@XZ" +// WIN32-LABEL: define {{.*}}void @"??1B@@UAE@XZ" +// WIN64-LABEL: define {{.*}}void @"??1B@@UEAA@XZ" // ITANIUM-LABEL: define linkonce_odr void @_ZN1BCI11AEi( // ITANIUM: call void @_ZN1BCI21AEi( @@ -27,15 +27,15 @@ D d(123); // ITANIUM-LABEL: define linkonce_odr void @_ZN1DCI11CIiEET_( // ITANIUM: call void @_ZN1DCI21CIiEET_( -// WIN32-LABEL: define internal {{.*}} @"\01??0B@@QAE@H@Z"( -// WIN32: call {{.*}} @"\01??0A@@QAE@H@Z"( -// WIN64-LABEL: define internal {{.*}} @"\01??0B@@QEAA@H@Z"( -// WIN64: call {{.*}} @"\01??0A@@QEAA@H@Z"( +// WIN32-LABEL: define internal {{.*}} @"??0B@@QAE@H@Z"( +// WIN32: call {{.*}} @"??0A@@QAE@H@Z"( +// WIN64-LABEL: define internal {{.*}} @"??0B@@QEAA@H@Z"( +// WIN64: call {{.*}} @"??0A@@QEAA@H@Z"( -// WIN32-LABEL: define internal {{.*}} @"\01??0D@@QAE@H@Z"( -// WIN32: call {{.*}} @"\01??$?0H@C@@QAE@H@Z" -// WIN64-LABEL: define internal {{.*}} @"\01??0D@@QEAA@H@Z"( -// WIN64: call {{.*}} @"\01??$?0H@C@@QEAA@H@Z" +// WIN32-LABEL: define internal {{.*}} @"??0D@@QAE@H@Z"( +// WIN32: call {{.*}} @"??$?0H@C@@QAE@H@Z" +// WIN64-LABEL: define internal {{.*}} @"??0D@@QEAA@H@Z"( +// WIN64: call {{.*}} @"??$?0H@C@@QEAA@H@Z" struct Q { Q(int); Q(const Q&); ~Q(); }; struct Z { Z(); Z(int); ~Z(); int n; }; @@ -55,10 +55,10 @@ namespace noninline_nonvirt { // ITANIUM: call void @_ZN17noninline_nonvirt1BCI2NS_1AEEiO1QPvU17pass_object_size0({{.*}}, i32 {{.*}}, %{{.*}}* {{.*}}, i8* {{.*}}, i{{32|64}} {{.*}}) // In MSABI, we don't have ctor variants. B ctor forwards to A ctor. - // MSABI-LABEL: define internal {{.*}} @"\01??0B@noninline_nonvirt@@Q{{AE|EAA}}@H$$Q{{E?}}AUQ@@P{{E?}}AXW4__pass_object_size0@__clang@@@Z"(%{{.*}}, i32{{.*}}, %{{.*}}, i8*{{.*}}, i{{32|64}}{{.*}}) - // MSABI: call {{.*}} @"\01??0Z@@Q{{AE|EAA}}@XZ"( - // MSABI: call {{.*}} @"\01??0A@noninline_nonvirt@@Q{{AE|EAA}}@H$$Q{{E?}}AUQ@@P{{E?}}AXW4__pass_object_size0@__clang@@@Z"(%{{.*}}, i32{{.*}}, %{{.*}}, i8*{{.*}}, i{{32|64}}{{.*}}) - // MSABI: call {{.*}} @"\01??0Z@@Q{{AE|EAA}}@XZ"( + // MSABI-LABEL: define internal {{.*}} @"??0B@noninline_nonvirt@@Q{{AE|EAA}}@H$$Q{{E?}}AUQ@@P{{E?}}AXW4__pass_object_size0@__clang@@@Z"(%{{.*}}, i32{{.*}}, %{{.*}}, i8*{{.*}}, i{{32|64}}{{.*}}) + // MSABI: call {{.*}} @"??0Z@@Q{{AE|EAA}}@XZ"( + // MSABI: call {{.*}} @"??0A@noninline_nonvirt@@Q{{AE|EAA}}@H$$Q{{E?}}AUQ@@P{{E?}}AXW4__pass_object_size0@__clang@@@Z"(%{{.*}}, i32{{.*}}, %{{.*}}, i8*{{.*}}, i{{32|64}}{{.*}}) + // MSABI: call {{.*}} @"??0Z@@Q{{AE|EAA}}@XZ"( struct C : B { using B::B; }; C c(1, 2, &c); @@ -66,8 +66,8 @@ namespace noninline_nonvirt { // ITANIUM-LABEL: define linkonce_odr void @_ZN17noninline_nonvirt1CCI1NS_1AEEiO1QPvU17pass_object_size0( // ITANIUM: call void @_ZN17noninline_nonvirt1CCI2NS_1AEEiO1QPvU17pass_object_size0({{.*}}, i32 {{.*}}, %{{.*}}* {{.*}}, i8* {{.*}}, i{{32|64}} {{.*}}) - // MSABI-LABEL: define internal {{.*}} @"\01??0C@noninline_nonvirt@@Q{{AE|EAA}}@H$$Q{{E?}}AUQ@@P{{E?}}AXW4__pass_object_size0@__clang@@@Z"(%{{.*}}, i32{{.*}}, %{{.*}}, i8*{{.*}}, i{{32|64}}{{.*}}) - // MSABI: call {{.*}} @"\01??0B@noninline_nonvirt@@Q{{AE|EAA}}@H$$Q{{E?}}AUQ@@P{{E?}}AXW4__pass_object_size0@__clang@@@Z"(%{{.*}}, i32{{.*}}, %{{.*}}, i8*{{.*}}, i{{32|64}}{{.*}}) + // MSABI-LABEL: define internal {{.*}} @"??0C@noninline_nonvirt@@Q{{AE|EAA}}@H$$Q{{E?}}AUQ@@P{{E?}}AXW4__pass_object_size0@__clang@@@Z"(%{{.*}}, i32{{.*}}, %{{.*}}, i8*{{.*}}, i{{32|64}}{{.*}}) + // MSABI: call {{.*}} @"??0B@noninline_nonvirt@@Q{{AE|EAA}}@H$$Q{{E?}}AUQ@@P{{E?}}AXW4__pass_object_size0@__clang@@@Z"(%{{.*}}, i32{{.*}}, %{{.*}}, i8*{{.*}}, i{{32|64}}{{.*}}) } namespace noninline_virt { @@ -81,13 +81,13 @@ namespace noninline_virt { // ITANIUM: store {{.*}} @_ZTVN14noninline_virt1BE // ITANIUM: call void @_ZN1ZC1Ev( - // MSABI-LABEL: define internal {{.*}} @"\01??0B@noninline_virt@@Q{{AE|EAA}}@H$$Q{{E?}}AUQ@@P{{E?}}AXW4__pass_object_size0@__clang@@@Z"(%{{.*}}, i32{{.*}}, %{{.*}}, i8*{{.*}}, i{{32|64}}{{.*}}, i32 %{{.*}}) + // MSABI-LABEL: define internal {{.*}} @"??0B@noninline_virt@@Q{{AE|EAA}}@H$$Q{{E?}}AUQ@@P{{E?}}AXW4__pass_object_size0@__clang@@@Z"(%{{.*}}, i32{{.*}}, %{{.*}}, i8*{{.*}}, i{{32|64}}{{.*}}, i32 %{{.*}}) // MSABI: %[[COMPLETE:.*]] = icmp ne // MSABI: br i1 %[[COMPLETE]], - // MSABI: call {{.*}} @"\01??0A@noninline_virt@@Q{{AE|EAA}}@H$$Q{{E?}}AUQ@@P{{E?}}AXW4__pass_object_size0@__clang@@@Z"(%{{.*}}, i32{{.*}}, %{{.*}}, i8*{{.*}}, i{{32|64}}{{.*}}) + // MSABI: call {{.*}} @"??0A@noninline_virt@@Q{{AE|EAA}}@H$$Q{{E?}}AUQ@@P{{E?}}AXW4__pass_object_size0@__clang@@@Z"(%{{.*}}, i32{{.*}}, %{{.*}}, i8*{{.*}}, i{{32|64}}{{.*}}) // MSABI: br - // MSABI: call {{.*}} @"\01??0Z@@Q{{AE|EAA}}@XZ"( - // MSABI: call {{.*}} @"\01??0Z@@Q{{AE|EAA}}@XZ"( + // MSABI: call {{.*}} @"??0Z@@Q{{AE|EAA}}@XZ"( + // MSABI: call {{.*}} @"??0Z@@Q{{AE|EAA}}@XZ"( struct C : B { using B::B; }; C c(1, 2, &c); @@ -101,12 +101,12 @@ namespace noninline_virt { // C constructor forwards to B constructor and A constructor. We pass the args // to both. FIXME: Can we pass undef here instead, for the base object // constructor call? - // MSABI-LABEL: define internal {{.*}} @"\01??0C@noninline_virt@@Q{{AE|EAA}}@H$$Q{{E?}}AUQ@@P{{E?}}AXW4__pass_object_size0@__clang@@@Z"(%{{.*}}, i32{{.*}}, %{{.*}}, i8*{{.*}}, i{{32|64}}{{.*}}, i32 %{{.*}}) + // MSABI-LABEL: define internal {{.*}} @"??0C@noninline_virt@@Q{{AE|EAA}}@H$$Q{{E?}}AUQ@@P{{E?}}AXW4__pass_object_size0@__clang@@@Z"(%{{.*}}, i32{{.*}}, %{{.*}}, i8*{{.*}}, i{{32|64}}{{.*}}, i32 %{{.*}}) // MSABI: %[[COMPLETE:.*]] = icmp ne // MSABI: br i1 %[[COMPLETE]], - // MSABI: call {{.*}} @"\01??0A@noninline_virt@@Q{{AE|EAA}}@H$$Q{{E?}}AUQ@@P{{E?}}AXW4__pass_object_size0@__clang@@@Z"(%{{.*}}, i32{{.*}}, %{{.*}}, i8*{{.*}}, i{{32|64}}{{.*}}) + // MSABI: call {{.*}} @"??0A@noninline_virt@@Q{{AE|EAA}}@H$$Q{{E?}}AUQ@@P{{E?}}AXW4__pass_object_size0@__clang@@@Z"(%{{.*}}, i32{{.*}}, %{{.*}}, i8*{{.*}}, i{{32|64}}{{.*}}) // MSABI: br - // MSABI: call {{.*}} @"\01??0B@noninline_virt@@Q{{AE|EAA}}@H$$Q{{E?}}AUQ@@P{{E?}}AXW4__pass_object_size0@__clang@@@Z"(%{{.*}}, i32{{.*}}, %{{.*}}, i8*{{.*}}, i{{32|64}}{{.*}}, i32 0) + // MSABI: call {{.*}} @"??0B@noninline_virt@@Q{{AE|EAA}}@H$$Q{{E?}}AUQ@@P{{E?}}AXW4__pass_object_size0@__clang@@@Z"(%{{.*}}, i32{{.*}}, %{{.*}}, i8*{{.*}}, i{{32|64}}{{.*}}, i32 0) } // For MSABI only, check that inalloca arguments result in inlining. @@ -118,75 +118,75 @@ namespace inalloca_nonvirt { // ITANIUM-LABEL: define linkonce_odr void @_ZN16inalloca_nonvirt1BCI1NS_1AEE1QiS1_OS1_( // ITANIUM: call void @_ZN16inalloca_nonvirt1BCI2NS_1AEE1QiS1_OS1_( - // MSABI-LABEL: define internal void @"\01??__Eb@inalloca_nonvirt@@YAXXZ"( + // MSABI-LABEL: define internal void @"??__Eb@inalloca_nonvirt@@YAXXZ"( // On Win32, the inalloca call can't be forwarded so we force inlining. // WIN32: %[[TMP:.*]] = alloca // WIN32: call i8* @llvm.stacksave() // WIN32: %[[ARGMEM:.*]] = alloca inalloca - // WIN32: call {{.*}} @"\01??0Q@@QAE@H@Z"(%{{.*}}* %[[TMP]], i32 4) + // WIN32: call {{.*}} @"??0Q@@QAE@H@Z"(%{{.*}}* %[[TMP]], i32 4) // WIN32: %[[ARG3:.*]] = getelementptr {{.*}} %[[ARGMEM]] - // WIN32: call {{.*}} @"\01??0Q@@QAE@H@Z"({{.*}}* %[[ARG3]], i32 3) + // WIN32: call {{.*}} @"??0Q@@QAE@H@Z"({{.*}}* %[[ARG3]], i32 3) // WIN32: %[[ARG1:.*]] = getelementptr {{.*}} %[[ARGMEM]] - // WIN32: call {{.*}} @"\01??0Q@@QAE@H@Z"({{.*}}* %[[ARG1]], i32 1) - // WIN32: call {{.*}} @"\01??0Z@@QAE@XZ"( + // WIN32: call {{.*}} @"??0Q@@QAE@H@Z"({{.*}}* %[[ARG1]], i32 1) + // WIN32: call {{.*}} @"??0Z@@QAE@XZ"( // WIN32: %[[ARG2:.*]] = getelementptr {{.*}} %[[ARGMEM]] // WIN32: store i32 2, i32* %[[ARG2]] // WIN32: %[[ARG4:.*]] = getelementptr {{.*}} %[[ARGMEM]] // WIN32: store {{.*}}* %[[TMP]], {{.*}}** %[[ARG4]] - // WIN32: call {{.*}} @"\01??0A@inalloca_nonvirt@@QAE@UQ@@H0$$QAU2@@Z"(%{{[^,]*}}, <{{.*}}>* inalloca %[[ARGMEM]]) + // WIN32: call {{.*}} @"??0A@inalloca_nonvirt@@QAE@UQ@@H0$$QAU2@@Z"(%{{[^,]*}}, <{{.*}}>* inalloca %[[ARGMEM]]) // WIN32: call void @llvm.stackrestore( - // WIN32: call {{.*}} @"\01??0Z@@QAE@XZ"( - // WIN32: call {{.*}} @"\01??_DQ@@QAEXXZ"( + // WIN32: call {{.*}} @"??0Z@@QAE@XZ"( + // WIN32: call {{.*}} @"??1Q@@QAE@XZ"( // On Win64, the Q arguments would be destroyed in the callee. We don't yet // support that in the non-inlined case, so we force inlining. // WIN64: %[[TMP:.*]] = alloca // WIN64: %[[ARG3:.*]] = alloca // WIN64: %[[ARG1:.*]] = alloca - // WIN64: call {{.*}} @"\01??0Q@@QEAA@H@Z"({{.*}}* %[[TMP]], i32 4) - // WIN64: call {{.*}} @"\01??0Q@@QEAA@H@Z"({{.*}}* %[[ARG3]], i32 3) - // WIN64: call {{.*}} @"\01??0Q@@QEAA@H@Z"({{.*}}* %[[ARG1]], i32 1) - // WIN64: call {{.*}} @"\01??0Z@@QEAA@XZ"( - // WIN64: call {{.*}} @"\01??0A@inalloca_nonvirt@@QEAA@UQ@@H0$$QEAU2@@Z"(%{{.*}}, %{{.*}}* %[[ARG1]], i32 2, %{{.*}}* %[[ARG3]], %{{.*}} %[[TMP]]) - // WIN64: call {{.*}} @"\01??0Z@@QEAA@XZ"( - // WIN64: call void @"\01??_DQ@@QEAAXXZ"({{.*}}* %[[TMP]]) + // WIN64: call {{.*}} @"??0Q@@QEAA@H@Z"({{.*}}* %[[TMP]], i32 4) + // WIN64: call {{.*}} @"??0Q@@QEAA@H@Z"({{.*}}* %[[ARG3]], i32 3) + // WIN64: call {{.*}} @"??0Q@@QEAA@H@Z"({{.*}}* %[[ARG1]], i32 1) + // WIN64: call {{.*}} @"??0Z@@QEAA@XZ"( + // WIN64: call {{.*}} @"??0A@inalloca_nonvirt@@QEAA@UQ@@H0$$QEAU2@@Z"(%{{.*}}, %{{.*}}* %[[ARG1]], i32 2, %{{.*}}* %[[ARG3]], %{{.*}} %[[TMP]]) + // WIN64: call {{.*}} @"??0Z@@QEAA@XZ"( + // WIN64: call void @"??1Q@@QEAA@XZ"({{.*}}* %[[TMP]]) struct C : B { using B::B; }; C c(1, 2, 3, 4); - // MSABI-LABEL: define internal void @"\01??__Ec@inalloca_nonvirt@@YAXXZ"( + // MSABI-LABEL: define internal void @"??__Ec@inalloca_nonvirt@@YAXXZ"( // On Win32, the inalloca call can't be forwarded so we force inlining. // WIN32: %[[TMP:.*]] = alloca // WIN32: call i8* @llvm.stacksave() // WIN32: %[[ARGMEM:.*]] = alloca inalloca - // WIN32: call {{.*}} @"\01??0Q@@QAE@H@Z"(%{{.*}}* %[[TMP]], i32 4) + // WIN32: call {{.*}} @"??0Q@@QAE@H@Z"(%{{.*}}* %[[TMP]], i32 4) // WIN32: %[[ARG3:.*]] = getelementptr {{.*}} %[[ARGMEM]] - // WIN32: call {{.*}} @"\01??0Q@@QAE@H@Z"({{.*}}* %[[ARG3]], i32 3) + // WIN32: call {{.*}} @"??0Q@@QAE@H@Z"({{.*}}* %[[ARG3]], i32 3) // WIN32: %[[ARG1:.*]] = getelementptr {{.*}} %[[ARGMEM]] - // WIN32: call {{.*}} @"\01??0Q@@QAE@H@Z"({{.*}}* %[[ARG1]], i32 1) - // WIN32: call {{.*}} @"\01??0Z@@QAE@XZ"( + // WIN32: call {{.*}} @"??0Q@@QAE@H@Z"({{.*}}* %[[ARG1]], i32 1) + // WIN32: call {{.*}} @"??0Z@@QAE@XZ"( // WIN32: %[[ARG2:.*]] = getelementptr {{.*}} %[[ARGMEM]] // WIN32: store i32 2, i32* %[[ARG2]] // WIN32: %[[ARG4:.*]] = getelementptr {{.*}} %[[ARGMEM]] // WIN32: store {{.*}}* %[[TMP]], {{.*}}** %[[ARG4]] - // WIN32: call {{.*}} @"\01??0A@inalloca_nonvirt@@QAE@UQ@@H0$$QAU2@@Z"(%{{[^,]*}}, <{{.*}}>* inalloca %[[ARGMEM]]) + // WIN32: call {{.*}} @"??0A@inalloca_nonvirt@@QAE@UQ@@H0$$QAU2@@Z"(%{{[^,]*}}, <{{.*}}>* inalloca %[[ARGMEM]]) // WIN32: call void @llvm.stackrestore( - // WIN32: call {{.*}} @"\01??0Z@@QAE@XZ"( - // WIN32: call {{.*}} @"\01??_DQ@@QAEXXZ"( + // WIN32: call {{.*}} @"??0Z@@QAE@XZ"( + // WIN32: call {{.*}} @"??1Q@@QAE@XZ"( // On Win64, the Q arguments would be destroyed in the callee. We don't yet // support that in the non-inlined case, so we force inlining. // WIN64: %[[TMP:.*]] = alloca // WIN64: %[[ARG3:.*]] = alloca // WIN64: %[[ARG1:.*]] = alloca - // WIN64: call {{.*}} @"\01??0Q@@QEAA@H@Z"({{.*}}* %[[TMP]], i32 4) - // WIN64: call {{.*}} @"\01??0Q@@QEAA@H@Z"({{.*}}* %[[ARG3]], i32 3) - // WIN64: call {{.*}} @"\01??0Q@@QEAA@H@Z"({{.*}}* %[[ARG1]], i32 1) - // WIN64: call {{.*}} @"\01??0Z@@QEAA@XZ"( - // WIN64: call {{.*}} @"\01??0A@inalloca_nonvirt@@QEAA@UQ@@H0$$QEAU2@@Z"(%{{.*}}, %{{.*}}* %[[ARG1]], i32 2, %{{.*}}* %[[ARG3]], %{{.*}} %[[TMP]]) - // WIN64: call {{.*}} @"\01??0Z@@QEAA@XZ"( - // WIN64: call void @"\01??_DQ@@QEAAXXZ"({{.*}}* %[[TMP]]) + // WIN64: call {{.*}} @"??0Q@@QEAA@H@Z"({{.*}}* %[[TMP]], i32 4) + // WIN64: call {{.*}} @"??0Q@@QEAA@H@Z"({{.*}}* %[[ARG3]], i32 3) + // WIN64: call {{.*}} @"??0Q@@QEAA@H@Z"({{.*}}* %[[ARG1]], i32 1) + // WIN64: call {{.*}} @"??0Z@@QEAA@XZ"( + // WIN64: call {{.*}} @"??0A@inalloca_nonvirt@@QEAA@UQ@@H0$$QEAU2@@Z"(%{{.*}}, %{{.*}}* %[[ARG1]], i32 2, %{{.*}}* %[[ARG3]], %{{.*}} %[[TMP]]) + // WIN64: call {{.*}} @"??0Z@@QEAA@XZ"( + // WIN64: call void @"??1Q@@QEAA@XZ"({{.*}}* %[[TMP]]) } namespace inalloca_virt { @@ -194,79 +194,79 @@ namespace inalloca_virt { struct B : Z, virtual A { Z z; using A::A; }; B b(1, 2, 3, 4); - // MSABI-LABEL: define internal void @"\01??__Eb@inalloca_virt@@YAXXZ"( + // MSABI-LABEL: define internal void @"??__Eb@inalloca_virt@@YAXXZ"( // On Win32, the inalloca call can't be forwarded so we force inlining. // WIN32: %[[TMP:.*]] = alloca // WIN32: call i8* @llvm.stacksave() // WIN32: %[[ARGMEM:.*]] = alloca inalloca - // WIN32: call {{.*}} @"\01??0Q@@QAE@H@Z"(%{{.*}}* %[[TMP]], i32 4) + // WIN32: call {{.*}} @"??0Q@@QAE@H@Z"(%{{.*}}* %[[TMP]], i32 4) // WIN32: %[[ARG3:.*]] = getelementptr {{.*}} %[[ARGMEM]] - // WIN32: call {{.*}} @"\01??0Q@@QAE@H@Z"({{.*}}* %[[ARG3]], i32 3) + // WIN32: call {{.*}} @"??0Q@@QAE@H@Z"({{.*}}* %[[ARG3]], i32 3) // WIN32: %[[ARG1:.*]] = getelementptr {{.*}} %[[ARGMEM]] - // WIN32: call {{.*}} @"\01??0Q@@QAE@H@Z"({{.*}}* %[[ARG1]], i32 1) + // WIN32: call {{.*}} @"??0Q@@QAE@H@Z"({{.*}}* %[[ARG1]], i32 1) // FIXME: It's dumb to round-trip this though memory and generate a branch. // WIN32: store i32 1, i32* %[[IS_MOST_DERIVED_ADDR:.*]] // WIN32: %[[IS_MOST_DERIVED:.*]] = load i32, i32* %[[IS_MOST_DERIVED_ADDR]] // WIN32: %[[IS_MOST_DERIVED_i1:.*]] = icmp ne i32 %[[IS_MOST_DERIVED]], 0 // WIN32: br i1 %[[IS_MOST_DERIVED_i1]] // - // WIN32: store {{.*}} @"\01??_8B@inalloca_virt@@7B@" + // WIN32: store {{.*}} @"??_8B@inalloca_virt@@7B@" // WIN32: %[[ARG2:.*]] = getelementptr {{.*}} %[[ARGMEM]] // WIN32: store i32 2, i32* %[[ARG2]] // WIN32: %[[ARG4:.*]] = getelementptr {{.*}} %[[ARGMEM]] // WIN32: store {{.*}}* %[[TMP]], {{.*}}** %[[ARG4]] - // WIN32: call {{.*}} @"\01??0A@inalloca_virt@@QAE@UQ@@H0$$QAU2@@Z"(%{{[^,]*}}, <{{.*}}>* inalloca %[[ARGMEM]]) + // WIN32: call {{.*}} @"??0A@inalloca_virt@@QAE@UQ@@H0$$QAU2@@Z"(%{{[^,]*}}, <{{.*}}>* inalloca %[[ARGMEM]]) // WIN32: call void @llvm.stackrestore( // WIN32: br // // Note that if we jumped directly to here we would fail to stackrestore and // destroy the parameters, but that's not actually possible. - // WIN32: call {{.*}} @"\01??0Z@@QAE@XZ"( - // WIN32: call {{.*}} @"\01??0Z@@QAE@XZ"( - // WIN32: call {{.*}} @"\01??_DQ@@QAEXXZ"( + // WIN32: call {{.*}} @"??0Z@@QAE@XZ"( + // WIN32: call {{.*}} @"??0Z@@QAE@XZ"( + // WIN32: call {{.*}} @"??1Q@@QAE@XZ"( // On Win64, the Q arguments would be destroyed in the callee. We don't yet // support that in the non-inlined case, so we force inlining. // WIN64: %[[TMP:.*]] = alloca // WIN64: %[[ARG3:.*]] = alloca // WIN64: %[[ARG1:.*]] = alloca - // WIN64: call {{.*}} @"\01??0Q@@QEAA@H@Z"({{.*}}* %[[TMP]], i32 4) - // WIN64: call {{.*}} @"\01??0Q@@QEAA@H@Z"({{.*}}* %[[ARG3]], i32 3) - // WIN64: call {{.*}} @"\01??0Q@@QEAA@H@Z"({{.*}}* %[[ARG1]], i32 1) + // WIN64: call {{.*}} @"??0Q@@QEAA@H@Z"({{.*}}* %[[TMP]], i32 4) + // WIN64: call {{.*}} @"??0Q@@QEAA@H@Z"({{.*}}* %[[ARG3]], i32 3) + // WIN64: call {{.*}} @"??0Q@@QEAA@H@Z"({{.*}}* %[[ARG1]], i32 1) // WIN64: br i1 - // WIN64: call {{.*}} @"\01??0A@inalloca_virt@@QEAA@UQ@@H0$$QEAU2@@Z"(%{{.*}}, %{{.*}}* %[[ARG1]], i32 2, %{{.*}}* %[[ARG3]], %{{.*}} %[[TMP]]) + // WIN64: call {{.*}} @"??0A@inalloca_virt@@QEAA@UQ@@H0$$QEAU2@@Z"(%{{.*}}, %{{.*}}* %[[ARG1]], i32 2, %{{.*}}* %[[ARG3]], %{{.*}} %[[TMP]]) // WIN64: br - // WIN64: call {{.*}} @"\01??0Z@@QEAA@XZ"( - // WIN64: call {{.*}} @"\01??0Z@@QEAA@XZ"( - // WIN64: call void @"\01??_DQ@@QEAAXXZ"({{.*}}* %[[TMP]]) + // WIN64: call {{.*}} @"??0Z@@QEAA@XZ"( + // WIN64: call {{.*}} @"??0Z@@QEAA@XZ"( + // WIN64: call void @"??1Q@@QEAA@XZ"({{.*}}* %[[TMP]]) struct C : B { using B::B; }; C c(1, 2, 3, 4); // ITANIUM-LABEL: define linkonce_odr void @_ZN13inalloca_virt1CD1Ev( - // MSABI-LABEL: define internal void @"\01??__Ec@inalloca_virt@@YAXXZ"( + // MSABI-LABEL: define internal void @"??__Ec@inalloca_virt@@YAXXZ"( // On Win32, the inalloca call can't be forwarded so we force inlining. // WIN32: %[[TMP:.*]] = alloca // WIN32: call i8* @llvm.stacksave() // WIN32: %[[ARGMEM:.*]] = alloca inalloca - // WIN32: call {{.*}} @"\01??0Q@@QAE@H@Z"(%{{.*}}* %[[TMP]], i32 4) + // WIN32: call {{.*}} @"??0Q@@QAE@H@Z"(%{{.*}}* %[[TMP]], i32 4) // WIN32: %[[ARG3:.*]] = getelementptr {{.*}} %[[ARGMEM]] - // WIN32: call {{.*}} @"\01??0Q@@QAE@H@Z"({{.*}}* %[[ARG3]], i32 3) + // WIN32: call {{.*}} @"??0Q@@QAE@H@Z"({{.*}}* %[[ARG3]], i32 3) // WIN32: %[[ARG1:.*]] = getelementptr {{.*}} %[[ARGMEM]] - // WIN32: call {{.*}} @"\01??0Q@@QAE@H@Z"({{.*}}* %[[ARG1]], i32 1) + // WIN32: call {{.*}} @"??0Q@@QAE@H@Z"({{.*}}* %[[ARG1]], i32 1) // WIN32: store i32 1, i32* %[[IS_MOST_DERIVED_ADDR:.*]] // WIN32: %[[IS_MOST_DERIVED:.*]] = load i32, i32* %[[IS_MOST_DERIVED_ADDR]] // WIN32: %[[IS_MOST_DERIVED_i1:.*]] = icmp ne i32 %[[IS_MOST_DERIVED]], 0 // WIN32: br i1 %[[IS_MOST_DERIVED_i1]] // - // WIN32: store {{.*}} @"\01??_8C@inalloca_virt@@7B@" + // WIN32: store {{.*}} @"??_8C@inalloca_virt@@7B@" // WIN32: %[[ARG2:.*]] = getelementptr {{.*}} %[[ARGMEM]] // WIN32: store i32 2, i32* %[[ARG2]] // WIN32: %[[ARG4:.*]] = getelementptr {{.*}} %[[ARGMEM]] // WIN32: store {{.*}}* %[[TMP]], {{.*}}** %[[ARG4]] - // WIN32: call {{.*}} @"\01??0A@inalloca_virt@@QAE@UQ@@H0$$QAU2@@Z"(%{{[^,]*}}, <{{.*}}>* inalloca %[[ARGMEM]]) + // WIN32: call {{.*}} @"??0A@inalloca_virt@@QAE@UQ@@H0$$QAU2@@Z"(%{{[^,]*}}, <{{.*}}>* inalloca %[[ARGMEM]]) // WIN32: call void @llvm.stackrestore( // WIN32: br // @@ -276,32 +276,32 @@ namespace inalloca_virt { // WIN32: br i1 %[[IS_MOST_DERIVED_i1]] // // Note: this block is unreachable. - // WIN32: store {{.*}} @"\01??_8B@inalloca_virt@@7B@" + // WIN32: store {{.*}} @"??_8B@inalloca_virt@@7B@" // WIN32: br // - // WIN32: call {{.*}} @"\01??0Z@@QAE@XZ"( - // WIN32: call {{.*}} @"\01??0Z@@QAE@XZ"( - // WIN32: call {{.*}} @"\01??_DQ@@QAEXXZ"( + // WIN32: call {{.*}} @"??0Z@@QAE@XZ"( + // WIN32: call {{.*}} @"??0Z@@QAE@XZ"( + // WIN32: call {{.*}} @"??1Q@@QAE@XZ"( // On Win64, the Q arguments would be destroyed in the callee. We don't yet // support that in the non-inlined case, so we force inlining. // WIN64: %[[TMP:.*]] = alloca // WIN64: %[[ARG3:.*]] = alloca // WIN64: %[[ARG1:.*]] = alloca - // WIN64: call {{.*}} @"\01??0Q@@QEAA@H@Z"({{.*}}* %[[TMP]], i32 4) - // WIN64: call {{.*}} @"\01??0Q@@QEAA@H@Z"({{.*}}* %[[ARG3]], i32 3) - // WIN64: call {{.*}} @"\01??0Q@@QEAA@H@Z"({{.*}}* %[[ARG1]], i32 1) + // WIN64: call {{.*}} @"??0Q@@QEAA@H@Z"({{.*}}* %[[TMP]], i32 4) + // WIN64: call {{.*}} @"??0Q@@QEAA@H@Z"({{.*}}* %[[ARG3]], i32 3) + // WIN64: call {{.*}} @"??0Q@@QEAA@H@Z"({{.*}}* %[[ARG1]], i32 1) // WIN64: br i1 - // WIN64: store {{.*}} @"\01??_8C@inalloca_virt@@7B@" - // WIN64: call {{.*}} @"\01??0A@inalloca_virt@@QEAA@UQ@@H0$$QEAU2@@Z"(%{{.*}}, %{{.*}}* %[[ARG1]], i32 2, %{{.*}}* %[[ARG3]], %{{.*}} %[[TMP]]) + // WIN64: store {{.*}} @"??_8C@inalloca_virt@@7B@" + // WIN64: call {{.*}} @"??0A@inalloca_virt@@QEAA@UQ@@H0$$QEAU2@@Z"(%{{.*}}, %{{.*}}* %[[ARG1]], i32 2, %{{.*}}* %[[ARG3]], %{{.*}} %[[TMP]]) // WIN64: br // WIN64: br i1 // (Unreachable block) - // WIN64: store {{.*}} @"\01??_8B@inalloca_virt@@7B@" + // WIN64: store {{.*}} @"??_8B@inalloca_virt@@7B@" // WIN64: br - // WIN64: call {{.*}} @"\01??0Z@@QEAA@XZ"( - // WIN64: call {{.*}} @"\01??0Z@@QEAA@XZ"( - // WIN64: call void @"\01??_DQ@@QEAAXXZ"({{.*}}* %[[TMP]]) + // WIN64: call {{.*}} @"??0Z@@QEAA@XZ"( + // WIN64: call {{.*}} @"??0Z@@QEAA@XZ"( + // WIN64: call void @"??1Q@@QEAA@XZ"({{.*}}* %[[TMP]]) } namespace inline_nonvirt { diff --git a/test/CodeGenCXX/initializer-list-ctor-order.cpp b/test/CodeGenCXX/initializer-list-ctor-order.cpp index 390fe4f5c3042..6bb9c1b07b73b 100644 --- a/test/CodeGenCXX/initializer-list-ctor-order.cpp +++ b/test/CodeGenCXX/initializer-list-ctor-order.cpp @@ -15,7 +15,7 @@ void foo() { A a{f(), g()}; } // CHECK-ITANIUM-LABEL: define void @_Z3foov -// CHECK-MS-LABEL: define void @"\01?foo@@YAXXZ" +// CHECK-MS-LABEL: define dso_local void @"?foo@@YAXXZ" // CHECK: call i32 @f() // CHECK: call i32 @g() @@ -24,6 +24,6 @@ struct B : A { }; B::B() : A{f(), g()} {} // CHECK-ITANIUM-LABEL: define void @_ZN1BC2Ev -// CHECK-MS-LABEL: define x86_thiscallcc %struct.B* @"\01??0B@@QAE@XZ" +// CHECK-MS-LABEL: define dso_local x86_thiscallcc %struct.B* @"??0B@@QAE@XZ" // CHECK: call i32 @f() // CHECK: call i32 @g() diff --git a/test/CodeGenCXX/inline-dllexport-member.cpp b/test/CodeGenCXX/inline-dllexport-member.cpp index a98f5601d3bcf..d6b004d66dc6c 100644 --- a/test/CodeGenCXX/inline-dllexport-member.cpp +++ b/test/CodeGenCXX/inline-dllexport-member.cpp @@ -1,13 +1,13 @@ // RUN: %clang_cc1 -triple i686-windows-win32 -fms-extensions -debug-info-kind=limited -emit-llvm %s -o - \ // RUN: | FileCheck %s -// CHECK: @"\01?ui@s@@2IB" = weak_odr dllexport constant i32 0, comdat, align 4, !dbg [[UI:![0-9]+]] +// CHECK: @"?ui@s@@2IB" = weak_odr dso_local dllexport constant i32 0, comdat, align 4, !dbg [[UI:![0-9]+]] struct __declspec(dllexport) s { static const unsigned int ui = 0; }; // CHECK: [[UI]] = !DIGlobalVariableExpression(var: [[UIV:.*]], expr: !DIExpression()) -// CHECK: [[UIV]] = distinct !DIGlobalVariable(name: "ui", linkageName: "\01?ui@s@@2IB", scope: ![[SCOPE:[0-9]+]], +// CHECK: [[UIV]] = distinct !DIGlobalVariable(name: "ui", linkageName: "?ui@s@@2IB", scope: ![[SCOPE:[0-9]+]], // CHECK: ![[SCOPE]] = distinct !DICompileUnit( diff --git a/test/CodeGenCXX/inline-functions.cpp b/test/CodeGenCXX/inline-functions.cpp index f1169f91913e4..95aec8b5d6844 100644 --- a/test/CodeGenCXX/inline-functions.cpp +++ b/test/CodeGenCXX/inline-functions.cpp @@ -7,7 +7,7 @@ struct A { }; // NORMAL-NOT: define void @_ZN1A1fEv -// MSVCCOMPAT-NOT: define void @"\01?f@A@@QEAAXXZ" +// MSVCCOMPAT-NOT: define void @"?f@A@@QEAAXXZ" void A::f() { } template<typename> struct B { }; @@ -17,20 +17,20 @@ template<> struct B<char> { }; // NORMAL-NOT: _ZN1BIcE1fEv -// MSVCCOMPAT-NOT: @"\01?f@?$B@D@@QEAAXXZ" +// MSVCCOMPAT-NOT: @"?f@?$B@D@@QEAAXXZ" void B<char>::f() { } // We need a final CHECK line here. // NORMAL-LABEL: define void @_Z1fv -// MSVCCOMPAT-LABEL: define void @"\01?f@@YAXXZ" +// MSVCCOMPAT-LABEL: define dso_local void @"?f@@YAXXZ" void f() { } // <rdar://problem/8740363> inline void f1(int); // NORMAL-LABEL: define linkonce_odr void @_Z2f1i -// MSVCCOMPAT-LABEL: define linkonce_odr void @"\01?f1@@YAXH@Z" +// MSVCCOMPAT-LABEL: define linkonce_odr dso_local void @"?f1@@YAXH@Z" void f1(int) { } void test_f1() { f1(17); } @@ -44,7 +44,7 @@ namespace test1 { }; // NORMAL-LABEL: define linkonce_odr void @_ZN5test11C4funcEv( - // MSVCCOMPAT-LABEL: define linkonce_odr void @"\01?func@C@test1@@QEAAXXZ"( + // MSVCCOMPAT-LABEL: define linkonce_odr dso_local void @"?func@C@test1@@QEAAXXZ"( class C { public: @@ -72,47 +72,47 @@ namespace test2 { f(a); } // NORMAL-LABEL: define linkonce_odr void @_ZN5test21fERKNS_1AE - // MSVCCOMPAT-LABEL: define linkonce_odr void @"\01?f@test2@@YAXAEBUA@1@@Z" + // MSVCCOMPAT-LABEL: define linkonce_odr dso_local void @"?f@test2@@YAXAEBUA@1@@Z" } // NORMAL-NOT: _Z17ExternAndInlineFnv -// MSVCCOMPAT-LABEL: define weak_odr void @"\01?ExternAndInlineFn@@YAXXZ" +// MSVCCOMPAT-LABEL: define weak_odr dso_local void @"?ExternAndInlineFn@@YAXXZ" extern inline void ExternAndInlineFn() {} // NORMAL-NOT: _Z18InlineThenExternFnv -// MSVCCOMPAT-LABEL: define weak_odr void @"\01?InlineThenExternFn@@YAXXZ" +// MSVCCOMPAT-LABEL: define weak_odr dso_local void @"?InlineThenExternFn@@YAXXZ" inline void InlineThenExternFn() {} extern void InlineThenExternFn(); // NORMAL-LABEL: define void @_Z18ExternThenInlineFnv -// MSVCCOMPAT-LABEL: define void @"\01?ExternThenInlineFn@@YAXXZ" +// MSVCCOMPAT-LABEL: define dso_local void @"?ExternThenInlineFn@@YAXXZ" extern void ExternThenInlineFn() {} // NORMAL-NOT: _Z25ExternThenInlineThenDefFnv -// MSVCCOMPAT-LABEL: define weak_odr void @"\01?ExternThenInlineThenDefFn@@YAXXZ" +// MSVCCOMPAT-LABEL: define weak_odr dso_local void @"?ExternThenInlineThenDefFn@@YAXXZ" extern void ExternThenInlineThenDefFn(); inline void ExternThenInlineThenDefFn(); void ExternThenInlineThenDefFn() {} // NORMAL-NOT: _Z25InlineThenExternThenDefFnv -// MSVCCOMPAT-LABEL: define weak_odr void @"\01?InlineThenExternThenDefFn@@YAXXZ" +// MSVCCOMPAT-LABEL: define weak_odr dso_local void @"?InlineThenExternThenDefFn@@YAXXZ" inline void InlineThenExternThenDefFn(); extern void InlineThenExternThenDefFn(); void InlineThenExternThenDefFn() {} // NORMAL-NOT: _Z17ExternAndConstexprFnv -// MSVCCOMPAT-LABEL: define weak_odr i32 @"\01?ExternAndConstexprFn@@YAHXZ" +// MSVCCOMPAT-LABEL: define weak_odr dso_local i32 @"?ExternAndConstexprFn@@YAHXZ" extern constexpr int ExternAndConstexprFn() { return 0; } // NORMAL-NOT: _Z11ConstexprFnv -// MSVCCOMPAT-NOT: @"\01?ConstexprFn@@YAHXZ" +// MSVCCOMPAT-NOT: @"?ConstexprFn@@YAHXZ" constexpr int ConstexprFn() { return 0; } template <typename T> extern inline void ExternInlineOnPrimaryTemplate(T); // NORMAL-LABEL: define void @_Z29ExternInlineOnPrimaryTemplateIiEvT_ -// MSVCCOMPAT-LABEL: define void @"\01??$ExternInlineOnPrimaryTemplate@H@@YAXH@Z" +// MSVCCOMPAT-LABEL: define dso_local void @"??$ExternInlineOnPrimaryTemplate@H@@YAXH@Z" template <> void ExternInlineOnPrimaryTemplate(int) {} @@ -120,16 +120,16 @@ template <typename T> extern inline void ExternInlineOnPrimaryTemplateAndSpecialization(T); // NORMAL-NOT: _Z46ExternInlineOnPrimaryTemplateAndSpecializationIiEvT_ -// MSVCCOMPAT-LABEL: define weak_odr void @"\01??$ExternInlineOnPrimaryTemplateAndSpecialization@H@@YAXH@Z" +// MSVCCOMPAT-LABEL: define weak_odr dso_local void @"??$ExternInlineOnPrimaryTemplateAndSpecialization@H@@YAXH@Z" template <> extern inline void ExternInlineOnPrimaryTemplateAndSpecialization(int) {} struct TypeWithInlineMethods { // NORMAL-NOT: _ZN21TypeWithInlineMethods9StaticFunEv - // MSVCCOMPAT-NOT: @"\01?StaticFun@TypeWithInlineMethods@@SAXXZ" + // MSVCCOMPAT-NOT: @"?StaticFun@TypeWithInlineMethods@@SAXXZ" static void StaticFun() {} // NORMAL-NOT: _ZN21TypeWithInlineMethods12NonStaticFunEv - // MSVCCOMPAT-NOT: @"\01?NonStaticFun@TypeWithInlineMethods@@QEAAXXZ" + // MSVCCOMPAT-NOT: @"?NonStaticFun@TypeWithInlineMethods@@QEAAXXZ" void NonStaticFun() { StaticFun(); } }; @@ -146,5 +146,5 @@ struct S { __attribute__((used)) inline S<int> Foo() { return S<int>(); } // NORMAL-LABEL: define linkonce_odr void @_ZN7PR229593FooEv( -// MSVCCOMPAT-LABEL: define linkonce_odr i8 @"\01?Foo@PR22959@@YA?AU?$S@H@1@XZ"( +// MSVCCOMPAT-LABEL: define linkonce_odr dso_local i8 @"?Foo@PR22959@@YA?AU?$S@H@1@XZ"( } diff --git a/test/CodeGenCXX/inline-hint.cpp b/test/CodeGenCXX/inline-hint.cpp index c4de751ba76e7..e8c067dec1748 100644 --- a/test/CodeGenCXX/inline-hint.cpp +++ b/test/CodeGenCXX/inline-hint.cpp @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 %s -std=c++11 -triple=x86_64-linux -O2 -finline-functions -emit-llvm -disable-llvm-passes -o - | FileCheck %s --check-prefix=CHECK --check-prefix=SUITABLE -// RUN: %clang_cc1 %s -std=c++11 -triple=x86_64-linux -O2 -finline-hint-functions -emit-llvm -disable-llvm-passes -o - | FileCheck %s --check-prefix=CHECK --check-prefix=HINTED -// RUN: %clang_cc1 %s -std=c++11 -triple=x86_64-linux -O2 -fno-inline -emit-llvm -disable-llvm-passes -o - | FileCheck %s --check-prefix=CHECK --check-prefix=NOINLINE +// RUN: %clang_cc1 %s -std=c++11 -triple=x86_64-linux -O2 -finline-functions -emit-llvm -disable-llvm-passes -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK --check-prefix=SUITABLE +// RUN: %clang_cc1 %s -std=c++11 -triple=x86_64-linux -O2 -finline-hint-functions -emit-llvm -disable-llvm-passes -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK --check-prefix=HINTED +// RUN: %clang_cc1 %s -std=c++11 -triple=x86_64-linux -O2 -fno-inline -emit-llvm -disable-llvm-passes -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK --check-prefix=NOINLINE // Force non-trivial implicit constructors/destructors/operators for B by having explicit ones for A struct A { diff --git a/test/CodeGenCXX/internal-linkage.cpp b/test/CodeGenCXX/internal-linkage.cpp index 77b16704dd173..f3c0ad18459f6 100644 --- a/test/CodeGenCXX/internal-linkage.cpp +++ b/test/CodeGenCXX/internal-linkage.cpp @@ -51,7 +51,7 @@ extern char const * extern_nonconst_xyzzy; char const * *test4() { - // CHECK: @extern_nonconst_xyzzy = global + // CHECK: @extern_nonconst_xyzzy = {{(dso_local )?}}global return &extern_nonconst_xyzzy; } diff --git a/test/CodeGenCXX/invariant.group-for-vptrs.cpp b/test/CodeGenCXX/invariant.group-for-vptrs.cpp index 45671e5a2c2ab..d4f80dde90cdc 100644 --- a/test/CodeGenCXX/invariant.group-for-vptrs.cpp +++ b/test/CodeGenCXX/invariant.group-for-vptrs.cpp @@ -56,7 +56,7 @@ void testInternallyVisible(bool p) { // Checking D::D() // CHECK-LABEL: define linkonce_odr void @_ZN1DC2Ev( -// CHECK: = call i8* @llvm.invariant.group.barrier.p0i8(i8* +// CHECK: = call i8* @llvm.launder.invariant.group.p0i8(i8* // CHECK: call void @_ZN1AC2Ev(%struct.A* // CHECK: store {{.*}} !invariant.group ![[MD]] diff --git a/test/CodeGenCXX/lambda-expressions-inside-auto-functions.cpp b/test/CodeGenCXX/lambda-expressions-inside-auto-functions.cpp index 0083f0826ecc3..59acba7be26e0 100644 --- a/test/CodeGenCXX/lambda-expressions-inside-auto-functions.cpp +++ b/test/CodeGenCXX/lambda-expressions-inside-auto-functions.cpp @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10.0.0 -fblocks -emit-llvm -o - %s -fexceptions -std=c++1y | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10.0.0 -fblocks -emit-llvm -o - %s -fexceptions -std=c++1y | FileCheck --check-prefix CHECK_ABI_LATEST %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10.0.0 -fblocks -emit-llvm -o - %s -fexceptions -std=c++1y -fclang-abi-compat=6.0 | FileCheck --check-prefix CHECK_ABIV6 %s // CHECK-LABEL: define void @_ZN19non_inline_function3fooEv // CHECK-LABEL: define internal void @"_ZZN19non_inline_function3fooEvENK3$_0clEi"(%class.anon @@ -52,10 +53,12 @@ struct A { template<class T> auto foo() { return [](const T&) { return 42; }; } }; -//CHECK-LABEL: define linkonce_odr i32 @_ZZN22inline_member_function1AIdE14default_lambdaIdEEDavENKUlRKdE_clES5_(%class.anon +//CHECK_ABIV6: define linkonce_odr i32 @_ZZN22inline_member_function1AIdE14default_lambdaIdEEDavENKUlRKdE_clES5_(%class.anon +//CHECK_ABI_LATEST: define linkonce_odr i32 @_ZZN22inline_member_function1AIdE14default_lambdaIdEEDavENKUlRKdE_clES4_(%class.anon int run2 = A<double>{}.func()(3.14); -//CHECK-LABEL: define linkonce_odr i32 @_ZZN22inline_member_function1AIcE14default_lambdaIcEEDavENKUlRKcE_clES5_(%class.anon +//CHECK_ABIV6: define linkonce_odr i32 @_ZZN22inline_member_function1AIcE14default_lambdaIcEEDavENKUlRKcE_clES5_(%class.anon +//CHECK_ABI_LATEST: define linkonce_odr i32 @_ZZN22inline_member_function1AIcE14default_lambdaIcEEDavENKUlRKcE_clES4_(%class.anon int run3 = A<char>{}.func()('a'); } // end inline_member_function diff --git a/test/CodeGenCXX/lambda-to-function-pointer-conversion.cpp b/test/CodeGenCXX/lambda-to-function-pointer-conversion.cpp new file mode 100644 index 0000000000000..87d21a3461d22 --- /dev/null +++ b/test/CodeGenCXX/lambda-to-function-pointer-conversion.cpp @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc19.0.0 -std=c++11 -emit-llvm -o - %s | FileCheck %s + +// This code used to cause an assertion failure in EmitDelegateCallArg. + +// CHECK: define internal void @"?__invoke@<lambda_0>@?0??test@@YAXXZ@CA@UTrivial@@@Z"( +// CHECK: call void @"??R<lambda_0>@?0??test@@YAXXZ@QEBA@UTrivial@@@Z"( + +// CHECK: define internal void @"??R<lambda_0>@?0??test@@YAXXZ@QEBA@UTrivial@@@Z"( + +struct Trivial { + int x; +}; + +void (*fnptr)(Trivial); + +void test() { + fnptr = [](Trivial a){ (void)a; }; +} diff --git a/test/CodeGenCXX/linetable-eh.cpp b/test/CodeGenCXX/linetable-eh.cpp index 8c0a3971c5993..b31df54f7c456 100644 --- a/test/CodeGenCXX/linetable-eh.cpp +++ b/test/CodeGenCXX/linetable-eh.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -triple x86_64-apple-macosx10.9.0 -munwind-tables -std=c++11 -fcxx-exceptions -fexceptions %s -o - | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -triple x86_64-apple-macosx10.9.0 -munwind-tables -std=c++11 -fcxx-exceptions -fexceptions %s -o - | FileCheck -allow-deprecated-dag-overlap %s // Test that emitting a landing pad does not affect the line table // entries for the code that triggered it. diff --git a/test/CodeGenCXX/mangle-abi-tag.cpp b/test/CodeGenCXX/mangle-abi-tag.cpp index a653ff42228a5..5d84096d24cd8 100644 --- a/test/CodeGenCXX/mangle-abi-tag.cpp +++ b/test/CodeGenCXX/mangle-abi-tag.cpp @@ -145,7 +145,7 @@ void f13_test() { f13(); } // f13()::L::foo[abi:C][abi:D]() -// CHECK-DAG: define linkonce_odr %struct.E* @_ZZ3f13vEN1L3fooB1CB1DEv( +// CHECK-DAG: define linkonce_odr {{(dso_local )?}}%struct.E* @_ZZ3f13vEN1L3fooB1CB1DEv( // f13()::L::foo[abi:C][abi:D]()::a[abi:A][abi:B] // CHECK-DAG: @_ZZZ3f13vEN1L3fooB1CB1DEvE1aB1AB1B = @@ -218,7 +218,7 @@ namespace N19 { void f19_test(N19::C<N19::A, &N19::foo>, N19::F, N19::D) { } // f19_test(N19::C<N19::A, &N19::foo[abi:B]>, N19::F, N19::D) -// CHECK-DAG: define void @_Z8f19_testN3N191CINS_1AEXadL_ZNS_3fooB1BES1_NS_1DEEEEENS_1FES2_( +// CHECK-DAG: define {{(dso_local )?}}void @_Z8f19_testN3N191CINS_1AEXadL_ZNS_3fooB1BES1_NS_1DEEEEENS_1FES2_( namespace pr30440 { diff --git a/test/CodeGenCXX/mangle-mingw.cpp b/test/CodeGenCXX/mangle-mingw.cpp new file mode 100644 index 0000000000000..90a9826455d4d --- /dev/null +++ b/test/CodeGenCXX/mangle-mingw.cpp @@ -0,0 +1,19 @@ +// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-w64-mingw32 | FileCheck %s + +int func() { return 0; } +// CHECK-DAG: @_Z4funcv + +int main() { return 0; } +// CHECK-DAG: @main + +int wmain() { return 0; } +// CHECK-DAG: @wmain + +int WinMain() { return 0; } +// CHECK-DAG: @WinMain + +int wWinMain() { return 0; } +// CHECK-DAG: @wWinMain + +int DllMain() { return 0; } +// CHECK-DAG: @DllMain diff --git a/test/CodeGenCXX/mangle-ms-abi-examples.cpp b/test/CodeGenCXX/mangle-ms-abi-examples.cpp index 6b6ad89b43441..2f8490ac35a81 100644 --- a/test/CodeGenCXX/mangle-ms-abi-examples.cpp +++ b/test/CodeGenCXX/mangle-ms-abi-examples.cpp @@ -1,10 +1,10 @@ // RUN: %clang_cc1 -fms-extensions -fno-rtti -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=19.00 | FileCheck %s --check-prefix=CHECK --check-prefix=MSVC2015 // RUN: %clang_cc1 -fms-extensions -fno-rtti -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=18.00 | FileCheck %s --check-prefix=CHECK --check-prefix=MSVC2013 -// CHECK: @"\01??_7B@?1??foo@A@@QAEXH@Z@6B@" = -// CHECK: @"\01??_7D@C@?1??foo@@YAXXZ@6B@" = -// MSVC2013: define {{.*}} @"\01?baz@E@?3??bar@C@?1??foo@@YAXXZ@QAEXXZ@QAEXXZ"( -// MSVC2015: define {{.*}} @"\01?baz@E@?1??bar@C@?1??foo@@YAXXZ@QAEXXZ@QAEXXZ"( +// CHECK: @"??_7B@?1??foo@A@@QAEXH@Z@6B@" = +// CHECK: @"??_7D@C@?1??foo@@YAXXZ@6B@" = +// MSVC2013: define {{.*}} @"?baz@E@?3??bar@C@?1??foo@@YAXXZ@QAEXXZ@QAEXXZ"( +// MSVC2015: define {{.*}} @"?baz@E@?1??bar@C@?1??foo@@YAXXZ@QAEXXZ@QAEXXZ"( // Microsoft Visual C++ ABI examples. struct A { diff --git a/test/CodeGenCXX/mangle-ms-arg-qualifiers.cpp b/test/CodeGenCXX/mangle-ms-arg-qualifiers.cpp index ad0299ea5c12f..23582c6c0316d 100644 --- a/test/CodeGenCXX/mangle-ms-arg-qualifiers.cpp +++ b/test/CodeGenCXX/mangle-ms-arg-qualifiers.cpp @@ -2,268 +2,268 @@ // RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-pc-win32 | FileCheck -check-prefix=X64 %s void foo(const unsigned int) {} -// CHECK: "\01?foo@@YAXI@Z" -// X64: "\01?foo@@YAXI@Z" +// CHECK: "?foo@@YAXI@Z" +// X64: "?foo@@YAXI@Z" void foo(const double) {} -// CHECK: "\01?foo@@YAXN@Z" -// X64: "\01?foo@@YAXN@Z" +// CHECK: "?foo@@YAXN@Z" +// X64: "?foo@@YAXN@Z" void bar(const volatile double) {} -// CHECK: "\01?bar@@YAXN@Z" -// X64: "\01?bar@@YAXN@Z" +// CHECK: "?bar@@YAXN@Z" +// X64: "?bar@@YAXN@Z" void foo_pad(char * x) {} -// CHECK: "\01?foo_pad@@YAXPAD@Z" -// X64: "\01?foo_pad@@YAXPEAD@Z" +// CHECK: "?foo_pad@@YAXPAD@Z" +// X64: "?foo_pad@@YAXPEAD@Z" void foo_pbd(const char * x) {} -// CHECK: "\01?foo_pbd@@YAXPBD@Z" -// X64: "\01?foo_pbd@@YAXPEBD@Z" +// CHECK: "?foo_pbd@@YAXPBD@Z" +// X64: "?foo_pbd@@YAXPEBD@Z" void foo_pcd(volatile char * x) {} -// CHECK: "\01?foo_pcd@@YAXPCD@Z" -// X64: "\01?foo_pcd@@YAXPECD@Z" +// CHECK: "?foo_pcd@@YAXPCD@Z" +// X64: "?foo_pcd@@YAXPECD@Z" void foo_qad(char * const x) {} -// CHECK: "\01?foo_qad@@YAXQAD@Z" -// X64: "\01?foo_qad@@YAXQEAD@Z" +// CHECK: "?foo_qad@@YAXQAD@Z" +// X64: "?foo_qad@@YAXQEAD@Z" void foo_rad(char * volatile x) {} -// CHECK: "\01?foo_rad@@YAXRAD@Z" -// X64: "\01?foo_rad@@YAXREAD@Z" +// CHECK: "?foo_rad@@YAXRAD@Z" +// X64: "?foo_rad@@YAXREAD@Z" void foo_sad(char * const volatile x) {} -// CHECK: "\01?foo_sad@@YAXSAD@Z" -// X64: "\01?foo_sad@@YAXSEAD@Z" +// CHECK: "?foo_sad@@YAXSAD@Z" +// X64: "?foo_sad@@YAXSEAD@Z" void foo_piad(char * __restrict x) {} -// CHECK: "\01?foo_piad@@YAXPIAD@Z" -// X64: "\01?foo_piad@@YAXPEIAD@Z" +// CHECK: "?foo_piad@@YAXPIAD@Z" +// X64: "?foo_piad@@YAXPEIAD@Z" void foo_qiad(char * const __restrict x) {} -// CHECK: "\01?foo_qiad@@YAXQIAD@Z" -// X64: "\01?foo_qiad@@YAXQEIAD@Z" +// CHECK: "?foo_qiad@@YAXQIAD@Z" +// X64: "?foo_qiad@@YAXQEIAD@Z" void foo_riad(char * volatile __restrict x) {} -// CHECK: "\01?foo_riad@@YAXRIAD@Z" -// X64: "\01?foo_riad@@YAXREIAD@Z" +// CHECK: "?foo_riad@@YAXRIAD@Z" +// X64: "?foo_riad@@YAXREIAD@Z" void foo_siad(char * const volatile __restrict x) {} -// CHECK: "\01?foo_siad@@YAXSIAD@Z" -// X64: "\01?foo_siad@@YAXSEIAD@Z" +// CHECK: "?foo_siad@@YAXSIAD@Z" +// X64: "?foo_siad@@YAXSEIAD@Z" void foo_papad(char ** x) {} -// CHECK: "\01?foo_papad@@YAXPAPAD@Z" -// X64: "\01?foo_papad@@YAXPEAPEAD@Z" +// CHECK: "?foo_papad@@YAXPAPAD@Z" +// X64: "?foo_papad@@YAXPEAPEAD@Z" void foo_papbd(char const ** x) {} -// CHECK: "\01?foo_papbd@@YAXPAPBD@Z" -// X64: "\01?foo_papbd@@YAXPEAPEBD@Z" +// CHECK: "?foo_papbd@@YAXPAPBD@Z" +// X64: "?foo_papbd@@YAXPEAPEBD@Z" void foo_papcd(char volatile ** x) {} -// CHECK: "\01?foo_papcd@@YAXPAPCD@Z" -// X64: "\01?foo_papcd@@YAXPEAPECD@Z" +// CHECK: "?foo_papcd@@YAXPAPCD@Z" +// X64: "?foo_papcd@@YAXPEAPECD@Z" void foo_pbqad(char * const* x) {} -// CHECK: "\01?foo_pbqad@@YAXPBQAD@Z" -// X64: "\01?foo_pbqad@@YAXPEBQEAD@Z" +// CHECK: "?foo_pbqad@@YAXPBQAD@Z" +// X64: "?foo_pbqad@@YAXPEBQEAD@Z" void foo_pcrad(char * volatile* x) {} -// CHECK: "\01?foo_pcrad@@YAXPCRAD@Z" -// X64: "\01?foo_pcrad@@YAXPECREAD@Z" +// CHECK: "?foo_pcrad@@YAXPCRAD@Z" +// X64: "?foo_pcrad@@YAXPECREAD@Z" void foo_qapad(char ** const x) {} -// CHECK: "\01?foo_qapad@@YAXQAPAD@Z" -// X64: "\01?foo_qapad@@YAXQEAPEAD@Z" +// CHECK: "?foo_qapad@@YAXQAPAD@Z" +// X64: "?foo_qapad@@YAXQEAPEAD@Z" void foo_rapad(char ** volatile x) {} -// CHECK: "\01?foo_rapad@@YAXRAPAD@Z" -// X64: "\01?foo_rapad@@YAXREAPEAD@Z" +// CHECK: "?foo_rapad@@YAXRAPAD@Z" +// X64: "?foo_rapad@@YAXREAPEAD@Z" void foo_pbqbd(const char * const* x) {} -// CHECK: "\01?foo_pbqbd@@YAXPBQBD@Z" -// X64: "\01?foo_pbqbd@@YAXPEBQEBD@Z" +// CHECK: "?foo_pbqbd@@YAXPBQBD@Z" +// X64: "?foo_pbqbd@@YAXPEBQEBD@Z" void foo_pbqcd(volatile char * const* x) {} -// CHECK: "\01?foo_pbqcd@@YAXPBQCD@Z" -// X64: "\01?foo_pbqcd@@YAXPEBQECD@Z" +// CHECK: "?foo_pbqcd@@YAXPBQCD@Z" +// X64: "?foo_pbqcd@@YAXPEBQECD@Z" void foo_pcrbd(const char * volatile* x) {} -// CHECK: "\01?foo_pcrbd@@YAXPCRBD@Z" -// X64: "\01?foo_pcrbd@@YAXPECREBD@Z" +// CHECK: "?foo_pcrbd@@YAXPCRBD@Z" +// X64: "?foo_pcrbd@@YAXPECREBD@Z" void foo_pcrcd(volatile char * volatile* x) {} -// CHECK: "\01?foo_pcrcd@@YAXPCRCD@Z" -// X64: "\01?foo_pcrcd@@YAXPECRECD@Z" +// CHECK: "?foo_pcrcd@@YAXPCRCD@Z" +// X64: "?foo_pcrcd@@YAXPECRECD@Z" void foo_aad(char &x) {} -// CHECK: "\01?foo_aad@@YAXAAD@Z" -// X64: "\01?foo_aad@@YAXAEAD@Z" +// CHECK: "?foo_aad@@YAXAAD@Z" +// X64: "?foo_aad@@YAXAEAD@Z" void foo_abd(const char &x) {} -// CHECK: "\01?foo_abd@@YAXABD@Z" -// X64: "\01?foo_abd@@YAXAEBD@Z" +// CHECK: "?foo_abd@@YAXABD@Z" +// X64: "?foo_abd@@YAXAEBD@Z" void foo_aapad(char *&x) {} -// CHECK: "\01?foo_aapad@@YAXAAPAD@Z" -// X64: "\01?foo_aapad@@YAXAEAPEAD@Z" +// CHECK: "?foo_aapad@@YAXAAPAD@Z" +// X64: "?foo_aapad@@YAXAEAPEAD@Z" void foo_aapbd(const char *&x) {} -// CHECK: "\01?foo_aapbd@@YAXAAPBD@Z" -// X64: "\01?foo_aapbd@@YAXAEAPEBD@Z" +// CHECK: "?foo_aapbd@@YAXAAPBD@Z" +// X64: "?foo_aapbd@@YAXAEAPEBD@Z" void foo_abqad(char * const &x) {} -// CHECK: "\01?foo_abqad@@YAXABQAD@Z" -// X64: "\01?foo_abqad@@YAXAEBQEAD@Z" +// CHECK: "?foo_abqad@@YAXABQAD@Z" +// X64: "?foo_abqad@@YAXAEBQEAD@Z" void foo_abqbd(const char * const &x) {} -// CHECK: "\01?foo_abqbd@@YAXABQBD@Z" -// X64: "\01?foo_abqbd@@YAXAEBQEBD@Z" +// CHECK: "?foo_abqbd@@YAXABQBD@Z" +// X64: "?foo_abqbd@@YAXAEBQEBD@Z" void foo_aay144h(int (&x)[5][5]) {} -// CHECK: "\01?foo_aay144h@@YAXAAY144H@Z" -// X64: "\01?foo_aay144h@@YAXAEAY144H@Z" +// CHECK: "?foo_aay144h@@YAXAAY144H@Z" +// X64: "?foo_aay144h@@YAXAEAY144H@Z" void foo_aay144cbh(const int (&x)[5][5]) {} -// CHECK: "\01?foo_aay144cbh@@YAXAAY144$$CBH@Z" -// X64: "\01?foo_aay144cbh@@YAXAEAY144$$CBH@Z" +// CHECK: "?foo_aay144cbh@@YAXAAY144$$CBH@Z" +// X64: "?foo_aay144cbh@@YAXAEAY144$$CBH@Z" void foo_qay144h(int (&&x)[5][5]) {} -// CHECK: "\01?foo_qay144h@@YAX$$QAY144H@Z" -// X64: "\01?foo_qay144h@@YAX$$QEAY144H@Z" +// CHECK: "?foo_qay144h@@YAX$$QAY144H@Z" +// X64: "?foo_qay144h@@YAX$$QEAY144H@Z" void foo_qay144cbh(const int (&&x)[5][5]) {} -// CHECK: "\01?foo_qay144cbh@@YAX$$QAY144$$CBH@Z" -// X64: "\01?foo_qay144cbh@@YAX$$QEAY144$$CBH@Z" +// CHECK: "?foo_qay144cbh@@YAX$$QAY144$$CBH@Z" +// X64: "?foo_qay144cbh@@YAX$$QEAY144$$CBH@Z" void foo_p6ahxz(int x()) {} -// CHECK: "\01?foo_p6ahxz@@YAXP6AHXZ@Z" -// X64: "\01?foo_p6ahxz@@YAXP6AHXZ@Z" +// CHECK: "?foo_p6ahxz@@YAXP6AHXZ@Z" +// X64: "?foo_p6ahxz@@YAXP6AHXZ@Z" void foo_a6ahxz(int (&x)()) {} -// CHECK: "\01?foo_a6ahxz@@YAXA6AHXZ@Z" -// X64: "\01?foo_a6ahxz@@YAXA6AHXZ@Z" +// CHECK: "?foo_a6ahxz@@YAXA6AHXZ@Z" +// X64: "?foo_a6ahxz@@YAXA6AHXZ@Z" void foo_q6ahxz(int (&&x)()) {} -// CHECK: "\01?foo_q6ahxz@@YAX$$Q6AHXZ@Z" -// X64: "\01?foo_q6ahxz@@YAX$$Q6AHXZ@Z" +// CHECK: "?foo_q6ahxz@@YAX$$Q6AHXZ@Z" +// X64: "?foo_q6ahxz@@YAX$$Q6AHXZ@Z" void foo_qay04h(int x[5][5]) {} -// CHECK: "\01?foo_qay04h@@YAXQAY04H@Z" -// X64: "\01?foo_qay04h@@YAXQEAY04H@Z" +// CHECK: "?foo_qay04h@@YAXQAY04H@Z" +// X64: "?foo_qay04h@@YAXQEAY04H@Z" void foo_qay04cbh(const int x[5][5]) {} -// CHECK: "\01?foo_qay04cbh@@YAXQAY04$$CBH@Z" -// X64: "\01?foo_qay04cbh@@YAXQEAY04$$CBH@Z" +// CHECK: "?foo_qay04cbh@@YAXQAY04$$CBH@Z" +// X64: "?foo_qay04cbh@@YAXQEAY04$$CBH@Z" typedef double Vector[3]; void foo(Vector*) {} -// CHECK: "\01?foo@@YAXPAY02N@Z" -// X64: "\01?foo@@YAXPEAY02N@Z" +// CHECK: "?foo@@YAXPAY02N@Z" +// X64: "?foo@@YAXPEAY02N@Z" void foo(Vector) {} -// CHECK: "\01?foo@@YAXQAN@Z" -// X64: "\01?foo@@YAXQEAN@Z" +// CHECK: "?foo@@YAXQAN@Z" +// X64: "?foo@@YAXQEAN@Z" void foo_const(const Vector) {} -// CHECK: "\01?foo_const@@YAXQBN@Z" -// X64: "\01?foo_const@@YAXQEBN@Z" +// CHECK: "?foo_const@@YAXQBN@Z" +// X64: "?foo_const@@YAXQEBN@Z" void foo_volatile(volatile Vector) {} -// CHECK: "\01?foo_volatile@@YAXQCN@Z" -// X64: "\01?foo_volatile@@YAXQECN@Z" +// CHECK: "?foo_volatile@@YAXQCN@Z" +// X64: "?foo_volatile@@YAXQECN@Z" void foo(Vector*, const Vector, const double) {} -// CHECK: "\01?foo@@YAXPAY02NQBNN@Z" -// X64: "\01?foo@@YAXPEAY02NQEBNN@Z" +// CHECK: "?foo@@YAXPAY02NQBNN@Z" +// X64: "?foo@@YAXPEAY02NQEBNN@Z" typedef void (*ConstFunPtr)(int *const d); void foo_fnptrconst(ConstFunPtr f) { } -// CHECK: "\01?foo_fnptrconst@@YAXP6AXQAH@Z@Z" -// X64: "\01?foo_fnptrconst@@YAXP6AXQEAH@Z@Z" +// CHECK: "?foo_fnptrconst@@YAXP6AXQAH@Z@Z" +// X64: "?foo_fnptrconst@@YAXP6AXQEAH@Z@Z" typedef void (*ArrayFunPtr)(int d[1]); void foo_fnptrarray(ArrayFunPtr f) { } -// CHECK: "\01?foo_fnptrarray@@YAXP6AXQAH@Z@Z" -// X64: "\01?foo_fnptrarray@@YAXP6AXQEAH@Z@Z" +// CHECK: "?foo_fnptrarray@@YAXP6AXQAH@Z@Z" +// X64: "?foo_fnptrarray@@YAXP6AXQEAH@Z@Z" void foo_fnptrbackref1(ArrayFunPtr f1, ArrayFunPtr f2) { } -// CHECK: "\01?foo_fnptrbackref1@@YAXP6AXQAH@Z1@Z" -// X64: "\01?foo_fnptrbackref1@@YAXP6AXQEAH@Z1@Z" +// CHECK: "?foo_fnptrbackref1@@YAXP6AXQAH@Z1@Z" +// X64: "?foo_fnptrbackref1@@YAXP6AXQEAH@Z1@Z" void foo_fnptrbackref2(ArrayFunPtr f1, ConstFunPtr f2) { } -// CHECK: "\01?foo_fnptrbackref2@@YAXP6AXQAH@Z1@Z" -// X64: "\01?foo_fnptrbackref2@@YAXP6AXQEAH@Z1@Z" +// CHECK: "?foo_fnptrbackref2@@YAXP6AXQAH@Z1@Z" +// X64: "?foo_fnptrbackref2@@YAXP6AXQEAH@Z1@Z" typedef void (*NormalFunPtr)(int *d); void foo_fnptrbackref3(ArrayFunPtr f1, NormalFunPtr f2) { } -// CHECK: "\01?foo_fnptrbackref3@@YAXP6AXQAH@Z1@Z" -// X64: "\01?foo_fnptrbackref3@@YAXP6AXQEAH@Z1@Z" +// CHECK: "?foo_fnptrbackref3@@YAXP6AXQAH@Z1@Z" +// X64: "?foo_fnptrbackref3@@YAXP6AXQEAH@Z1@Z" void foo_fnptrbackref4(NormalFunPtr f1, ArrayFunPtr f2) { } -// CHECK: "\01?foo_fnptrbackref4@@YAXP6AXPAH@Z1@Z" -// X64: "\01?foo_fnptrbackref4@@YAXP6AXPEAH@Z1@Z" +// CHECK: "?foo_fnptrbackref4@@YAXP6AXPAH@Z1@Z" +// X64: "?foo_fnptrbackref4@@YAXP6AXPEAH@Z1@Z" ArrayFunPtr ret_fnptrarray() { return 0; } -// CHECK: "\01?ret_fnptrarray@@YAP6AXQAH@ZXZ" -// X64: "\01?ret_fnptrarray@@YAP6AXQEAH@ZXZ" +// CHECK: "?ret_fnptrarray@@YAP6AXQAH@ZXZ" +// X64: "?ret_fnptrarray@@YAP6AXQEAH@ZXZ" // Test that we mangle the forward decl when we have a redeclaration with a // slightly different type. void mangle_fwd(char * const x); void mangle_fwd(char * x) {} -// CHECK: "\01?mangle_fwd@@YAXQAD@Z" -// X64: "\01?mangle_fwd@@YAXQEAD@Z" +// CHECK: "?mangle_fwd@@YAXQAD@Z" +// X64: "?mangle_fwd@@YAXQEAD@Z" void mangle_no_fwd(char * x) {} -// CHECK: "\01?mangle_no_fwd@@YAXPAD@Z" -// X64: "\01?mangle_no_fwd@@YAXPEAD@Z" +// CHECK: "?mangle_no_fwd@@YAXPAD@Z" +// X64: "?mangle_no_fwd@@YAXPEAD@Z" // The first argument gets mangled as-if it were written "int *const" // The second arg should not form a backref because it isn't qualified void mangle_no_backref0(int[], int *) {} -// CHECK: "\01?mangle_no_backref0@@YAXQAHPAH@Z" -// X64: "\01?mangle_no_backref0@@YAXQEAHPEAH@Z" +// CHECK: "?mangle_no_backref0@@YAXQAHPAH@Z" +// X64: "?mangle_no_backref0@@YAXQEAHPEAH@Z" void mangle_no_backref1(int[], int *const) {} -// CHECK: "\01?mangle_no_backref1@@YAXQAHQAH@Z" -// X64: "\01?mangle_no_backref1@@YAXQEAHQEAH@Z" +// CHECK: "?mangle_no_backref1@@YAXQAHQAH@Z" +// X64: "?mangle_no_backref1@@YAXQEAHQEAH@Z" typedef void fun_type(void); typedef void (*ptr_to_fun_type)(void); // Pointer to function types don't backref with function types void mangle_no_backref2(fun_type, ptr_to_fun_type) {} -// CHECK: "\01?mangle_no_backref2@@YAXP6AXXZP6AXXZ@Z" -// X64: "\01?mangle_no_backref2@@YAXP6AXXZP6AXXZ@Z" +// CHECK: "?mangle_no_backref2@@YAXP6AXXZP6AXXZ@Z" +// X64: "?mangle_no_backref2@@YAXP6AXXZP6AXXZ@Z" void mangle_yes_backref0(int[], int []) {} -// CHECK: "\01?mangle_yes_backref0@@YAXQAH0@Z" -// X64: "\01?mangle_yes_backref0@@YAXQEAH0@Z" +// CHECK: "?mangle_yes_backref0@@YAXQAH0@Z" +// X64: "?mangle_yes_backref0@@YAXQEAH0@Z" void mangle_yes_backref1(int *const, int *const) {} -// CHECK: "\01?mangle_yes_backref1@@YAXQAH0@Z" -// X64: "\01?mangle_yes_backref1@@YAXQEAH0@Z" +// CHECK: "?mangle_yes_backref1@@YAXQAH0@Z" +// X64: "?mangle_yes_backref1@@YAXQEAH0@Z" void mangle_yes_backref2(fun_type *const[], ptr_to_fun_type const[]) {} -// CHECK: "\01?mangle_yes_backref2@@YAXQBQ6AXXZ0@Z" -// X64: "\01?mangle_yes_backref2@@YAXQEBQ6AXXZ0@Z" +// CHECK: "?mangle_yes_backref2@@YAXQBQ6AXXZ0@Z" +// X64: "?mangle_yes_backref2@@YAXQEBQ6AXXZ0@Z" void mangle_yes_backref3(ptr_to_fun_type *const, void (**const)(void)) {} -// CHECK: "\01?mangle_yes_backref3@@YAXQAP6AXXZ0@Z" -// X64: "\01?mangle_yes_backref3@@YAXQEAP6AXXZ0@Z" +// CHECK: "?mangle_yes_backref3@@YAXQAP6AXXZ0@Z" +// X64: "?mangle_yes_backref3@@YAXQEAP6AXXZ0@Z" void mangle_yes_backref4(int *const __restrict, int *const __restrict) {} -// CHECK: "\01?mangle_yes_backref4@@YAXQIAH0@Z" -// X64: "\01?mangle_yes_backref4@@YAXQEIAH0@Z" +// CHECK: "?mangle_yes_backref4@@YAXQIAH0@Z" +// X64: "?mangle_yes_backref4@@YAXQEIAH0@Z" struct S {}; void pr23325(const S[1], const S[]) {} -// CHECK: "\01?pr23325@@YAXQBUS@@0@Z" -// X64: "\01?pr23325@@YAXQEBUS@@0@Z" +// CHECK: "?pr23325@@YAXQBUS@@0@Z" +// X64: "?pr23325@@YAXQEBUS@@0@Z" void vla_arg(int i, int a[][i]) {} -// CHECK: "\01?vla_arg@@YAXHQAY0A@H@Z" -// X64: "\01?vla_arg@@YAXHQEAY0A@H@Z" +// CHECK: "?vla_arg@@YAXHQAY0A@H@Z" +// X64: "?vla_arg@@YAXHQEAY0A@H@Z" diff --git a/test/CodeGenCXX/mangle-ms-back-references-pr13207.cpp b/test/CodeGenCXX/mangle-ms-back-references-pr13207.cpp index 5d4b6722f5072..c68b97e68c05e 100644 --- a/test/CodeGenCXX/mangle-ms-back-references-pr13207.cpp +++ b/test/CodeGenCXX/mangle-ms-back-references-pr13207.cpp @@ -8,13 +8,13 @@ template<class X> class C {}; void foo_abbb(A<B<char>, B<char>, B<char> >) {} -// CHECK: "\01?foo_abbb@@YAXV?$A@V?$B@D@@V1@V1@@@@Z" +// CHECK: "?foo_abbb@@YAXV?$A@V?$B@D@@V1@V1@@@@Z" void foo_abb(A<char, B<char>, B<char> >) {} -// CHECK: "\01?foo_abb@@YAXV?$A@DV?$B@D@@V1@@@@Z" +// CHECK: "?foo_abb@@YAXV?$A@DV?$B@D@@V1@@@@Z" void foo_abc(A<char, B<char>, C<char> >) {} -// CHECK: "\01?foo_abc@@YAXV?$A@DV?$B@D@@V?$C@D@@@@@Z" +// CHECK: "?foo_abc@@YAXV?$A@DV?$B@D@@V?$C@D@@@@@Z" void foo_bt(bool a, B<bool(bool)> b) {} -// CHECK: "\01?foo_bt@@YAX_NV?$B@$$A6A_N_N@Z@@@Z" +// CHECK: "?foo_bt@@YAX_NV?$B@$$A6A_N_N@Z@@@Z" namespace N { template<class X, class Y, class Z> @@ -29,11 +29,11 @@ class Z {}; } void foo_abbb(N::A<N::B<char>, N::B<char>, N::B<char> >) {} -// CHECK: "\01?foo_abbb@@YAXV?$A@V?$B@D@N@@V12@V12@@N@@@Z" +// CHECK: "?foo_abbb@@YAXV?$A@V?$B@D@N@@V12@V12@@N@@@Z" void foo_abb(N::A<char, N::B<char>, N::B<char> >) {} -// CHECK: "\01?foo_abb@@YAXV?$A@DV?$B@D@N@@V12@@N@@@Z" +// CHECK: "?foo_abb@@YAXV?$A@DV?$B@D@N@@V12@@N@@@Z" void foo_abc(N::A<char, N::B<char>, N::C<char> >) {} -// CHECK: "\01?foo_abc@@YAXV?$A@DV?$B@D@N@@V?$C@D@2@@N@@@Z" +// CHECK: "?foo_abc@@YAXV?$A@DV?$B@D@N@@V?$C@D@2@@N@@@Z" N::A<char, N::B<char>, N::C<char> > abc_foo() { // CHECK: ?abc_foo@@YA?AV?$A@DV?$B@D@N@@V?$C@D@2@@N@@XZ @@ -71,16 +71,16 @@ template<class T> class Y {}; } void foo5(NA::Y<NB::Y<NA::Y<NB::Y<NA::X> > > > arg) {} -// CHECK: "\01?foo5@@YAXV?$Y@V?$Y@V?$Y@V?$Y@VX@NA@@@NB@@@NA@@@NB@@@NA@@@Z" +// CHECK: "?foo5@@YAXV?$Y@V?$Y@V?$Y@V?$Y@VX@NA@@@NB@@@NA@@@NB@@@NA@@@Z" void foo11(NA::Y<NA::X>, NB::Y<NA::X>) {} -// CHECK: "\01?foo11@@YAXV?$Y@VX@NA@@@NA@@V1NB@@@Z" +// CHECK: "?foo11@@YAXV?$Y@VX@NA@@@NA@@V1NB@@@Z" void foo112(NA::Y<NA::X>, NB::Y<NB::X>) {} -// CHECK: "\01?foo112@@YAXV?$Y@VX@NA@@@NA@@V?$Y@VX@NB@@@NB@@@Z" +// CHECK: "?foo112@@YAXV?$Y@VX@NA@@@NA@@V?$Y@VX@NB@@@NB@@@Z" void foo22(NA::Y<NB::Y<NA::X> >, NB::Y<NA::Y<NA::X> >) {} -// CHECK: "\01?foo22@@YAXV?$Y@V?$Y@VX@NA@@@NB@@@NA@@V?$Y@V?$Y@VX@NA@@@NA@@@NB@@@Z" +// CHECK: "?foo22@@YAXV?$Y@V?$Y@VX@NA@@@NB@@@NA@@V?$Y@V?$Y@VX@NA@@@NA@@@NB@@@Z" namespace PR13207 { class A {}; @@ -100,56 +100,56 @@ class L { public: void foo(I<A> x) {} }; -// CHECK: "\01?foo@L@PR13207@@QAEXV?$I@VA@PR13207@@@2@@Z" +// CHECK: "?foo@L@PR13207@@QAEXV?$I@VA@PR13207@@@2@@Z" void call_l_foo(L* l) { l->foo(I<A>()); } void foo(I<A> x) {} -// CHECK: "\01?foo@PR13207@@YAXV?$I@VA@PR13207@@@1@@Z" +// CHECK: "?foo@PR13207@@YAXV?$I@VA@PR13207@@@1@@Z" void foo2(I<A> x, I<A> y) { } -// CHECK: "\01?foo2@PR13207@@YAXV?$I@VA@PR13207@@@1@0@Z" +// CHECK: "?foo2@PR13207@@YAXV?$I@VA@PR13207@@@1@0@Z" void bar(J<A,B> x) {} -// CHECK: "\01?bar@PR13207@@YAXV?$J@VA@PR13207@@VB@2@@1@@Z" +// CHECK: "?bar@PR13207@@YAXV?$J@VA@PR13207@@VB@2@@1@@Z" void spam(K<A,B,C> x) {} -// CHECK: "\01?spam@PR13207@@YAXV?$K@VA@PR13207@@VB@2@VC@2@@1@@Z" +// CHECK: "?spam@PR13207@@YAXV?$K@VA@PR13207@@VB@2@VC@2@@1@@Z" void baz(K<char, F<char>, I<char> >) {} -// CHECK: "\01?baz@PR13207@@YAXV?$K@DV?$F@D@PR13207@@V?$I@D@2@@1@@Z" +// CHECK: "?baz@PR13207@@YAXV?$K@DV?$F@D@PR13207@@V?$I@D@2@@1@@Z" void qux(K<char, I<char>, I<char> >) {} -// CHECK: "\01?qux@PR13207@@YAXV?$K@DV?$I@D@PR13207@@V12@@1@@Z" +// CHECK: "?qux@PR13207@@YAXV?$K@DV?$I@D@PR13207@@V12@@1@@Z" namespace NA { class X {}; template<class T> class Y {}; void foo(Y<X> x) {} -// CHECK: "\01?foo@NA@PR13207@@YAXV?$Y@VX@NA@PR13207@@@12@@Z" +// CHECK: "?foo@NA@PR13207@@YAXV?$Y@VX@NA@PR13207@@@12@@Z" void foofoo(Y<Y<X> > x) {} -// CHECK: "\01?foofoo@NA@PR13207@@YAXV?$Y@V?$Y@VX@NA@PR13207@@@NA@PR13207@@@12@@Z" +// CHECK: "?foofoo@NA@PR13207@@YAXV?$Y@V?$Y@VX@NA@PR13207@@@NA@PR13207@@@12@@Z" } namespace NB { class X {}; template<class T> class Y {}; void foo(Y<NA::X> x) {} -// CHECK: "\01?foo@NB@PR13207@@YAXV?$Y@VX@NA@PR13207@@@12@@Z" +// CHECK: "?foo@NB@PR13207@@YAXV?$Y@VX@NA@PR13207@@@12@@Z" void bar(NA::Y<X> x) {} -// CHECK: "\01?bar@NB@PR13207@@YAXV?$Y@VX@NB@PR13207@@@NA@2@@Z" +// CHECK: "?bar@NB@PR13207@@YAXV?$Y@VX@NB@PR13207@@@NA@2@@Z" void spam(NA::Y<NA::X> x) {} -// CHECK: "\01?spam@NB@PR13207@@YAXV?$Y@VX@NA@PR13207@@@NA@2@@Z" +// CHECK: "?spam@NB@PR13207@@YAXV?$Y@VX@NA@PR13207@@@NA@2@@Z" void foobar(NA::Y<Y<X> > a, Y<Y<X> >) {} -// CHECK: "\01?foobar@NB@PR13207@@YAXV?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@NA@2@V312@@Z" +// CHECK: "?foobar@NB@PR13207@@YAXV?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@NA@2@V312@@Z" void foobarspam(Y<X> a, NA::Y<Y<X> > b, Y<Y<X> >) {} -// CHECK: "\01?foobarspam@NB@PR13207@@YAXV?$Y@VX@NB@PR13207@@@12@V?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@NA@2@V412@@Z" +// CHECK: "?foobarspam@NB@PR13207@@YAXV?$Y@VX@NB@PR13207@@@12@V?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@NA@2@V412@@Z" void foobarbaz(Y<X> a, NA::Y<Y<X> > b, Y<Y<X> >, Y<Y<X> > c) {} -// CHECK: "\01?foobarbaz@NB@PR13207@@YAXV?$Y@VX@NB@PR13207@@@12@V?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@NA@2@V412@2@Z" +// CHECK: "?foobarbaz@NB@PR13207@@YAXV?$Y@VX@NB@PR13207@@@12@V?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@NA@2@V412@2@Z" void foobarbazqux(Y<X> a, NA::Y<Y<X> > b, Y<Y<X> >, Y<Y<X> > c , NA::Y<Y<Y<X> > > d) {} -// CHECK: "\01?foobarbazqux@NB@PR13207@@YAXV?$Y@VX@NB@PR13207@@@12@V?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@NA@2@V412@2V?$Y@V?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@NB@PR13207@@@52@@Z" +// CHECK: "?foobarbazqux@NB@PR13207@@YAXV?$Y@VX@NB@PR13207@@@12@V?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@NA@2@V412@2V?$Y@V?$Y@V?$Y@VX@NB@PR13207@@@NB@PR13207@@@NB@PR13207@@@52@@Z" } namespace NC { @@ -157,10 +157,10 @@ class X {}; template<class T> class Y {}; void foo(Y<NB::X> x) {} -// CHECK: "\01?foo@NC@PR13207@@YAXV?$Y@VX@NB@PR13207@@@12@@Z" +// CHECK: "?foo@NC@PR13207@@YAXV?$Y@VX@NB@PR13207@@@12@@Z" void foobar(NC::Y<NB::Y<NA::Y<NA::X> > > x) {} -// CHECK: "\01?foobar@NC@PR13207@@YAXV?$Y@V?$Y@V?$Y@VX@NA@PR13207@@@NA@PR13207@@@NB@PR13207@@@12@@Z" +// CHECK: "?foobar@NC@PR13207@@YAXV?$Y@V?$Y@V?$Y@VX@NA@PR13207@@@NA@PR13207@@@NB@PR13207@@@12@@Z" } } @@ -175,8 +175,8 @@ void fun_instantiate() { fun_normal(1); fun_tmpl(1); } -// CHECK: "\01?fun_normal@fn_space@@YA?AURetVal@1@H@Z" -// CHECK: "\01??$fun_tmpl@H@fn_space@@YA?AURetVal@0@ABH@Z" +// CHECK: "?fun_normal@fn_space@@YA?AURetVal@1@H@Z" +// CHECK: "??$fun_tmpl@H@fn_space@@YA?AURetVal@0@ABH@Z" template <typename T, RetVal (*F)(T)> RetVal fun_tmpl_recurse(T t) { @@ -188,6 +188,6 @@ RetVal ident(int x) { return RetVal(); } void fun_instantiate2() { fun_tmpl_recurse<int, fun_tmpl_recurse<int, ident> >(10); } -// CHECK: "\01??$fun_tmpl_recurse@H$1??$fun_tmpl_recurse@H$1?ident@fn_space@@YA?AURetVal@2@H@Z@fn_space@@YA?AURetVal@1@H@Z@fn_space@@YA?AURetVal@0@H@Z" -// CHECK: "\01??$fun_tmpl_recurse@H$1?ident@fn_space@@YA?AURetVal@2@H@Z@fn_space@@YA?AURetVal@0@H@Z" +// CHECK: "??$fun_tmpl_recurse@H$1??$fun_tmpl_recurse@H$1?ident@fn_space@@YA?AURetVal@2@H@Z@fn_space@@YA?AURetVal@1@H@Z@fn_space@@YA?AURetVal@0@H@Z" +// CHECK: "??$fun_tmpl_recurse@H$1?ident@fn_space@@YA?AURetVal@2@H@Z@fn_space@@YA?AURetVal@0@H@Z" } diff --git a/test/CodeGenCXX/mangle-ms-back-references.cpp b/test/CodeGenCXX/mangle-ms-back-references.cpp index 25a058a30dbef..cd4d1e2494584 100644 --- a/test/CodeGenCXX/mangle-ms-back-references.cpp +++ b/test/CodeGenCXX/mangle-ms-back-references.cpp @@ -1,25 +1,25 @@ // RUN: %clang_cc1 -fms-extensions -fblocks -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s void f1(const char* a, const char* b) {} -// CHECK: "\01?f1@@YAXPBD0@Z" +// CHECK: "?f1@@YAXPBD0@Z" void f2(const char* a, char* b) {} -// CHECK: "\01?f2@@YAXPBDPAD@Z" +// CHECK: "?f2@@YAXPBDPAD@Z" void f3(int a, const char* b, const char* c) {} -// CHECK: "\01?f3@@YAXHPBD0@Z" +// CHECK: "?f3@@YAXHPBD0@Z" const char *f4(const char* a, const char* b) { return 0; } -// CHECK: "\01?f4@@YAPBDPBD0@Z" +// CHECK: "?f4@@YAPBDPBD0@Z" void f5(char const* a, unsigned int b, char c, void const* d, char const* e, unsigned int f) {} -// CHECK: "\01?f5@@YAXPBDIDPBX0I@Z" +// CHECK: "?f5@@YAXPBDIDPBX0I@Z" void f6(bool a, bool b) {} -// CHECK: "\01?f6@@YAX_N0@Z" +// CHECK: "?f6@@YAX_N0@Z" void f7(int a, int* b, int c, int* d, bool e, bool f, bool* g) {} -// CHECK: "\01?f7@@YAXHPAHH0_N1PA_N@Z" +// CHECK: "?f7@@YAXHPAHH0_N1PA_N@Z" // FIXME: tests for more than 10 types? @@ -28,18 +28,18 @@ struct S { }; void g1(struct S a) {} -// CHECK: "\01?g1@@YAXUS@@@Z" +// CHECK: "?g1@@YAXUS@@@Z" void g2(struct S a, struct S b) {} -// CHECK: "\01?g2@@YAXUS@@0@Z" +// CHECK: "?g2@@YAXUS@@0@Z" void g3(struct S a, struct S b, struct S* c, struct S* d) {} -// CHECK: "\01?g3@@YAXUS@@0PAU1@1@Z" +// CHECK: "?g3@@YAXUS@@0PAU1@1@Z" void g4(const char* a, struct S* b, const char* c, struct S* d) { -// CHECK: "\01?g4@@YAXPBDPAUS@@01@Z" +// CHECK: "?g4@@YAXPBDPAUS@@01@Z" b->mbb(false, false); -// CHECK: "\01?mbb@S@@QAEX_N0@Z" +// CHECK: "?mbb@S@@QAEX_N0@Z" } // Make sure that different aliases of built-in types end up mangled as the @@ -47,22 +47,22 @@ void g4(const char* a, struct S* b, const char* c, struct S* d) { typedef unsigned int uintptr_t; typedef unsigned int size_t; void *h(size_t a, uintptr_t b) { return 0; } -// CHECK: "\01?h@@YAPAXII@Z" +// CHECK: "?h@@YAPAXII@Z" // Function pointers might be mangled in a complex way. typedef void (*VoidFunc)(); typedef int* (*PInt3Func)(int* a, int* b); void h1(const char* a, const char* b, VoidFunc c, VoidFunc d) {} -// CHECK: "\01?h1@@YAXPBD0P6AXXZ1@Z" +// CHECK: "?h1@@YAXPBD0P6AXXZ1@Z" void h2(void (*f_ptr)(void *), void *arg) {} -// CHECK: "\01?h2@@YAXP6AXPAX@Z0@Z" +// CHECK: "?h2@@YAXP6AXPAX@Z0@Z" PInt3Func h3(PInt3Func x, PInt3Func y, int* z) { return 0; } -// CHECK: "\01?h3@@YAP6APAHPAH0@ZP6APAH00@Z10@Z" +// CHECK: "?h3@@YAP6APAHPAH0@ZP6APAH00@Z10@Z" namespace foo { void foo() { } -// CHECK: "\01?foo@0@YAXXZ" +// CHECK: "?foo@0@YAXXZ" } diff --git a/test/CodeGenCXX/mangle-ms-cxx11.cpp b/test/CodeGenCXX/mangle-ms-cxx11.cpp index b22c04698ea2d..1e3b7ceca7175 100644 --- a/test/CodeGenCXX/mangle-ms-cxx11.cpp +++ b/test/CodeGenCXX/mangle-ms-cxx11.cpp @@ -1,5 +1,6 @@ // RUN: %clang_cc1 -std=c++11 -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=19.00 | FileCheck %s --check-prefix=CHECK --check-prefix=MSVC2015 // RUN: %clang_cc1 -std=c++11 -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=18.00 | FileCheck %s --check-prefix=CHECK --check-prefix=MSVC2013 +// RUN: %clang_cc1 -std=c++11 -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -gcodeview -debug-info-kind=limited | FileCheck %s --check-prefix=DBG namespace FTypeWithQuals { template <typename T> @@ -7,69 +8,69 @@ struct S {}; using A = int () const; S<A> a; -// CHECK-DAG: @"\01?a@FTypeWithQuals@@3U?$S@$$A8@@BAHXZ@1@A" +// CHECK-DAG: @"?a@FTypeWithQuals@@3U?$S@$$A8@@BAHXZ@1@A" using B = int () volatile; S<B> b; -// CHECK-DAG: @"\01?b@FTypeWithQuals@@3U?$S@$$A8@@CAHXZ@1@A" +// CHECK-DAG: @"?b@FTypeWithQuals@@3U?$S@$$A8@@CAHXZ@1@A" using C = int () __restrict; S<C> c; -// CHECK-DAG: @"\01?c@FTypeWithQuals@@3U?$S@$$A8@@IAAHXZ@1@A" +// CHECK-DAG: @"?c@FTypeWithQuals@@3U?$S@$$A8@@IAAHXZ@1@A" using D = int () const &; S<D> d; -// CHECK-DAG: @"\01?d@FTypeWithQuals@@3U?$S@$$A8@@GBAHXZ@1@A" +// CHECK-DAG: @"?d@FTypeWithQuals@@3U?$S@$$A8@@GBAHXZ@1@A" using E = int () volatile &; S<E> e; -// CHECK-DAG: @"\01?e@FTypeWithQuals@@3U?$S@$$A8@@GCAHXZ@1@A" +// CHECK-DAG: @"?e@FTypeWithQuals@@3U?$S@$$A8@@GCAHXZ@1@A" using F = int () __restrict &; S<F> f; -// CHECK-DAG: @"\01?f@FTypeWithQuals@@3U?$S@$$A8@@IGAAHXZ@1@A" +// CHECK-DAG: @"?f@FTypeWithQuals@@3U?$S@$$A8@@IGAAHXZ@1@A" using G = int () const &&; S<G> g; -// CHECK-DAG: @"\01?g@FTypeWithQuals@@3U?$S@$$A8@@HBAHXZ@1@A" +// CHECK-DAG: @"?g@FTypeWithQuals@@3U?$S@$$A8@@HBAHXZ@1@A" using H = int () volatile &&; S<H> h; -// CHECK-DAG: @"\01?h@FTypeWithQuals@@3U?$S@$$A8@@HCAHXZ@1@A" +// CHECK-DAG: @"?h@FTypeWithQuals@@3U?$S@$$A8@@HCAHXZ@1@A" using I = int () __restrict &&; S<I> i; -// CHECK-DAG: @"\01?i@FTypeWithQuals@@3U?$S@$$A8@@IHAAHXZ@1@A" +// CHECK-DAG: @"?i@FTypeWithQuals@@3U?$S@$$A8@@IHAAHXZ@1@A" using J = int (); S<J> j; -// CHECK-DAG: @"\01?j@FTypeWithQuals@@3U?$S@$$A6AHXZ@1@A" +// CHECK-DAG: @"?j@FTypeWithQuals@@3U?$S@$$A6AHXZ@1@A" using K = int () &; S<K> k; -// CHECK-DAG: @"\01?k@FTypeWithQuals@@3U?$S@$$A8@@GAAHXZ@1@A" +// CHECK-DAG: @"?k@FTypeWithQuals@@3U?$S@$$A8@@GAAHXZ@1@A" using L = int () &&; S<L> l; -// CHECK-DAG: @"\01?l@FTypeWithQuals@@3U?$S@$$A8@@HAAHXZ@1@A" +// CHECK-DAG: @"?l@FTypeWithQuals@@3U?$S@$$A8@@HAAHXZ@1@A" } -// CHECK: "\01?DeducedType@@3HA" +// CHECK: "?DeducedType@@3HA" auto DeducedType = 30; -// CHECK-DAG: @"\01?Char16Var@@3_SA" +// CHECK-DAG: @"?Char16Var@@3_SA" char16_t Char16Var; -// CHECK-DAG: @"\01?Char32Var@@3_UA" +// CHECK-DAG: @"?Char32Var@@3_UA" char32_t Char32Var; -// CHECK: "\01?LRef@@YAXAAH@Z" +// CHECK: "?LRef@@YAXAAH@Z" void LRef(int& a) { } -// CHECK: "\01?RRef@@YAH$$QAH@Z" +// CHECK: "?RRef@@YAH$$QAH@Z" int RRef(int&& a) { return a; } -// CHECK: "\01?Null@@YAX$$T@Z" +// CHECK: "?Null@@YAX$$T@Z" namespace std { typedef decltype(__nullptr) nullptr_t; } void Null(std::nullptr_t) {} @@ -87,19 +88,19 @@ namespace EnumMangling { extern enum Enum11 : unsigned long { } ULongEnum; extern enum Enum12 : long long { } SLongLongEnum; extern enum Enum13 : unsigned long long { } ULongLongEnum; -// CHECK-DAG: @"\01?Enum@EnumMangling@@3W4Enum01@1@A" -// CHECK-DAG: @"\01?BoolEnum@EnumMangling@@3W4Enum02@1@A -// CHECK-DAG: @"\01?CharEnum@EnumMangling@@3W4Enum03@1@A -// CHECK-DAG: @"\01?SCharEnum@EnumMangling@@3W4Enum04@1@A -// CHECK-DAG: @"\01?UCharEnum@EnumMangling@@3W4Enum05@1@A -// CHECK-DAG: @"\01?SShortEnum@EnumMangling@@3W4Enum06@1@A" -// CHECK-DAG: @"\01?UShortEnum@EnumMangling@@3W4Enum07@1@A" -// CHECK-DAG: @"\01?SIntEnum@EnumMangling@@3W4Enum08@1@A" -// CHECK-DAG: @"\01?UIntEnum@EnumMangling@@3W4Enum09@1@A" -// CHECK-DAG: @"\01?SLongEnum@EnumMangling@@3W4Enum10@1@A" -// CHECK-DAG: @"\01?ULongEnum@EnumMangling@@3W4Enum11@1@A" -// CHECK-DAG: @"\01?SLongLongEnum@EnumMangling@@3W4Enum12@1@A" -// CHECK-DAG: @"\01?ULongLongEnum@EnumMangling@@3W4Enum13@1@A" +// CHECK-DAG: @"?Enum@EnumMangling@@3W4Enum01@1@A" +// CHECK-DAG: @"?BoolEnum@EnumMangling@@3W4Enum02@1@A +// CHECK-DAG: @"?CharEnum@EnumMangling@@3W4Enum03@1@A +// CHECK-DAG: @"?SCharEnum@EnumMangling@@3W4Enum04@1@A +// CHECK-DAG: @"?UCharEnum@EnumMangling@@3W4Enum05@1@A +// CHECK-DAG: @"?SShortEnum@EnumMangling@@3W4Enum06@1@A" +// CHECK-DAG: @"?UShortEnum@EnumMangling@@3W4Enum07@1@A" +// CHECK-DAG: @"?SIntEnum@EnumMangling@@3W4Enum08@1@A" +// CHECK-DAG: @"?UIntEnum@EnumMangling@@3W4Enum09@1@A" +// CHECK-DAG: @"?SLongEnum@EnumMangling@@3W4Enum10@1@A" +// CHECK-DAG: @"?ULongEnum@EnumMangling@@3W4Enum11@1@A" +// CHECK-DAG: @"?SLongLongEnum@EnumMangling@@3W4Enum12@1@A" +// CHECK-DAG: @"?ULongLongEnum@EnumMangling@@3W4Enum13@1@A" decltype(Enum) *UseEnum() { return &Enum; } decltype(BoolEnum) *UseBoolEnum() { return &BoolEnum; } decltype(CharEnum) *UseCharEnum() { return &CharEnum; } @@ -126,19 +127,19 @@ namespace EnumMangling { extern enum class EnumClass11 : unsigned long { } ULongEnumClass; extern enum class EnumClass12 : long long { } SLongLongEnumClass; extern enum class EnumClass13 : unsigned long long { } ULongLongEnumClass; -// CHECK-DAG: @"\01?EnumClass@EnumMangling@@3W4EnumClass01@1@A" -// CHECK-DAG: @"\01?BoolEnumClass@EnumMangling@@3W4EnumClass02@1@A -// CHECK-DAG: @"\01?CharEnumClass@EnumMangling@@3W4EnumClass03@1@A -// CHECK-DAG: @"\01?SCharEnumClass@EnumMangling@@3W4EnumClass04@1@A -// CHECK-DAG: @"\01?UCharEnumClass@EnumMangling@@3W4EnumClass05@1@A -// CHECK-DAG: @"\01?SShortEnumClass@EnumMangling@@3W4EnumClass06@1@A" -// CHECK-DAG: @"\01?UShortEnumClass@EnumMangling@@3W4EnumClass07@1@A" -// CHECK-DAG: @"\01?SIntEnumClass@EnumMangling@@3W4EnumClass08@1@A" -// CHECK-DAG: @"\01?UIntEnumClass@EnumMangling@@3W4EnumClass09@1@A" -// CHECK-DAG: @"\01?SLongEnumClass@EnumMangling@@3W4EnumClass10@1@A" -// CHECK-DAG: @"\01?ULongEnumClass@EnumMangling@@3W4EnumClass11@1@A" -// CHECK-DAG: @"\01?SLongLongEnumClass@EnumMangling@@3W4EnumClass12@1@A" -// CHECK-DAG: @"\01?ULongLongEnumClass@EnumMangling@@3W4EnumClass13@1@A" +// CHECK-DAG: @"?EnumClass@EnumMangling@@3W4EnumClass01@1@A" +// CHECK-DAG: @"?BoolEnumClass@EnumMangling@@3W4EnumClass02@1@A +// CHECK-DAG: @"?CharEnumClass@EnumMangling@@3W4EnumClass03@1@A +// CHECK-DAG: @"?SCharEnumClass@EnumMangling@@3W4EnumClass04@1@A +// CHECK-DAG: @"?UCharEnumClass@EnumMangling@@3W4EnumClass05@1@A +// CHECK-DAG: @"?SShortEnumClass@EnumMangling@@3W4EnumClass06@1@A" +// CHECK-DAG: @"?UShortEnumClass@EnumMangling@@3W4EnumClass07@1@A" +// CHECK-DAG: @"?SIntEnumClass@EnumMangling@@3W4EnumClass08@1@A" +// CHECK-DAG: @"?UIntEnumClass@EnumMangling@@3W4EnumClass09@1@A" +// CHECK-DAG: @"?SLongEnumClass@EnumMangling@@3W4EnumClass10@1@A" +// CHECK-DAG: @"?ULongEnumClass@EnumMangling@@3W4EnumClass11@1@A" +// CHECK-DAG: @"?SLongLongEnumClass@EnumMangling@@3W4EnumClass12@1@A" +// CHECK-DAG: @"?ULongLongEnumClass@EnumMangling@@3W4EnumClass13@1@A" decltype(EnumClass) *UseEnumClass() { return &EnumClass; } decltype(BoolEnumClass) *UseBoolEnumClass() { return &BoolEnumClass; } decltype(CharEnumClass) *UseCharEnumClass() { return &CharEnumClass; } @@ -158,7 +159,7 @@ namespace PR18022 { struct { } a; decltype(a) fun(decltype(a) x, decltype(a)) { return x; } -// CHECK-DAG: @"\01?fun@PR18022@@YA?AU<unnamed-type-a>@1@U21@0@Z" +// CHECK-DAG: @"?fun@PR18022@@YA?AU<unnamed-type-a>@1@U21@0@Z" void use_fun() { fun(a, a); } @@ -168,14 +169,14 @@ inline int define_lambda() { static auto lambda = [] { static int local; ++local; return local; }; // First, we have the static local variable of type "<lambda_1>" inside of // "define_lambda". -// CHECK-DAG: @"\01?lambda@?1??define_lambda@@YAHXZ@4V<lambda_1>@?0??1@YAHXZ@A" +// CHECK-DAG: @"?lambda@?1??define_lambda@@YAHXZ@4V<lambda_1>@?0??1@YAHXZ@A" // Next, we have the "operator()" for "<lambda_1>" which is inside of // "define_lambda". -// CHECK-DAG: @"\01??R<lambda_1>@?0??define_lambda@@YAHXZ@QBE@XZ" +// CHECK-DAG: @"??R<lambda_1>@?0??define_lambda@@YAHXZ@QBE@XZ" // Finally, we have the local which is inside of "<lambda_1>" which is inside of // "define_lambda". Hooray. -// MSVC2013-DAG: @"\01?local@?2???R<lambda_1>@?0??define_lambda@@YAHXZ@QBE@XZ@4HA" -// MSVC2015-DAG: @"\01?local@?1???R<lambda_1>@?0??define_lambda@@YAHXZ@QBE@XZ@4HA" +// MSVC2013-DAG: @"?local@?2???R<lambda_1>@?0??define_lambda@@YAHXZ@QBE@XZ@4HA" +// MSVC2015-DAG: @"?local@?1???R<lambda_1>@?0??define_lambda@@YAHXZ@QBE@XZ@4HA" return lambda(); } @@ -184,12 +185,12 @@ void use_lambda_arg(T) {} inline void call_with_lambda_arg1() { use_lambda_arg([]{}); - // CHECK-DAG: @"\01??$use_lambda_arg@V<lambda_1>@?0??call_with_lambda_arg1@@YAXXZ@@@YAXV<lambda_1>@?0??call_with_lambda_arg1@@YAXXZ@@Z" + // CHECK-DAG: @"??$use_lambda_arg@V<lambda_1>@?0??call_with_lambda_arg1@@YAXXZ@@@YAXV<lambda_1>@?0??call_with_lambda_arg1@@YAXXZ@@Z" } inline void call_with_lambda_arg2() { use_lambda_arg([]{}); - // CHECK-DAG: @"\01??$use_lambda_arg@V<lambda_1>@?0??call_with_lambda_arg2@@YAXXZ@@@YAXV<lambda_1>@?0??call_with_lambda_arg2@@YAXXZ@@Z" + // CHECK-DAG: @"??$use_lambda_arg@V<lambda_1>@?0??call_with_lambda_arg2@@YAXXZ@@@YAXV<lambda_1>@?0??call_with_lambda_arg2@@YAXXZ@@Z" } int call_lambda() { @@ -204,33 +205,33 @@ struct A { void foo() __restrict &&; }; void A::foo() __restrict & {} -// CHECK-DAG: @"\01?foo@A@PR19361@@QIGAEXXZ" +// CHECK-DAG: @"?foo@A@PR19361@@QIGAEXXZ" void A::foo() __restrict && {} -// CHECK-DAG: @"\01?foo@A@PR19361@@QIHAEXXZ" +// CHECK-DAG: @"?foo@A@PR19361@@QIHAEXXZ" } int operator"" _deg(long double) { return 0; } -// CHECK-DAG: @"\01??__K_deg@@YAHO@Z" +// CHECK-DAG: @"??__K_deg@@YAHO@Z" template <char...> void templ_fun_with_pack() {} template void templ_fun_with_pack<>(); -// CHECK-DAG: @"\01??$templ_fun_with_pack@$S@@YAXXZ" +// CHECK-DAG: @"??$templ_fun_with_pack@$S@@YAXXZ" template <typename...> void templ_fun_with_ty_pack() {} template void templ_fun_with_ty_pack<>(); -// MSVC2013-DAG: @"\01??$templ_fun_with_ty_pack@$$$V@@YAXXZ" -// MSVC2015-DAG: @"\01??$templ_fun_with_ty_pack@$$V@@YAXXZ" +// MSVC2013-DAG: @"??$templ_fun_with_ty_pack@$$$V@@YAXXZ" +// MSVC2015-DAG: @"??$templ_fun_with_ty_pack@$$V@@YAXXZ" template <template <class> class...> void templ_fun_with_templ_templ_pack() {} template void templ_fun_with_templ_templ_pack<>(); -// MSVC2013-DAG: @"\01??$templ_fun_with_templ_templ_pack@$$$V@@YAXXZ" -// MSVC2015-DAG: @"\01??$templ_fun_with_templ_templ_pack@$$V@@YAXXZ" +// MSVC2013-DAG: @"??$templ_fun_with_templ_templ_pack@$$$V@@YAXXZ" +// MSVC2015-DAG: @"??$templ_fun_with_templ_templ_pack@$$V@@YAXXZ" namespace PR20047 { template <typename T> @@ -243,7 +244,7 @@ template <template <typename> class> void f() {} template void f<AliasA>(); -// CHECK-DAG: @"\01??$f@$$YAliasA@PR20047@@@PR20047@@YAXXZ" +// CHECK-DAG: @"??$f@$$YAliasA@PR20047@@@PR20047@@YAXXZ" } namespace UnnamedType { @@ -252,7 +253,7 @@ struct A { }; void f(decltype(*A::TD)) {} -// CHECK-DAG: @"\01?f@UnnamedType@@YAXAAU<unnamed-type-TD>@A@1@@Z" +// CHECK-DAG: @"?f@UnnamedType@@YAXAAU<unnamed-type-TD>@A@1@@Z" template <typename T> struct B { @@ -261,7 +262,7 @@ struct B { }; void f(decltype(B<int>::e)) {} -// CHECK-DAG: @"\01?f@UnnamedType@@YAXPAW4<unnamed-type-e>@?$B@H@1@@Z +// CHECK-DAG: @"?f@UnnamedType@@YAXPAW4<unnamed-type-e>@?$B@H@1@@Z } namespace PR24651 { @@ -276,8 +277,8 @@ void g() { f(E); } } -// CHECK-DAG: @"\01??$f@W4<unnamed-type-E>@?1??g@PR24651@@YAXXZ@@PR24651@@YAXW4<unnamed-type-E>@?1??g@0@YAXXZ@@Z" -// CHECK-DAG: @"\01??$f@W4<unnamed-type-E>@?2??g@PR24651@@YAXXZ@@PR24651@@YAXW4<unnamed-type-E>@?2??g@0@YAXXZ@@Z" +// CHECK-DAG: @"??$f@W4<unnamed-type-E>@?1??g@PR24651@@YAXXZ@@PR24651@@YAXW4<unnamed-type-E>@?1??g@0@YAXXZ@@Z" +// CHECK-DAG: @"??$f@W4<unnamed-type-E>@?2??g@PR24651@@YAXXZ@@PR24651@@YAXW4<unnamed-type-E>@?2??g@0@YAXXZ@@Z" } namespace PR18204 { @@ -286,15 +287,15 @@ int f(T *) { return 0; } static union { int n = f(this); }; -// CHECK-DAG: @"\01??$f@T<unnamed-type-$S1>@PR18204@@@PR18204@@YAHPAT<unnamed-type-$S1>@0@@Z" +// CHECK-DAG: @"??$f@T<unnamed-type-$S1>@PR18204@@@PR18204@@YAHPAT<unnamed-type-$S1>@0@@Z" } int PR26105() { auto add = [](int x) { return ([x](int y) { return x + y; }); }; return add(3)(4); } -// CHECK-DAG: @"\01??R<lambda_0>@?0??PR26105@@YAHXZ@QBE@H@Z" -// CHECK-DAG: @"\01??R<lambda_1>@?0???R<lambda_0>@?0??PR26105@@YAHXZ@QBE@H@Z@QBE@H@Z" +// CHECK-DAG: @"??R<lambda_0>@?0??PR26105@@YAHXZ@QBE@H@Z" +// CHECK-DAG: @"??R<lambda_1>@?0???R<lambda_0>@?0??PR26105@@YAHXZ@QBE@H@Z@QBE@H@Z" int __unaligned * unaligned_foo1() { return 0; } int __unaligned * __unaligned * unaligned_foo2() { return 0; } @@ -304,13 +305,13 @@ void unaligned_foo5(int __unaligned * __restrict p1) {} template <typename T> T unaligned_foo6(T t) { return t; } void unaligned_foo7() { unaligned_foo6<int *>(0); unaligned_foo6<int __unaligned *>(0); } -// CHECK-DAG: @"\01?unaligned_foo1@@YAPFAHXZ" -// CHECK-DAG: @"\01?unaligned_foo2@@YAPFAPFAHXZ" -// CHECK-DAG: @"\01?unaligned_foo3@@YAHXZ" -// CHECK-DAG: @"\01?unaligned_foo4@@YAXPFAH@Z" -// CHECK-DAG: @"\01?unaligned_foo5@@YAXPIFAH@Z" -// CHECK-DAG: @"\01??$unaligned_foo6@PAH@@YAPAHPAH@Z" -// CHECK-DAG: @"\01??$unaligned_foo6@PFAH@@YAPFAHPFAH@Z" +// CHECK-DAG: @"?unaligned_foo1@@YAPFAHXZ" +// CHECK-DAG: @"?unaligned_foo2@@YAPFAPFAHXZ" +// CHECK-DAG: @"?unaligned_foo3@@YAHXZ" +// CHECK-DAG: @"?unaligned_foo4@@YAXPFAH@Z" +// CHECK-DAG: @"?unaligned_foo5@@YAXPIFAH@Z" +// CHECK-DAG: @"??$unaligned_foo6@PAH@@YAPAHPAH@Z" +// CHECK-DAG: @"??$unaligned_foo6@PFAH@@YAPFAHPFAH@Z" // __unaligned qualifier for function types struct unaligned_foo8_S { @@ -318,28 +319,28 @@ struct unaligned_foo8_S { }; void unaligned_foo8_S::unaligned_foo8() volatile __unaligned {} -// CHECK-DAG: @"\01?unaligned_foo8@unaligned_foo8_S@@QFCEXXZ" +// CHECK-DAG: @"?unaligned_foo8@unaligned_foo8_S@@QFCEXXZ" namespace PR31197 { struct A { - // CHECK-DAG: define linkonce_odr x86_thiscallcc i32* @"\01??R<lambda_1>@x@A@PR31197@@QBE@XZ"( + // CHECK-DAG: define linkonce_odr dso_local x86_thiscallcc i32* @"??R<lambda_1>@x@A@PR31197@@QBE@XZ"( int *x = []() { static int white; - // CHECK-DAG: @"\01?white@?1???R<lambda_1>@x@A@PR31197@@QBE@XZ@4HA" + // CHECK-DAG: @"?white@?1???R<lambda_1>@x@A@PR31197@@QBE@XZ@4HA" return &white; }(); - // CHECK-DAG: define linkonce_odr x86_thiscallcc i32* @"\01??R<lambda_1>@y@A@PR31197@@QBE@XZ"( + // CHECK-DAG: define linkonce_odr dso_local x86_thiscallcc i32* @"??R<lambda_1>@y@A@PR31197@@QBE@XZ"( int *y = []() { static int black; - // CHECK-DAG: @"\01?black@?1???R<lambda_1>@y@A@PR31197@@QBE@XZ@4HA" + // CHECK-DAG: @"?black@?1???R<lambda_1>@y@A@PR31197@@QBE@XZ@4HA" return &black; }(); using FPtrTy = void(void); static void default_args(FPtrTy x = [] {}, FPtrTy y = [] {}, int z = [] { return 1; }() + [] { return 2; }()) {} - // CHECK-DAG: @"\01??R<lambda_1_1>@?0??default_args@A@PR31197@@SAXP6AXXZ0H@Z@QBE@XZ"( - // CHECK-DAG: @"\01??R<lambda_1_2>@?0??default_args@A@PR31197@@SAXP6AXXZ0H@Z@QBE@XZ"( - // CHECK-DAG: @"\01??R<lambda_2_1>@?0??default_args@A@PR31197@@SAXP6AXXZ0H@Z@QBE@XZ"( - // CHECK-DAG: @"\01??R<lambda_3_1>@?0??default_args@A@PR31197@@SAXP6AXXZ0H@Z@QBE@XZ"( + // CHECK-DAG: @"??R<lambda_1_1>@?0??default_args@A@PR31197@@SAXP6AXXZ0H@Z@QBE@XZ"( + // CHECK-DAG: @"??R<lambda_1_2>@?0??default_args@A@PR31197@@SAXP6AXXZ0H@Z@QBE@XZ"( + // CHECK-DAG: @"??R<lambda_2_1>@?0??default_args@A@PR31197@@SAXP6AXXZ0H@Z@QBE@XZ"( + // CHECK-DAG: @"??R<lambda_3_1>@?0??default_args@A@PR31197@@SAXP6AXXZ0H@Z@QBE@XZ"( }; A a; @@ -348,5 +349,12 @@ int call_it = (A::default_args(), 1); enum { enumerator }; void f(decltype(enumerator)) {} -// CHECK-DAG: define internal void @"\01?f@@YAXW4<unnamed-enum-enumerator>@@@Z"( +// CHECK-DAG: define internal void @"?f@@YAXW4<unnamed-enum-enumerator>@@@Z"( void use_f() { f(enumerator); } + +namespace pr37723 { +struct s { enum {}; enum {}; }; +// DBG-DAG: DW_TAG_enumeration_type{{.*}}identifier: ".?AW4<unnamed-type-$S2>@s@pr37723@@" +// DBG-DAG: DW_TAG_enumeration_type{{.*}}identifier: ".?AW4<unnamed-type-$S3>@s@pr37723@@" +s x; +} diff --git a/test/CodeGenCXX/mangle-ms-cxx14.cpp b/test/CodeGenCXX/mangle-ms-cxx14.cpp index 798a390aeaaa1..c58d055880a1b 100644 --- a/test/CodeGenCXX/mangle-ms-cxx14.cpp +++ b/test/CodeGenCXX/mangle-ms-cxx14.cpp @@ -1,29 +1,29 @@ -// RUN: %clang_cc1 -std=c++1y -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=19.00 | FileCheck %s --check-prefix=CHECK --check-prefix=MSVC2015 -// RUN: %clang_cc1 -std=c++1y -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=18.00 | FileCheck %s --check-prefix=CHECK --check-prefix=MSVC2013 +// RUN: %clang_cc1 -std=c++1y -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=19.00 | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK --check-prefix=MSVC2015 +// RUN: %clang_cc1 -std=c++1y -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=18.00 | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK --check-prefix=MSVC2013 template <typename> int x = 0; -// CHECK-DAG: "\01??$x@X@@3HA" +// CHECK-DAG: "??$x@X@@3HA" template <> int x<void>; -// CHECK-DAG: "\01??$x@H@@3HA" +// CHECK-DAG: "??$x@H@@3HA" template <> int x<int>; -// CHECK-DAG: "\01?FunctionWithLocalType@@YA?A?<auto>@@XZ" +// CHECK-DAG: "?FunctionWithLocalType@@YA?A?<auto>@@XZ" auto FunctionWithLocalType() { struct LocalType {}; return LocalType{}; } -// CHECK-DAG: "\01?ValueFromFunctionWithLocalType@@3ULocalType@?1??FunctionWithLocalType@@YA?A?<auto>@@XZ@A" +// CHECK-DAG: "?ValueFromFunctionWithLocalType@@3ULocalType@?1??FunctionWithLocalType@@YA?A?<auto>@@XZ@A" auto ValueFromFunctionWithLocalType = FunctionWithLocalType(); -// CHECK-DAG: "\01??R<lambda_0>@@QBE?A?<auto>@@XZ" +// CHECK-DAG: "??R<lambda_0>@@QBE?A?<auto>@@XZ" auto LambdaWithLocalType = [] { struct LocalType {}; return LocalType{}; }; -// CHECK-DAG: "\01?ValueFromLambdaWithLocalType@@3ULocalType@?1???R<lambda_0>@@QBE?A?<auto>@@XZ@A" +// CHECK-DAG: "?ValueFromLambdaWithLocalType@@3ULocalType@?1???R<lambda_0>@@QBE?A?<auto>@@XZ@A" auto ValueFromLambdaWithLocalType = LambdaWithLocalType(); template <typename T> @@ -35,12 +35,12 @@ auto TemplateFuncionWithLocalLambda(T) { return LocalLambdaWithLocalType(); } -// MSVC2013-DAG: "\01?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?2???R<lambda_1>@?0???$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?3@XZ@A" -// MSVC2013-DAG: "\01?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?2???R<lambda_1>@?0???$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?3@XZ@A" -// MSVC2015-DAG: "\01?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?1???R<lambda_1>@?0???$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?3@XZ@A" -// MSVC2015-DAG: "\01?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?1???R<lambda_1>@?0???$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?3@XZ@A" -// CHECK-DAG: "\01??$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z" -// CHECK-DAG: "\01??R<lambda_1>@?0???$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?1@XZ" +// MSVC2013-DAG: "?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?2???R<lambda_1>@?0???$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?3@XZ@A" +// MSVC2013-DAG: "?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?2???R<lambda_1>@?0???$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?3@XZ@A" +// MSVC2015-DAG: "?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?1???R<lambda_1>@?0???$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?3@XZ@A" +// MSVC2015-DAG: "?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?1???R<lambda_1>@?0???$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?3@XZ@A" +// CHECK-DAG: "??$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z" +// CHECK-DAG: "??R<lambda_1>@?0???$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?1@XZ" auto ValueFromTemplateFuncionWithLocalLambda = TemplateFuncionWithLocalLambda(0); struct S; @@ -48,15 +48,15 @@ template <int S::*> int WithPMD = 0; template <> int WithPMD<nullptr>; -// CHECK-DAG: "\01??$WithPMD@$GA@A@?0@@3HA" +// CHECK-DAG: "??$WithPMD@$GA@A@?0@@3HA" template <const int *, const int *> struct Foo {}; Foo<&x<int>, &x<int>> Zoo; -// CHECK-DAG: "\01?Zoo@@3U?$Foo@$1??$x@H@@3HA$1?1@3HA@@A" +// CHECK-DAG: "?Zoo@@3U?$Foo@$1??$x@H@@3HA$1?1@3HA@@A" template <typename T> T unaligned_x; extern auto test_unaligned() { return unaligned_x<int __unaligned *>; } -// CHECK-DAG: "\01??$unaligned_x@PFAH@@3PFAHA" +// CHECK-DAG: "??$unaligned_x@PFAH@@3PFAHA" diff --git a/test/CodeGenCXX/mangle-ms-md5.cpp b/test/CodeGenCXX/mangle-ms-md5.cpp index aef2683048328..740fd61576ccb 100644 --- a/test/CodeGenCXX/mangle-ms-md5.cpp +++ b/test/CodeGenCXX/mangle-ms-md5.cpp @@ -1,11 +1,11 @@ // RUN: %clang_cc1 -emit-llvm -o - -triple i686-pc-win32 %s | FileCheck %s int xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx; -// CHECK-DAG: @"\01??@bf7ea7b95f260b0b24e7f1e8fc8370ab@" = global i32 0, align 4 +// CHECK-DAG: @"??@bf7ea7b95f260b0b24e7f1e8fc8370ab@" = dso_local global i32 0, align 4 struct yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy { yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy(); virtual void f(); }; yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy::yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy() {} -// CHECK-DAG: @"\01??@a6a285da2eea70dba6b578022be61d81@??_R4@" = linkonce_odr constant %rtti.CompleteObjectLocator -// CHECK-DAG: @"\01??@a6a285da2eea70dba6b578022be61d81@" = unnamed_addr alias +// CHECK-DAG: @"??@a6a285da2eea70dba6b578022be61d81@??_R4@" = linkonce_odr constant %rtti.CompleteObjectLocator +// CHECK-DAG: @"??@a6a285da2eea70dba6b578022be61d81@" = unnamed_addr alias diff --git a/test/CodeGenCXX/mangle-ms-return-qualifiers.cpp b/test/CodeGenCXX/mangle-ms-return-qualifiers.cpp index 8b666e4f7d621..0054279692fb2 100644 --- a/test/CodeGenCXX/mangle-ms-return-qualifiers.cpp +++ b/test/CodeGenCXX/mangle-ms-return-qualifiers.cpp @@ -1,189 +1,189 @@ // RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s void a1() {} -// CHECK: "\01?a1@@YAXXZ" +// CHECK: "?a1@@YAXXZ" int a2() { return 0; } -// CHECK: "\01?a2@@YAHXZ" +// CHECK: "?a2@@YAHXZ" const int a3() { return 0; } -// CHECK: "\01?a3@@YA?BHXZ" +// CHECK: "?a3@@YA?BHXZ" volatile int a4() { return 0; } -// CHECK: "\01?a4@@YA?CHXZ" +// CHECK: "?a4@@YA?CHXZ" const volatile int a5() { return 0; } -// CHECK: "\01?a5@@YA?DHXZ" +// CHECK: "?a5@@YA?DHXZ" float a6() { return 0.0f; } -// CHECK: "\01?a6@@YAMXZ" +// CHECK: "?a6@@YAMXZ" int *b1() { return 0; } -// CHECK: "\01?b1@@YAPAHXZ" +// CHECK: "?b1@@YAPAHXZ" const char *b2() { return 0; } -// CHECK: "\01?b2@@YAPBDXZ" +// CHECK: "?b2@@YAPBDXZ" float *b3() { return 0; } -// CHECK: "\01?b3@@YAPAMXZ" +// CHECK: "?b3@@YAPAMXZ" const float *b4() { return 0; } -// CHECK: "\01?b4@@YAPBMXZ" +// CHECK: "?b4@@YAPBMXZ" volatile float *b5() { return 0; } -// CHECK: "\01?b5@@YAPCMXZ" +// CHECK: "?b5@@YAPCMXZ" const volatile float *b6() { return 0; } -// CHECK: "\01?b6@@YAPDMXZ" +// CHECK: "?b6@@YAPDMXZ" float &b7() { return *(float*)0; } -// CHECK: "\01?b7@@YAAAMXZ" +// CHECK: "?b7@@YAAAMXZ" const float &b8() { return *(float*)0; } -// CHECK: "\01?b8@@YAABMXZ" +// CHECK: "?b8@@YAABMXZ" volatile float &b9() { return *(float*)0; } -// CHECK: "\01?b9@@YAACMXZ" +// CHECK: "?b9@@YAACMXZ" const volatile float &b10() { return *(float*)0; } -// CHECK: "\01?b10@@YAADMXZ" +// CHECK: "?b10@@YAADMXZ" const char** b11() { return 0; } -// CHECK: "\01?b11@@YAPAPBDXZ" +// CHECK: "?b11@@YAPAPBDXZ" class A {}; A c1() { return A(); } -// CHECK: "\01?c1@@YA?AVA@@XZ" +// CHECK: "?c1@@YA?AVA@@XZ" const A c2() { return A(); } -// CHECK: "\01?c2@@YA?BVA@@XZ" +// CHECK: "?c2@@YA?BVA@@XZ" volatile A c3() { return A(); } -// CHECK: "\01?c3@@YA?CVA@@XZ" +// CHECK: "?c3@@YA?CVA@@XZ" const volatile A c4() { return A(); } -// CHECK: "\01?c4@@YA?DVA@@XZ" +// CHECK: "?c4@@YA?DVA@@XZ" const A* c5() { return 0; } -// CHECK: "\01?c5@@YAPBVA@@XZ" +// CHECK: "?c5@@YAPBVA@@XZ" volatile A* c6() { return 0; } -// CHECK: "\01?c6@@YAPCVA@@XZ" +// CHECK: "?c6@@YAPCVA@@XZ" const volatile A* c7() { return 0; } -// CHECK: "\01?c7@@YAPDVA@@XZ" +// CHECK: "?c7@@YAPDVA@@XZ" A &c8() { return *(A*)0; } -// CHECK: "\01?c8@@YAAAVA@@XZ" +// CHECK: "?c8@@YAAAVA@@XZ" const A &c9() { return *(A*)0; } -// CHECK: "\01?c9@@YAABVA@@XZ" +// CHECK: "?c9@@YAABVA@@XZ" volatile A &c10() { return *(A*)0; } -// CHECK: "\01?c10@@YAACVA@@XZ" +// CHECK: "?c10@@YAACVA@@XZ" const volatile A &c11() { return *(A*)0; } -// CHECK: "\01?c11@@YAADVA@@XZ" +// CHECK: "?c11@@YAADVA@@XZ" template<typename T> class B {}; B<int> d1() { return B<int>(); } -// CHECK: "\01?d1@@YA?AV?$B@H@@XZ" +// CHECK: "?d1@@YA?AV?$B@H@@XZ" B<const char*> d2() {return B<const char*>(); } -// CHECK: "\01?d2@@YA?AV?$B@PBD@@XZ" +// CHECK: "?d2@@YA?AV?$B@PBD@@XZ" B<A> d3() {return B<A>(); } -// CHECK: "\01?d3@@YA?AV?$B@VA@@@@XZ" +// CHECK: "?d3@@YA?AV?$B@VA@@@@XZ" B<A>* d4() { return 0; } -// CHECK: "\01?d4@@YAPAV?$B@VA@@@@XZ" +// CHECK: "?d4@@YAPAV?$B@VA@@@@XZ" const B<A>* d5() { return 0; } -// CHECK: "\01?d5@@YAPBV?$B@VA@@@@XZ" +// CHECK: "?d5@@YAPBV?$B@VA@@@@XZ" volatile B<A>* d6() { return 0; } -// CHECK: "\01?d6@@YAPCV?$B@VA@@@@XZ" +// CHECK: "?d6@@YAPCV?$B@VA@@@@XZ" const volatile B<A>* d7() { return 0; } -// CHECK: "\01?d7@@YAPDV?$B@VA@@@@XZ" +// CHECK: "?d7@@YAPDV?$B@VA@@@@XZ" B<A>& d8() { return *(B<A>*)0; } -// CHECK: "\01?d8@@YAAAV?$B@VA@@@@XZ" +// CHECK: "?d8@@YAAAV?$B@VA@@@@XZ" const B<A>& d9() { return *(B<A>*)0; } -// CHECK: "\01?d9@@YAABV?$B@VA@@@@XZ" +// CHECK: "?d9@@YAABV?$B@VA@@@@XZ" volatile B<A>& d10() { return *(B<A>*)0; } -// CHECK: "\01?d10@@YAACV?$B@VA@@@@XZ" +// CHECK: "?d10@@YAACV?$B@VA@@@@XZ" const volatile B<A>& d11() { return *(B<A>*)0; } -// CHECK: "\01?d11@@YAADV?$B@VA@@@@XZ" +// CHECK: "?d11@@YAADV?$B@VA@@@@XZ" enum Enum { DEFAULT }; Enum e1() { return DEFAULT; } -// CHECK: "\01?e1@@YA?AW4Enum@@XZ" +// CHECK: "?e1@@YA?AW4Enum@@XZ" const Enum e2() { return DEFAULT; } -// CHECK: "\01?e2@@YA?BW4Enum@@XZ" +// CHECK: "?e2@@YA?BW4Enum@@XZ" Enum* e3() { return 0; } -// CHECK: "\01?e3@@YAPAW4Enum@@XZ" +// CHECK: "?e3@@YAPAW4Enum@@XZ" Enum& e4() { return *(Enum*)0; } -// CHECK: "\01?e4@@YAAAW4Enum@@XZ" +// CHECK: "?e4@@YAAAW4Enum@@XZ" struct S {}; struct S f1() { struct S s; return s; } -// CHECK: "\01?f1@@YA?AUS@@XZ" +// CHECK: "?f1@@YA?AUS@@XZ" const struct S f2() { struct S s; return s; } -// CHECK: "\01?f2@@YA?BUS@@XZ" +// CHECK: "?f2@@YA?BUS@@XZ" struct S* f3() { return 0; } -// CHECK: "\01?f3@@YAPAUS@@XZ" +// CHECK: "?f3@@YAPAUS@@XZ" const struct S* f4() { return 0; } -// CHECK: "\01?f4@@YAPBUS@@XZ" +// CHECK: "?f4@@YAPBUS@@XZ" const volatile struct S* f5() { return 0; } -// CHECK: "\01?f5@@YAPDUS@@XZ" +// CHECK: "?f5@@YAPDUS@@XZ" struct S& f6() { return *(struct S*)0; } -// CHECK: "\01?f6@@YAAAUS@@XZ" +// CHECK: "?f6@@YAAAUS@@XZ" struct S* const f7() { return 0; } -// CHECK: "\01?f7@@YAQAUS@@XZ" +// CHECK: "?f7@@YAQAUS@@XZ" int S::* f8() { return 0; } -// CHECK: "\01?f8@@YAPQS@@HXZ" +// CHECK: "?f8@@YAPQS@@HXZ" int S::* const f9() { return 0; } -// CHECK: "\01?f9@@YAQQS@@HXZ" +// CHECK: "?f9@@YAQQS@@HXZ" int S::* __restrict f10() { return 0; } -// CHECK: "\01?f10@@YAPIQS@@HXZ" +// CHECK: "?f10@@YAPIQS@@HXZ" int S::* const __restrict f11() { return 0; } -// CHECK: "\01?f11@@YAQIQS@@HXZ" +// CHECK: "?f11@@YAQIQS@@HXZ" typedef int (*function_pointer)(int); function_pointer g1() { return 0; } -// CHECK: "\01?g1@@YAP6AHH@ZXZ" +// CHECK: "?g1@@YAP6AHH@ZXZ" const function_pointer g2() { return 0; } -// CHECK: "\01?g2@@YAQ6AHH@ZXZ" +// CHECK: "?g2@@YAQ6AHH@ZXZ" function_pointer* g3() { return 0; } -// CHECK: "\01?g3@@YAPAP6AHH@ZXZ" +// CHECK: "?g3@@YAPAP6AHH@ZXZ" const function_pointer* g4() { return 0; } -// CHECK: "\01?g4@@YAPBQ6AHH@ZXZ" +// CHECK: "?g4@@YAPBQ6AHH@ZXZ" extern int &z; int & __restrict h1() { return z; } -// CHECK: "\01?h1@@YAAIAHXZ" +// CHECK: "?h1@@YAAIAHXZ" diff --git a/test/CodeGenCXX/mangle-ms-string-literals.cpp b/test/CodeGenCXX/mangle-ms-string-literals.cpp index e5ebc086e1488..214586d7329c5 100644 --- a/test/CodeGenCXX/mangle-ms-string-literals.cpp +++ b/test/CodeGenCXX/mangle-ms-string-literals.cpp @@ -258,262 +258,262 @@ const char *l2 = "\x2"; const char *l1 = "\x1"; const char *l0 = "\x0"; -// CHECK: @"\01??_C@_01CNACBAHC@?$PP?$AA@" -// CHECK: @"\01??_C@_01DEBJCBDD@?$PO?$AA@" -// CHECK: @"\01??_C@_01BPDEHCPA@?$PN?$AA@" -// CHECK: @"\01??_C@_01GCPEDLB@?$PM?$AA@" -// CHECK: @"\01??_C@_01EJGONFHG@?$PL?$AA@" -// CHECK: @"\01??_C@_01FAHFOEDH@?z?$AA@" -// CHECK: @"\01??_C@_01HLFILHPE@?y?$AA@" -// CHECK: @"\01??_C@_01GCEDIGLF@?x?$AA@" -// CHECK: @"\01??_C@_01OFNLJKHK@?w?$AA@" -// CHECK: @"\01??_C@_01PMMAKLDL@?v?$AA@" -// CHECK: @"\01??_C@_01NHONPIPI@?u?$AA@" -// CHECK: @"\01??_C@_01MOPGMJLJ@?t?$AA@" -// CHECK: @"\01??_C@_01IBLHFPHO@?s?$AA@" -// CHECK: @"\01??_C@_01JIKMGODP@?r?$AA@" -// CHECK: @"\01??_C@_01LDIBDNPM@?q?$AA@" -// CHECK: @"\01??_C@_01KKJKAMLN@?p?$AA@" -// CHECK: @"\01??_C@_01GHMAACCD@?o?$AA@" -// CHECK: @"\01??_C@_01HONLDDGC@?n?$AA@" -// CHECK: @"\01??_C@_01FFPGGAKB@?m?$AA@" -// CHECK: @"\01??_C@_01EMONFBOA@?l?$AA@" -// CHECK: @"\01??_C@_01DKMMHCH@?k?$AA@" -// CHECK: @"\01??_C@_01BKLHPGGG@?j?$AA@" -// CHECK: @"\01??_C@_01DBJKKFKF@?i?$AA@" -// CHECK: @"\01??_C@_01CIIBJEOE@?h?$AA@" -// CHECK: @"\01??_C@_01KPBJIICL@?g?$AA@" -// CHECK: @"\01??_C@_01LGACLJGK@?f?$AA@" -// CHECK: @"\01??_C@_01JNCPOKKJ@?e?$AA@" -// CHECK: @"\01??_C@_01IEDENLOI@?d?$AA@" -// CHECK: @"\01??_C@_01MLHFENCP@?c?$AA@" -// CHECK: @"\01??_C@_01NCGOHMGO@?b?$AA@" -// CHECK: @"\01??_C@_01PJEDCPKN@?a?$AA@" -// CHECK: @"\01??_C@_01OAFIBOOM@?$OA?$AA@" -// CHECK: @"\01??_C@_01LIIGDENA@?$NP?$AA@" -// CHECK: @"\01??_C@_01KBJNAFJB@?$NO?$AA@" -// CHECK: @"\01??_C@_01IKLAFGFC@?$NN?$AA@" -// CHECK: @"\01??_C@_01JDKLGHBD@?$NM?$AA@" -// CHECK: @"\01??_C@_01NMOKPBNE@?$NL?$AA@" -// CHECK: @"\01??_C@_01MFPBMAJF@?Z?$AA@" -// CHECK: @"\01??_C@_01OONMJDFG@?Y?$AA@" -// CHECK: @"\01??_C@_01PHMHKCBH@?X?$AA@" -// CHECK: @"\01??_C@_01HAFPLONI@?W?$AA@" -// CHECK: @"\01??_C@_01GJEEIPJJ@?V?$AA@" -// CHECK: @"\01??_C@_01ECGJNMFK@?U?$AA@" -// CHECK: @"\01??_C@_01FLHCONBL@?T?$AA@" -// CHECK: @"\01??_C@_01BEDDHLNM@?S?$AA@" -// CHECK: @"\01??_C@_01NCIEKJN@?R?$AA@" -// CHECK: @"\01??_C@_01CGAFBJFO@?Q?$AA@" -// CHECK: @"\01??_C@_01DPBOCIBP@?P?$AA@" -// CHECK: @"\01??_C@_01PCEECGIB@?O?$AA@" -// CHECK: @"\01??_C@_01OLFPBHMA@?N?$AA@" -// CHECK: @"\01??_C@_01MAHCEEAD@?M?$AA@" -// CHECK: @"\01??_C@_01NJGJHFEC@?L?$AA@" -// CHECK: @"\01??_C@_01JGCIODIF@?K?$AA@" -// CHECK: @"\01??_C@_01IPDDNCME@?J?$AA@" -// CHECK: @"\01??_C@_01KEBOIBAH@?I?$AA@" -// CHECK: @"\01??_C@_01LNAFLAEG@?H?$AA@" -// CHECK: @"\01??_C@_01DKJNKMIJ@?G?$AA@" -// CHECK: @"\01??_C@_01CDIGJNMI@?F?$AA@" -// CHECK: @"\01??_C@_01IKLMOAL@?E?$AA@" -// CHECK: @"\01??_C@_01BBLAPPEK@?D?$AA@" -// CHECK: @"\01??_C@_01FOPBGJIN@?C?$AA@" -// CHECK: @"\01??_C@_01EHOKFIMM@?B?$AA@" -// CHECK: @"\01??_C@_01GMMHALAP@?A?$AA@" -// CHECK: @"\01??_C@_01HFNMDKEO@?$MA?$AA@" -// CHECK: @"\01??_C@_01NNHLFPHH@?$LP?$AA@" -// CHECK: @"\01??_C@_01MEGAGODG@?$LO?$AA@" -// CHECK: @"\01??_C@_01OPENDNPF@?$LN?$AA@" -// CHECK: @"\01??_C@_01PGFGAMLE@?$LM?$AA@" -// CHECK: @"\01??_C@_01LJBHJKHD@?$LL?$AA@" -// CHECK: @"\01??_C@_01KAAMKLDC@?$LK?$AA@" -// CHECK: @"\01??_C@_01ILCBPIPB@?$LJ?$AA@" -// CHECK: @"\01??_C@_01JCDKMJLA@?$LI?$AA@" -// CHECK: @"\01??_C@_01BFKCNFHP@?$LH?$AA@" -// CHECK: @"\01??_C@_01MLJOEDO@?$LG?$AA@" -// CHECK: @"\01??_C@_01CHJELHPN@?$LF?$AA@" -// CHECK: @"\01??_C@_01DOIPIGLM@?$LE?$AA@" -// CHECK: @"\01??_C@_01HBMOBAHL@?$LD?$AA@" -// CHECK: @"\01??_C@_01GINFCBDK@?$LC?$AA@" -// CHECK: @"\01??_C@_01EDPIHCPJ@?$LB?$AA@" -// CHECK: @"\01??_C@_01FKODEDLI@?$LA?$AA@" -// CHECK: @"\01??_C@_01JHLJENCG@?$KP?$AA@" -// CHECK: @"\01??_C@_01IOKCHMGH@?$KO?$AA@" -// CHECK: @"\01??_C@_01KFIPCPKE@?$KN?$AA@" -// CHECK: @"\01??_C@_01LMJEBOOF@?$KM?$AA@" -// CHECK: @"\01??_C@_01PDNFIICC@?$KL?$AA@" -// CHECK: @"\01??_C@_01OKMOLJGD@?$KK?$AA@" -// CHECK: @"\01??_C@_01MBODOKKA@?$KJ?$AA@" -// CHECK: @"\01??_C@_01NIPINLOB@?$KI?$AA@" -// CHECK: @"\01??_C@_01FPGAMHCO@?$KH?$AA@" -// CHECK: @"\01??_C@_01EGHLPGGP@?$KG?$AA@" -// CHECK: @"\01??_C@_01GNFGKFKM@?$KF?$AA@" -// CHECK: @"\01??_C@_01HEENJEON@?$KE?$AA@" -// CHECK: @"\01??_C@_01DLAMACCK@?$KD?$AA@" -// CHECK: @"\01??_C@_01CCBHDDGL@?$KC?$AA@" -// CHECK: @"\01??_C@_01JDKGAKI@?$KB?$AA@" -// CHECK: @"\01??_C@_01BACBFBOJ@?$KA?$AA@" -// CHECK: @"\01??_C@_01EIPPHLNF@?$JP?$AA@" -// CHECK: @"\01??_C@_01FBOEEKJE@?$JO?$AA@" -// CHECK: @"\01??_C@_01HKMJBJFH@?$JN?$AA@" -// CHECK: @"\01??_C@_01GDNCCIBG@?$JM?$AA@" -// CHECK: @"\01??_C@_01CMJDLONB@?$JL?$AA@" -// CHECK: @"\01??_C@_01DFIIIPJA@?$JK?$AA@" -// CHECK: @"\01??_C@_01BOKFNMFD@?$JJ?$AA@" -// CHECK: @"\01??_C@_01HLOONBC@?$JI?$AA@" -// CHECK: @"\01??_C@_01IACGPBNN@?$JH?$AA@" -// CHECK: @"\01??_C@_01JJDNMAJM@?$JG?$AA@" -// CHECK: @"\01??_C@_01LCBAJDFP@?$JF?$AA@" -// CHECK: @"\01??_C@_01KLALKCBO@?$JE?$AA@" -// CHECK: @"\01??_C@_01OEEKDENJ@?$JD?$AA@" -// CHECK: @"\01??_C@_01PNFBAFJI@?$JC?$AA@" -// CHECK: @"\01??_C@_01NGHMFGFL@?$JB?$AA@" -// CHECK: @"\01??_C@_01MPGHGHBK@?$JA?$AA@" -// CHECK: @"\01??_C@_01CDNGJIE@?$IP?$AA@" -// CHECK: @"\01??_C@_01BLCGFIMF@?$IO?$AA@" -// CHECK: @"\01??_C@_01DAALALAG@?$IN?$AA@" -// CHECK: @"\01??_C@_01CJBADKEH@?$IM?$AA@" -// CHECK: @"\01??_C@_01GGFBKMIA@?$IL?$AA@" -// CHECK: @"\01??_C@_01HPEKJNMB@?$IK?$AA@" -// CHECK: @"\01??_C@_01FEGHMOAC@?$IJ?$AA@" -// CHECK: @"\01??_C@_01ENHMPPED@?$II?$AA@" -// CHECK: @"\01??_C@_01MKOEODIM@?$IH?$AA@" -// CHECK: @"\01??_C@_01NDPPNCMN@?$IG?$AA@" -// CHECK: @"\01??_C@_01PINCIBAO@?$IF?$AA@" -// CHECK: @"\01??_C@_01OBMJLAEP@?$IE?$AA@" -// CHECK: @"\01??_C@_01KOIICGII@?$ID?$AA@" -// CHECK: @"\01??_C@_01LHJDBHMJ@?$IC?$AA@" -// CHECK: @"\01??_C@_01JMLOEEAK@?$IB?$AA@" -// CHECK: @"\01??_C@_01IFKFHFEL@?$IA?$AA@" -// CHECK: @"\01??_C@_01BGIBIIDJ@?$HP?$AA@" -// CHECK: @"\01??_C@_01PJKLJHI@?$HO?$AA@" -// CHECK: @"\01??_C@_01CELHOKLL@?$HN?$AA@" -// CHECK: @"\01??_C@_01DNKMNLPK@?$HM?$AA@" -// CHECK: @"\01??_C@_01HCONENDN@?$HL?$AA@" -// CHECK: @"\01??_C@_01GLPGHMHM@z?$AA@" -// CHECK: @"\01??_C@_01EANLCPLP@y?$AA@" -// CHECK: @"\01??_C@_01FJMABOPO@x?$AA@" -// CHECK: @"\01??_C@_01NOFIACDB@w?$AA@" -// CHECK: @"\01??_C@_01MHEDDDHA@v?$AA@" -// CHECK: @"\01??_C@_01OMGOGALD@u?$AA@" -// CHECK: @"\01??_C@_01PFHFFBPC@t?$AA@" -// CHECK: @"\01??_C@_01LKDEMHDF@s?$AA@" -// CHECK: @"\01??_C@_01KDCPPGHE@r?$AA@" -// CHECK: @"\01??_C@_01IIACKFLH@q?$AA@" -// CHECK: @"\01??_C@_01JBBJJEPG@p?$AA@" -// CHECK: @"\01??_C@_01FMEDJKGI@o?$AA@" -// CHECK: @"\01??_C@_01EFFIKLCJ@n?$AA@" -// CHECK: @"\01??_C@_01GOHFPIOK@m?$AA@" -// CHECK: @"\01??_C@_01HHGOMJKL@l?$AA@" -// CHECK: @"\01??_C@_01DICPFPGM@k?$AA@" -// CHECK: @"\01??_C@_01CBDEGOCN@j?$AA@" -// CHECK: @"\01??_C@_01KBJDNOO@i?$AA@" -// CHECK: @"\01??_C@_01BDACAMKP@h?$AA@" -// CHECK: @"\01??_C@_01JEJKBAGA@g?$AA@" -// CHECK: @"\01??_C@_01INIBCBCB@f?$AA@" -// CHECK: @"\01??_C@_01KGKMHCOC@e?$AA@" -// CHECK: @"\01??_C@_01LPLHEDKD@d?$AA@" -// CHECK: @"\01??_C@_01PAPGNFGE@c?$AA@" -// CHECK: @"\01??_C@_01OJONOECF@b?$AA@" -// CHECK: @"\01??_C@_01MCMALHOG@a?$AA@" -// CHECK: @"\01??_C@_01NLNLIGKH@?$GA?$AA@" -// CHECK: @"\01??_C@_01IDAFKMJL@_?$AA@" -// CHECK: @"\01??_C@_01JKBOJNNK@?$FO?$AA@" -// CHECK: @"\01??_C@_01LBDDMOBJ@?$FN?$AA@" -// CHECK: @"\01??_C@_01KICIPPFI@?2?$AA@" -// CHECK: @"\01??_C@_01OHGJGJJP@?$FL?$AA@" -// CHECK: @"\01??_C@_01POHCFINO@Z?$AA@" -// CHECK: @"\01??_C@_01NFFPALBN@Y?$AA@" -// CHECK: @"\01??_C@_01MMEEDKFM@X?$AA@" -// CHECK: @"\01??_C@_01ELNMCGJD@W?$AA@" -// CHECK: @"\01??_C@_01FCMHBHNC@V?$AA@" -// CHECK: @"\01??_C@_01HJOKEEBB@U?$AA@" -// CHECK: @"\01??_C@_01GAPBHFFA@T?$AA@" -// CHECK: @"\01??_C@_01CPLAODJH@S?$AA@" -// CHECK: @"\01??_C@_01DGKLNCNG@R?$AA@" -// CHECK: @"\01??_C@_01BNIGIBBF@Q?$AA@" -// CHECK: @"\01??_C@_01EJNLAFE@P?$AA@" -// CHECK: @"\01??_C@_01MJMHLOMK@O?$AA@" -// CHECK: @"\01??_C@_01NANMIPIL@N?$AA@" -// CHECK: @"\01??_C@_01PLPBNMEI@M?$AA@" -// CHECK: @"\01??_C@_01OCOKONAJ@L?$AA@" -// CHECK: @"\01??_C@_01KNKLHLMO@K?$AA@" -// CHECK: @"\01??_C@_01LELAEKIP@J?$AA@" -// CHECK: @"\01??_C@_01JPJNBJEM@I?$AA@" -// CHECK: @"\01??_C@_01IGIGCIAN@H?$AA@" -// CHECK: @"\01??_C@_01BBODEMC@G?$AA@" -// CHECK: @"\01??_C@_01BIAFAFID@F?$AA@" -// CHECK: @"\01??_C@_01DDCIFGEA@E?$AA@" -// CHECK: @"\01??_C@_01CKDDGHAB@D?$AA@" -// CHECK: @"\01??_C@_01GFHCPBMG@C?$AA@" -// CHECK: @"\01??_C@_01HMGJMAIH@B?$AA@" -// CHECK: @"\01??_C@_01FHEEJDEE@A?$AA@" -// CHECK: @"\01??_C@_01EOFPKCAF@?$EA?$AA@" -// CHECK: @"\01??_C@_01OGPIMHDM@?$DP?$AA@" -// CHECK: @"\01??_C@_01PPODPGHN@?$DO?$AA@" -// CHECK: @"\01??_C@_01NEMOKFLO@?$DN?$AA@" -// CHECK: @"\01??_C@_01MNNFJEPP@?$DM?$AA@" -// CHECK: @"\01??_C@_01ICJEACDI@?$DL?$AA@" -// CHECK: @"\01??_C@_01JLIPDDHJ@?3?$AA@" -// CHECK: @"\01??_C@_01LAKCGALK@9?$AA@" -// CHECK: @"\01??_C@_01KJLJFBPL@8?$AA@" -// CHECK: @"\01??_C@_01COCBENDE@7?$AA@" -// CHECK: @"\01??_C@_01DHDKHMHF@6?$AA@" -// CHECK: @"\01??_C@_01BMBHCPLG@5?$AA@" -// CHECK: @"\01??_C@_01FAMBOPH@4?$AA@" -// CHECK: @"\01??_C@_01EKENIIDA@3?$AA@" -// CHECK: @"\01??_C@_01FDFGLJHB@2?$AA@" -// CHECK: @"\01??_C@_01HIHLOKLC@1?$AA@" -// CHECK: @"\01??_C@_01GBGANLPD@0?$AA@" -// CHECK: @"\01??_C@_01KMDKNFGN@?1?$AA@" -// CHECK: @"\01??_C@_01LFCBOECM@?4?$AA@" -// CHECK: @"\01??_C@_01JOAMLHOP@?9?$AA@" -// CHECK: @"\01??_C@_01IHBHIGKO@?0?$AA@" -// CHECK: @"\01??_C@_01MIFGBAGJ@?$CL?$AA@" -// CHECK: @"\01??_C@_01NBENCBCI@?$CK?$AA@" -// CHECK: @"\01??_C@_01PKGAHCOL@?$CJ?$AA@" -// CHECK: @"\01??_C@_01ODHLEDKK@?$CI?$AA@" -// CHECK: @"\01??_C@_01GEODFPGF@?8?$AA@" -// CHECK: @"\01??_C@_01HNPIGOCE@?$CG?$AA@" -// CHECK: @"\01??_C@_01FGNFDNOH@?$CF?$AA@" -// CHECK: @"\01??_C@_01EPMOAMKG@$?$AA@" -// CHECK: @"\01??_C@_01IPJKGB@?$CD?$AA@" -// CHECK: @"\01??_C@_01BJJEKLCA@?$CC?$AA@" -// CHECK: @"\01??_C@_01DCLJPIOD@?$CB?$AA@" -// CHECK: @"\01??_C@_01CLKCMJKC@?5?$AA@" -// CHECK: @"\01??_C@_01HDHMODJO@?$BP?$AA@" -// CHECK: @"\01??_C@_01GKGHNCNP@?$BO?$AA@" -// CHECK: @"\01??_C@_01EBEKIBBM@?$BN?$AA@" -// CHECK: @"\01??_C@_01FIFBLAFN@?$BM?$AA@" -// CHECK: @"\01??_C@_01BHBACGJK@?$BL?$AA@" -// CHECK: @"\01??_C@_01OALBHNL@?$BK?$AA@" -// CHECK: @"\01??_C@_01CFCGEEBI@?$BJ?$AA@" -// CHECK: @"\01??_C@_01DMDNHFFJ@?$BI?$AA@" -// CHECK: @"\01??_C@_01LLKFGJJG@?$BH?$AA@" -// CHECK: @"\01??_C@_01KCLOFINH@?$BG?$AA@" -// CHECK: @"\01??_C@_01IJJDALBE@?$BF?$AA@" -// CHECK: @"\01??_C@_01JAIIDKFF@?$BE?$AA@" -// CHECK: @"\01??_C@_01NPMJKMJC@?$BD?$AA@" -// CHECK: @"\01??_C@_01MGNCJNND@?$BC?$AA@" -// CHECK: @"\01??_C@_01ONPPMOBA@?$BB?$AA@" -// CHECK: @"\01??_C@_01PEOEPPFB@?$BA?$AA@" -// CHECK: @"\01??_C@_01DJLOPBMP@?$AP?$AA@" -// CHECK: @"\01??_C@_01CAKFMAIO@?$AO?$AA@" -// CHECK: @"\01??_C@_01LIIJDEN@?$AN?$AA@" -// CHECK: @"\01??_C@_01BCJDKCAM@?$AM?$AA@" -// CHECK: @"\01??_C@_01FNNCDEML@?$AL?$AA@" -// CHECK: @"\01??_C@_01EEMJAFIK@?6?$AA@" -// CHECK: @"\01??_C@_01GPOEFGEJ@?7?$AA@" -// CHECK: @"\01??_C@_01HGPPGHAI@?$AI?$AA@" -// CHECK: @"\01??_C@_01PBGHHLMH@?$AH?$AA@" -// CHECK: @"\01??_C@_01OIHMEKIG@?$AG?$AA@" -// CHECK: @"\01??_C@_01MDFBBJEF@?$AF?$AA@" -// CHECK: @"\01??_C@_01NKEKCIAE@?$AE?$AA@" -// CHECK: @"\01??_C@_01JFALLOMD@?$AD?$AA@" -// CHECK: @"\01??_C@_01IMBAIPIC@?$AC?$AA@" -// CHECK: @"\01??_C@_01KHDNNMEB@?$AB?$AA@" -// CHECK: @"\01??_C@_01LOCGONAA@?$AA?$AA@" +// CHECK: @"??_C@_01CNACBAHC@?$PP?$AA@" +// CHECK: @"??_C@_01DEBJCBDD@?$PO?$AA@" +// CHECK: @"??_C@_01BPDEHCPA@?$PN?$AA@" +// CHECK: @"??_C@_01GCPEDLB@?$PM?$AA@" +// CHECK: @"??_C@_01EJGONFHG@?$PL?$AA@" +// CHECK: @"??_C@_01FAHFOEDH@?z?$AA@" +// CHECK: @"??_C@_01HLFILHPE@?y?$AA@" +// CHECK: @"??_C@_01GCEDIGLF@?x?$AA@" +// CHECK: @"??_C@_01OFNLJKHK@?w?$AA@" +// CHECK: @"??_C@_01PMMAKLDL@?v?$AA@" +// CHECK: @"??_C@_01NHONPIPI@?u?$AA@" +// CHECK: @"??_C@_01MOPGMJLJ@?t?$AA@" +// CHECK: @"??_C@_01IBLHFPHO@?s?$AA@" +// CHECK: @"??_C@_01JIKMGODP@?r?$AA@" +// CHECK: @"??_C@_01LDIBDNPM@?q?$AA@" +// CHECK: @"??_C@_01KKJKAMLN@?p?$AA@" +// CHECK: @"??_C@_01GHMAACCD@?o?$AA@" +// CHECK: @"??_C@_01HONLDDGC@?n?$AA@" +// CHECK: @"??_C@_01FFPGGAKB@?m?$AA@" +// CHECK: @"??_C@_01EMONFBOA@?l?$AA@" +// CHECK: @"??_C@_01DKMMHCH@?k?$AA@" +// CHECK: @"??_C@_01BKLHPGGG@?j?$AA@" +// CHECK: @"??_C@_01DBJKKFKF@?i?$AA@" +// CHECK: @"??_C@_01CIIBJEOE@?h?$AA@" +// CHECK: @"??_C@_01KPBJIICL@?g?$AA@" +// CHECK: @"??_C@_01LGACLJGK@?f?$AA@" +// CHECK: @"??_C@_01JNCPOKKJ@?e?$AA@" +// CHECK: @"??_C@_01IEDENLOI@?d?$AA@" +// CHECK: @"??_C@_01MLHFENCP@?c?$AA@" +// CHECK: @"??_C@_01NCGOHMGO@?b?$AA@" +// CHECK: @"??_C@_01PJEDCPKN@?a?$AA@" +// CHECK: @"??_C@_01OAFIBOOM@?$OA?$AA@" +// CHECK: @"??_C@_01LIIGDENA@?$NP?$AA@" +// CHECK: @"??_C@_01KBJNAFJB@?$NO?$AA@" +// CHECK: @"??_C@_01IKLAFGFC@?$NN?$AA@" +// CHECK: @"??_C@_01JDKLGHBD@?$NM?$AA@" +// CHECK: @"??_C@_01NMOKPBNE@?$NL?$AA@" +// CHECK: @"??_C@_01MFPBMAJF@?Z?$AA@" +// CHECK: @"??_C@_01OONMJDFG@?Y?$AA@" +// CHECK: @"??_C@_01PHMHKCBH@?X?$AA@" +// CHECK: @"??_C@_01HAFPLONI@?W?$AA@" +// CHECK: @"??_C@_01GJEEIPJJ@?V?$AA@" +// CHECK: @"??_C@_01ECGJNMFK@?U?$AA@" +// CHECK: @"??_C@_01FLHCONBL@?T?$AA@" +// CHECK: @"??_C@_01BEDDHLNM@?S?$AA@" +// CHECK: @"??_C@_01NCIEKJN@?R?$AA@" +// CHECK: @"??_C@_01CGAFBJFO@?Q?$AA@" +// CHECK: @"??_C@_01DPBOCIBP@?P?$AA@" +// CHECK: @"??_C@_01PCEECGIB@?O?$AA@" +// CHECK: @"??_C@_01OLFPBHMA@?N?$AA@" +// CHECK: @"??_C@_01MAHCEEAD@?M?$AA@" +// CHECK: @"??_C@_01NJGJHFEC@?L?$AA@" +// CHECK: @"??_C@_01JGCIODIF@?K?$AA@" +// CHECK: @"??_C@_01IPDDNCME@?J?$AA@" +// CHECK: @"??_C@_01KEBOIBAH@?I?$AA@" +// CHECK: @"??_C@_01LNAFLAEG@?H?$AA@" +// CHECK: @"??_C@_01DKJNKMIJ@?G?$AA@" +// CHECK: @"??_C@_01CDIGJNMI@?F?$AA@" +// CHECK: @"??_C@_01IKLMOAL@?E?$AA@" +// CHECK: @"??_C@_01BBLAPPEK@?D?$AA@" +// CHECK: @"??_C@_01FOPBGJIN@?C?$AA@" +// CHECK: @"??_C@_01EHOKFIMM@?B?$AA@" +// CHECK: @"??_C@_01GMMHALAP@?A?$AA@" +// CHECK: @"??_C@_01HFNMDKEO@?$MA?$AA@" +// CHECK: @"??_C@_01NNHLFPHH@?$LP?$AA@" +// CHECK: @"??_C@_01MEGAGODG@?$LO?$AA@" +// CHECK: @"??_C@_01OPENDNPF@?$LN?$AA@" +// CHECK: @"??_C@_01PGFGAMLE@?$LM?$AA@" +// CHECK: @"??_C@_01LJBHJKHD@?$LL?$AA@" +// CHECK: @"??_C@_01KAAMKLDC@?$LK?$AA@" +// CHECK: @"??_C@_01ILCBPIPB@?$LJ?$AA@" +// CHECK: @"??_C@_01JCDKMJLA@?$LI?$AA@" +// CHECK: @"??_C@_01BFKCNFHP@?$LH?$AA@" +// CHECK: @"??_C@_01MLJOEDO@?$LG?$AA@" +// CHECK: @"??_C@_01CHJELHPN@?$LF?$AA@" +// CHECK: @"??_C@_01DOIPIGLM@?$LE?$AA@" +// CHECK: @"??_C@_01HBMOBAHL@?$LD?$AA@" +// CHECK: @"??_C@_01GINFCBDK@?$LC?$AA@" +// CHECK: @"??_C@_01EDPIHCPJ@?$LB?$AA@" +// CHECK: @"??_C@_01FKODEDLI@?$LA?$AA@" +// CHECK: @"??_C@_01JHLJENCG@?$KP?$AA@" +// CHECK: @"??_C@_01IOKCHMGH@?$KO?$AA@" +// CHECK: @"??_C@_01KFIPCPKE@?$KN?$AA@" +// CHECK: @"??_C@_01LMJEBOOF@?$KM?$AA@" +// CHECK: @"??_C@_01PDNFIICC@?$KL?$AA@" +// CHECK: @"??_C@_01OKMOLJGD@?$KK?$AA@" +// CHECK: @"??_C@_01MBODOKKA@?$KJ?$AA@" +// CHECK: @"??_C@_01NIPINLOB@?$KI?$AA@" +// CHECK: @"??_C@_01FPGAMHCO@?$KH?$AA@" +// CHECK: @"??_C@_01EGHLPGGP@?$KG?$AA@" +// CHECK: @"??_C@_01GNFGKFKM@?$KF?$AA@" +// CHECK: @"??_C@_01HEENJEON@?$KE?$AA@" +// CHECK: @"??_C@_01DLAMACCK@?$KD?$AA@" +// CHECK: @"??_C@_01CCBHDDGL@?$KC?$AA@" +// CHECK: @"??_C@_01JDKGAKI@?$KB?$AA@" +// CHECK: @"??_C@_01BACBFBOJ@?$KA?$AA@" +// CHECK: @"??_C@_01EIPPHLNF@?$JP?$AA@" +// CHECK: @"??_C@_01FBOEEKJE@?$JO?$AA@" +// CHECK: @"??_C@_01HKMJBJFH@?$JN?$AA@" +// CHECK: @"??_C@_01GDNCCIBG@?$JM?$AA@" +// CHECK: @"??_C@_01CMJDLONB@?$JL?$AA@" +// CHECK: @"??_C@_01DFIIIPJA@?$JK?$AA@" +// CHECK: @"??_C@_01BOKFNMFD@?$JJ?$AA@" +// CHECK: @"??_C@_01HLOONBC@?$JI?$AA@" +// CHECK: @"??_C@_01IACGPBNN@?$JH?$AA@" +// CHECK: @"??_C@_01JJDNMAJM@?$JG?$AA@" +// CHECK: @"??_C@_01LCBAJDFP@?$JF?$AA@" +// CHECK: @"??_C@_01KLALKCBO@?$JE?$AA@" +// CHECK: @"??_C@_01OEEKDENJ@?$JD?$AA@" +// CHECK: @"??_C@_01PNFBAFJI@?$JC?$AA@" +// CHECK: @"??_C@_01NGHMFGFL@?$JB?$AA@" +// CHECK: @"??_C@_01MPGHGHBK@?$JA?$AA@" +// CHECK: @"??_C@_01CDNGJIE@?$IP?$AA@" +// CHECK: @"??_C@_01BLCGFIMF@?$IO?$AA@" +// CHECK: @"??_C@_01DAALALAG@?$IN?$AA@" +// CHECK: @"??_C@_01CJBADKEH@?$IM?$AA@" +// CHECK: @"??_C@_01GGFBKMIA@?$IL?$AA@" +// CHECK: @"??_C@_01HPEKJNMB@?$IK?$AA@" +// CHECK: @"??_C@_01FEGHMOAC@?$IJ?$AA@" +// CHECK: @"??_C@_01ENHMPPED@?$II?$AA@" +// CHECK: @"??_C@_01MKOEODIM@?$IH?$AA@" +// CHECK: @"??_C@_01NDPPNCMN@?$IG?$AA@" +// CHECK: @"??_C@_01PINCIBAO@?$IF?$AA@" +// CHECK: @"??_C@_01OBMJLAEP@?$IE?$AA@" +// CHECK: @"??_C@_01KOIICGII@?$ID?$AA@" +// CHECK: @"??_C@_01LHJDBHMJ@?$IC?$AA@" +// CHECK: @"??_C@_01JMLOEEAK@?$IB?$AA@" +// CHECK: @"??_C@_01IFKFHFEL@?$IA?$AA@" +// CHECK: @"??_C@_01BGIBIIDJ@?$HP?$AA@" +// CHECK: @"??_C@_01PJKLJHI@?$HO?$AA@" +// CHECK: @"??_C@_01CELHOKLL@?$HN?$AA@" +// CHECK: @"??_C@_01DNKMNLPK@?$HM?$AA@" +// CHECK: @"??_C@_01HCONENDN@?$HL?$AA@" +// CHECK: @"??_C@_01GLPGHMHM@z?$AA@" +// CHECK: @"??_C@_01EANLCPLP@y?$AA@" +// CHECK: @"??_C@_01FJMABOPO@x?$AA@" +// CHECK: @"??_C@_01NOFIACDB@w?$AA@" +// CHECK: @"??_C@_01MHEDDDHA@v?$AA@" +// CHECK: @"??_C@_01OMGOGALD@u?$AA@" +// CHECK: @"??_C@_01PFHFFBPC@t?$AA@" +// CHECK: @"??_C@_01LKDEMHDF@s?$AA@" +// CHECK: @"??_C@_01KDCPPGHE@r?$AA@" +// CHECK: @"??_C@_01IIACKFLH@q?$AA@" +// CHECK: @"??_C@_01JBBJJEPG@p?$AA@" +// CHECK: @"??_C@_01FMEDJKGI@o?$AA@" +// CHECK: @"??_C@_01EFFIKLCJ@n?$AA@" +// CHECK: @"??_C@_01GOHFPIOK@m?$AA@" +// CHECK: @"??_C@_01HHGOMJKL@l?$AA@" +// CHECK: @"??_C@_01DICPFPGM@k?$AA@" +// CHECK: @"??_C@_01CBDEGOCN@j?$AA@" +// CHECK: @"??_C@_01KBJDNOO@i?$AA@" +// CHECK: @"??_C@_01BDACAMKP@h?$AA@" +// CHECK: @"??_C@_01JEJKBAGA@g?$AA@" +// CHECK: @"??_C@_01INIBCBCB@f?$AA@" +// CHECK: @"??_C@_01KGKMHCOC@e?$AA@" +// CHECK: @"??_C@_01LPLHEDKD@d?$AA@" +// CHECK: @"??_C@_01PAPGNFGE@c?$AA@" +// CHECK: @"??_C@_01OJONOECF@b?$AA@" +// CHECK: @"??_C@_01MCMALHOG@a?$AA@" +// CHECK: @"??_C@_01NLNLIGKH@?$GA?$AA@" +// CHECK: @"??_C@_01IDAFKMJL@_?$AA@" +// CHECK: @"??_C@_01JKBOJNNK@?$FO?$AA@" +// CHECK: @"??_C@_01LBDDMOBJ@?$FN?$AA@" +// CHECK: @"??_C@_01KICIPPFI@?2?$AA@" +// CHECK: @"??_C@_01OHGJGJJP@?$FL?$AA@" +// CHECK: @"??_C@_01POHCFINO@Z?$AA@" +// CHECK: @"??_C@_01NFFPALBN@Y?$AA@" +// CHECK: @"??_C@_01MMEEDKFM@X?$AA@" +// CHECK: @"??_C@_01ELNMCGJD@W?$AA@" +// CHECK: @"??_C@_01FCMHBHNC@V?$AA@" +// CHECK: @"??_C@_01HJOKEEBB@U?$AA@" +// CHECK: @"??_C@_01GAPBHFFA@T?$AA@" +// CHECK: @"??_C@_01CPLAODJH@S?$AA@" +// CHECK: @"??_C@_01DGKLNCNG@R?$AA@" +// CHECK: @"??_C@_01BNIGIBBF@Q?$AA@" +// CHECK: @"??_C@_01EJNLAFE@P?$AA@" +// CHECK: @"??_C@_01MJMHLOMK@O?$AA@" +// CHECK: @"??_C@_01NANMIPIL@N?$AA@" +// CHECK: @"??_C@_01PLPBNMEI@M?$AA@" +// CHECK: @"??_C@_01OCOKONAJ@L?$AA@" +// CHECK: @"??_C@_01KNKLHLMO@K?$AA@" +// CHECK: @"??_C@_01LELAEKIP@J?$AA@" +// CHECK: @"??_C@_01JPJNBJEM@I?$AA@" +// CHECK: @"??_C@_01IGIGCIAN@H?$AA@" +// CHECK: @"??_C@_01BBODEMC@G?$AA@" +// CHECK: @"??_C@_01BIAFAFID@F?$AA@" +// CHECK: @"??_C@_01DDCIFGEA@E?$AA@" +// CHECK: @"??_C@_01CKDDGHAB@D?$AA@" +// CHECK: @"??_C@_01GFHCPBMG@C?$AA@" +// CHECK: @"??_C@_01HMGJMAIH@B?$AA@" +// CHECK: @"??_C@_01FHEEJDEE@A?$AA@" +// CHECK: @"??_C@_01EOFPKCAF@?$EA?$AA@" +// CHECK: @"??_C@_01OGPIMHDM@?$DP?$AA@" +// CHECK: @"??_C@_01PPODPGHN@?$DO?$AA@" +// CHECK: @"??_C@_01NEMOKFLO@?$DN?$AA@" +// CHECK: @"??_C@_01MNNFJEPP@?$DM?$AA@" +// CHECK: @"??_C@_01ICJEACDI@?$DL?$AA@" +// CHECK: @"??_C@_01JLIPDDHJ@?3?$AA@" +// CHECK: @"??_C@_01LAKCGALK@9?$AA@" +// CHECK: @"??_C@_01KJLJFBPL@8?$AA@" +// CHECK: @"??_C@_01COCBENDE@7?$AA@" +// CHECK: @"??_C@_01DHDKHMHF@6?$AA@" +// CHECK: @"??_C@_01BMBHCPLG@5?$AA@" +// CHECK: @"??_C@_01FAMBOPH@4?$AA@" +// CHECK: @"??_C@_01EKENIIDA@3?$AA@" +// CHECK: @"??_C@_01FDFGLJHB@2?$AA@" +// CHECK: @"??_C@_01HIHLOKLC@1?$AA@" +// CHECK: @"??_C@_01GBGANLPD@0?$AA@" +// CHECK: @"??_C@_01KMDKNFGN@?1?$AA@" +// CHECK: @"??_C@_01LFCBOECM@?4?$AA@" +// CHECK: @"??_C@_01JOAMLHOP@?9?$AA@" +// CHECK: @"??_C@_01IHBHIGKO@?0?$AA@" +// CHECK: @"??_C@_01MIFGBAGJ@?$CL?$AA@" +// CHECK: @"??_C@_01NBENCBCI@?$CK?$AA@" +// CHECK: @"??_C@_01PKGAHCOL@?$CJ?$AA@" +// CHECK: @"??_C@_01ODHLEDKK@?$CI?$AA@" +// CHECK: @"??_C@_01GEODFPGF@?8?$AA@" +// CHECK: @"??_C@_01HNPIGOCE@?$CG?$AA@" +// CHECK: @"??_C@_01FGNFDNOH@?$CF?$AA@" +// CHECK: @"??_C@_01EPMOAMKG@$?$AA@" +// CHECK: @"??_C@_01IPJKGB@?$CD?$AA@" +// CHECK: @"??_C@_01BJJEKLCA@?$CC?$AA@" +// CHECK: @"??_C@_01DCLJPIOD@?$CB?$AA@" +// CHECK: @"??_C@_01CLKCMJKC@?5?$AA@" +// CHECK: @"??_C@_01HDHMODJO@?$BP?$AA@" +// CHECK: @"??_C@_01GKGHNCNP@?$BO?$AA@" +// CHECK: @"??_C@_01EBEKIBBM@?$BN?$AA@" +// CHECK: @"??_C@_01FIFBLAFN@?$BM?$AA@" +// CHECK: @"??_C@_01BHBACGJK@?$BL?$AA@" +// CHECK: @"??_C@_01OALBHNL@?$BK?$AA@" +// CHECK: @"??_C@_01CFCGEEBI@?$BJ?$AA@" +// CHECK: @"??_C@_01DMDNHFFJ@?$BI?$AA@" +// CHECK: @"??_C@_01LLKFGJJG@?$BH?$AA@" +// CHECK: @"??_C@_01KCLOFINH@?$BG?$AA@" +// CHECK: @"??_C@_01IJJDALBE@?$BF?$AA@" +// CHECK: @"??_C@_01JAIIDKFF@?$BE?$AA@" +// CHECK: @"??_C@_01NPMJKMJC@?$BD?$AA@" +// CHECK: @"??_C@_01MGNCJNND@?$BC?$AA@" +// CHECK: @"??_C@_01ONPPMOBA@?$BB?$AA@" +// CHECK: @"??_C@_01PEOEPPFB@?$BA?$AA@" +// CHECK: @"??_C@_01DJLOPBMP@?$AP?$AA@" +// CHECK: @"??_C@_01CAKFMAIO@?$AO?$AA@" +// CHECK: @"??_C@_01LIIJDEN@?$AN?$AA@" +// CHECK: @"??_C@_01BCJDKCAM@?$AM?$AA@" +// CHECK: @"??_C@_01FNNCDEML@?$AL?$AA@" +// CHECK: @"??_C@_01EEMJAFIK@?6?$AA@" +// CHECK: @"??_C@_01GPOEFGEJ@?7?$AA@" +// CHECK: @"??_C@_01HGPPGHAI@?$AI?$AA@" +// CHECK: @"??_C@_01PBGHHLMH@?$AH?$AA@" +// CHECK: @"??_C@_01OIHMEKIG@?$AG?$AA@" +// CHECK: @"??_C@_01MDFBBJEF@?$AF?$AA@" +// CHECK: @"??_C@_01NKEKCIAE@?$AE?$AA@" +// CHECK: @"??_C@_01JFALLOMD@?$AD?$AA@" +// CHECK: @"??_C@_01IMBAIPIC@?$AC?$AA@" +// CHECK: @"??_C@_01KHDNNMEB@?$AB?$AA@" +// CHECK: @"??_C@_01LOCGONAA@?$AA?$AA@" const wchar_t *wl9 = L"\t"; const wchar_t *wl10 = L"\n"; @@ -614,114 +614,140 @@ const wchar_t *wl124 = L"|"; const wchar_t *wl125 = L"}"; const wchar_t *wl126 = L"~"; -// CHECK: @"\01??_C@_13KDLDGPGJ@?$AA?7?$AA?$AA@" -// CHECK: @"\01??_C@_13LBAGMAIH@?$AA?6?$AA?$AA@" -// CHECK: @"\01??_C@_13JLKKHOC@?$AA?$AL?$AA?$AA@" -// CHECK: @"\01??_C@_13HOIJIPNN@?$AA?5?$AA?$AA@" -// CHECK: @"\01??_C@_13MGDFOILI@?$AA?$CB?$AA?$AA@" -// CHECK: @"\01??_C@_13NEIAEHFG@?$AA?$CC?$AA?$AA@" -// CHECK: @"\01??_C@_13GMDMCADD@?$AA?$CD?$AA?$AA@" -// CHECK: @"\01??_C@_13PBOLBIIK@?$AA$?$AA?$AA@" -// CHECK: @"\01??_C@_13EJFHHPOP@?$AA?$CF?$AA?$AA@" -// CHECK: @"\01??_C@_13FLOCNAAB@?$AA?$CG?$AA?$AA@" -// CHECK: @"\01??_C@_13ODFOLHGE@?$AA?8?$AA?$AA@" -// CHECK: @"\01??_C@_13LLDNKHDC@?$AA?$CI?$AA?$AA@" -// CHECK: @"\01??_C@_13DIBMAFH@?$AA?$CJ?$AA?$AA@" -// CHECK: @"\01??_C@_13BBDEGPLJ@?$AA?$CK?$AA?$AA@" -// CHECK: @"\01??_C@_13KJIIAINM@?$AA?$CL?$AA?$AA@" -// CHECK: @"\01??_C@_13DEFPDAGF@?$AA?0?$AA?$AA@" -// CHECK: @"\01??_C@_13IMODFHAA@?$AA?9?$AA?$AA@" -// CHECK: @"\01??_C@_13JOFGPIOO@?$AA?4?$AA?$AA@" -// CHECK: @"\01??_C@_13CGOKJPIL@?$AA?1?$AA?$AA@" -// CHECK: @"\01??_C@_13COJANIEC@?$AA0?$AA?$AA@" -// CHECK: @"\01??_C@_13JGCMLPCH@?$AA1?$AA?$AA@" -// CHECK: @"\01??_C@_13IEJJBAMJ@?$AA2?$AA?$AA@" -// CHECK: @"\01??_C@_13DMCFHHKM@?$AA3?$AA?$AA@" -// CHECK: @"\01??_C@_13KBPCEPBF@?$AA4?$AA?$AA@" -// CHECK: @"\01??_C@_13BJEOCIHA@?$AA5?$AA?$AA@" -// CHECK: @"\01??_C@_13LPLIHJO@?$AA6?$AA?$AA@" -// CHECK: @"\01??_C@_13LDEHOAPL@?$AA7?$AA?$AA@" -// CHECK: @"\01??_C@_13OLCEPAKN@?$AA8?$AA?$AA@" -// CHECK: @"\01??_C@_13FDJIJHMI@?$AA9?$AA?$AA@" -// CHECK: @"\01??_C@_13EBCNDICG@?$AA?3?$AA?$AA@" -// CHECK: @"\01??_C@_13PJJBFPED@?$AA?$DL?$AA?$AA@" -// CHECK: @"\01??_C@_13GEEGGHPK@?$AA?$DM?$AA?$AA@" -// CHECK: @"\01??_C@_13NMPKAAJP@?$AA?$DN?$AA?$AA@" -// CHECK: @"\01??_C@_13MOEPKPHB@?$AA?$DO?$AA?$AA@" -// CHECK: @"\01??_C@_13HGPDMIBE@?$AA?$DP?$AA?$AA@" -// CHECK: @"\01??_C@_13EFKPHINO@?$AA?$EA?$AA?$AA@" -// CHECK: @"\01??_C@_13PNBDBPLL@?$AAA?$AA?$AA@" -// CHECK: @"\01??_C@_13OPKGLAFF@?$AAB?$AA?$AA@" -// CHECK: @"\01??_C@_13FHBKNHDA@?$AAC?$AA?$AA@" -// CHECK: @"\01??_C@_13MKMNOPIJ@?$AAD?$AA?$AA@" -// CHECK: @"\01??_C@_13HCHBIIOM@?$AAE?$AA?$AA@" -// CHECK: @"\01??_C@_13GAMECHAC@?$AAF?$AA?$AA@" -// CHECK: @"\01??_C@_13NIHIEAGH@?$AAG?$AA?$AA@" -// CHECK: @"\01??_C@_13IABLFADB@?$AAH?$AA?$AA@" -// CHECK: @"\01??_C@_13DIKHDHFE@?$AAI?$AA?$AA@" -// CHECK: @"\01??_C@_13CKBCJILK@?$AAJ?$AA?$AA@" -// CHECK: @"\01??_C@_13JCKOPPNP@?$AAK?$AA?$AA@" -// CHECK: @"\01??_C@_13PHJMHGG@?$AAL?$AA?$AA@" -// CHECK: @"\01??_C@_13LHMFKAAD@?$AAM?$AA?$AA@" -// CHECK: @"\01??_C@_13KFHAAPON@?$AAN?$AA?$AA@" -// CHECK: @"\01??_C@_13BNMMGIII@?$AAO?$AA?$AA@" -// CHECK: @"\01??_C@_13BFLGCPEB@?$AAP?$AA?$AA@" -// CHECK: @"\01??_C@_13KNAKEICE@?$AAQ?$AA?$AA@" -// CHECK: @"\01??_C@_13LPLPOHMK@?$AAR?$AA?$AA@" -// CHECK: @"\01??_C@_13HADIAKP@?$AAS?$AA?$AA@" -// CHECK: @"\01??_C@_13JKNELIBG@?$AAT?$AA?$AA@" -// CHECK: @"\01??_C@_13CCGINPHD@?$AAU?$AA?$AA@" -// CHECK: @"\01??_C@_13DANNHAJN@?$AAV?$AA?$AA@" -// CHECK: @"\01??_C@_13IIGBBHPI@?$AAW?$AA?$AA@" -// CHECK: @"\01??_C@_13NAACAHKO@?$AAX?$AA?$AA@" -// CHECK: @"\01??_C@_13GILOGAML@?$AAY?$AA?$AA@" -// CHECK: @"\01??_C@_13HKALMPCF@?$AAZ?$AA?$AA@" -// CHECK: @"\01??_C@_13MCLHKIEA@?$AA?$FL?$AA?$AA@" -// CHECK: @"\01??_C@_13FPGAJAPJ@?$AA?2?$AA?$AA@" -// CHECK: @"\01??_C@_13OHNMPHJM@?$AA?$FN?$AA?$AA@" -// CHECK: @"\01??_C@_13PFGJFIHC@?$AA?$FO?$AA?$AA@" -// CHECK: @"\01??_C@_13ENNFDPBH@?$AA_?$AA?$AA@" -// CHECK: @"\01??_C@_13OFJNNHOA@?$AA?$GA?$AA?$AA@" -// CHECK: @"\01??_C@_13FNCBLAIF@?$AAa?$AA?$AA@" -// CHECK: @"\01??_C@_13EPJEBPGL@?$AAb?$AA?$AA@" -// CHECK: @"\01??_C@_13PHCIHIAO@?$AAc?$AA?$AA@" -// CHECK: @"\01??_C@_13GKPPEALH@?$AAd?$AA?$AA@" -// CHECK: @"\01??_C@_13NCEDCHNC@?$AAe?$AA?$AA@" -// CHECK: @"\01??_C@_13MAPGIIDM@?$AAf?$AA?$AA@" -// CHECK: @"\01??_C@_13HIEKOPFJ@?$AAg?$AA?$AA@" -// CHECK: @"\01??_C@_13CACJPPAP@?$AAh?$AA?$AA@" -// CHECK: @"\01??_C@_13JIJFJIGK@?$AAi?$AA?$AA@" -// CHECK: @"\01??_C@_13IKCADHIE@?$AAj?$AA?$AA@" -// CHECK: @"\01??_C@_13DCJMFAOB@?$AAk?$AA?$AA@" -// CHECK: @"\01??_C@_13KPELGIFI@?$AAl?$AA?$AA@" -// CHECK: @"\01??_C@_13BHPHAPDN@?$AAm?$AA?$AA@" -// CHECK: @"\01??_C@_13FECKAND@?$AAn?$AA?$AA@" -// CHECK: @"\01??_C@_13LNPOMHLG@?$AAo?$AA?$AA@" -// CHECK: @"\01??_C@_13LFIEIAHP@?$AAp?$AA?$AA@" -// CHECK: @"\01??_C@_13NDIOHBK@?$AAq?$AA?$AA@" -// CHECK: @"\01??_C@_13BPINEIPE@?$AAr?$AA?$AA@" -// CHECK: @"\01??_C@_13KHDBCPJB@?$AAs?$AA?$AA@" -// CHECK: @"\01??_C@_13DKOGBHCI@?$AAt?$AA?$AA@" -// CHECK: @"\01??_C@_13ICFKHAEN@?$AAu?$AA?$AA@" -// CHECK: @"\01??_C@_13JAOPNPKD@?$AAv?$AA?$AA@" -// CHECK: @"\01??_C@_13CIFDLIMG@?$AAw?$AA?$AA@" -// CHECK: @"\01??_C@_13HADAKIJA@?$AAx?$AA?$AA@" -// CHECK: @"\01??_C@_13MIIMMPPF@?$AAy?$AA?$AA@" -// CHECK: @"\01??_C@_13NKDJGABL@?$AAz?$AA?$AA@" -// CHECK: @"\01??_C@_13GCIFAHHO@?$AA?$HL?$AA?$AA@" -// CHECK: @"\01??_C@_13PPFCDPMH@?$AA?$HM?$AA?$AA@" -// CHECK: @"\01??_C@_13EHOOFIKC@?$AA?$HN?$AA?$AA@" -// CHECK: @"\01??_C@_13FFFLPHEM@?$AA?$HO?$AA?$AA@" +// CHECK: @"??_C@_13KDLDGPGJ@?$AA?7?$AA?$AA@" +// CHECK: @"??_C@_13LBAGMAIH@?$AA?6?$AA?$AA@" +// CHECK: @"??_C@_13JLKKHOC@?$AA?$AL?$AA?$AA@" +// CHECK: @"??_C@_13HOIJIPNN@?$AA?5?$AA?$AA@" +// CHECK: @"??_C@_13MGDFOILI@?$AA?$CB?$AA?$AA@" +// CHECK: @"??_C@_13NEIAEHFG@?$AA?$CC?$AA?$AA@" +// CHECK: @"??_C@_13GMDMCADD@?$AA?$CD?$AA?$AA@" +// CHECK: @"??_C@_13PBOLBIIK@?$AA$?$AA?$AA@" +// CHECK: @"??_C@_13EJFHHPOP@?$AA?$CF?$AA?$AA@" +// CHECK: @"??_C@_13FLOCNAAB@?$AA?$CG?$AA?$AA@" +// CHECK: @"??_C@_13ODFOLHGE@?$AA?8?$AA?$AA@" +// CHECK: @"??_C@_13LLDNKHDC@?$AA?$CI?$AA?$AA@" +// CHECK: @"??_C@_13DIBMAFH@?$AA?$CJ?$AA?$AA@" +// CHECK: @"??_C@_13BBDEGPLJ@?$AA?$CK?$AA?$AA@" +// CHECK: @"??_C@_13KJIIAINM@?$AA?$CL?$AA?$AA@" +// CHECK: @"??_C@_13DEFPDAGF@?$AA?0?$AA?$AA@" +// CHECK: @"??_C@_13IMODFHAA@?$AA?9?$AA?$AA@" +// CHECK: @"??_C@_13JOFGPIOO@?$AA?4?$AA?$AA@" +// CHECK: @"??_C@_13CGOKJPIL@?$AA?1?$AA?$AA@" +// CHECK: @"??_C@_13COJANIEC@?$AA0?$AA?$AA@" +// CHECK: @"??_C@_13JGCMLPCH@?$AA1?$AA?$AA@" +// CHECK: @"??_C@_13IEJJBAMJ@?$AA2?$AA?$AA@" +// CHECK: @"??_C@_13DMCFHHKM@?$AA3?$AA?$AA@" +// CHECK: @"??_C@_13KBPCEPBF@?$AA4?$AA?$AA@" +// CHECK: @"??_C@_13BJEOCIHA@?$AA5?$AA?$AA@" +// CHECK: @"??_C@_13LPLIHJO@?$AA6?$AA?$AA@" +// CHECK: @"??_C@_13LDEHOAPL@?$AA7?$AA?$AA@" +// CHECK: @"??_C@_13OLCEPAKN@?$AA8?$AA?$AA@" +// CHECK: @"??_C@_13FDJIJHMI@?$AA9?$AA?$AA@" +// CHECK: @"??_C@_13EBCNDICG@?$AA?3?$AA?$AA@" +// CHECK: @"??_C@_13PJJBFPED@?$AA?$DL?$AA?$AA@" +// CHECK: @"??_C@_13GEEGGHPK@?$AA?$DM?$AA?$AA@" +// CHECK: @"??_C@_13NMPKAAJP@?$AA?$DN?$AA?$AA@" +// CHECK: @"??_C@_13MOEPKPHB@?$AA?$DO?$AA?$AA@" +// CHECK: @"??_C@_13HGPDMIBE@?$AA?$DP?$AA?$AA@" +// CHECK: @"??_C@_13EFKPHINO@?$AA?$EA?$AA?$AA@" +// CHECK: @"??_C@_13PNBDBPLL@?$AAA?$AA?$AA@" +// CHECK: @"??_C@_13OPKGLAFF@?$AAB?$AA?$AA@" +// CHECK: @"??_C@_13FHBKNHDA@?$AAC?$AA?$AA@" +// CHECK: @"??_C@_13MKMNOPIJ@?$AAD?$AA?$AA@" +// CHECK: @"??_C@_13HCHBIIOM@?$AAE?$AA?$AA@" +// CHECK: @"??_C@_13GAMECHAC@?$AAF?$AA?$AA@" +// CHECK: @"??_C@_13NIHIEAGH@?$AAG?$AA?$AA@" +// CHECK: @"??_C@_13IABLFADB@?$AAH?$AA?$AA@" +// CHECK: @"??_C@_13DIKHDHFE@?$AAI?$AA?$AA@" +// CHECK: @"??_C@_13CKBCJILK@?$AAJ?$AA?$AA@" +// CHECK: @"??_C@_13JCKOPPNP@?$AAK?$AA?$AA@" +// CHECK: @"??_C@_13PHJMHGG@?$AAL?$AA?$AA@" +// CHECK: @"??_C@_13LHMFKAAD@?$AAM?$AA?$AA@" +// CHECK: @"??_C@_13KFHAAPON@?$AAN?$AA?$AA@" +// CHECK: @"??_C@_13BNMMGIII@?$AAO?$AA?$AA@" +// CHECK: @"??_C@_13BFLGCPEB@?$AAP?$AA?$AA@" +// CHECK: @"??_C@_13KNAKEICE@?$AAQ?$AA?$AA@" +// CHECK: @"??_C@_13LPLPOHMK@?$AAR?$AA?$AA@" +// CHECK: @"??_C@_13HADIAKP@?$AAS?$AA?$AA@" +// CHECK: @"??_C@_13JKNELIBG@?$AAT?$AA?$AA@" +// CHECK: @"??_C@_13CCGINPHD@?$AAU?$AA?$AA@" +// CHECK: @"??_C@_13DANNHAJN@?$AAV?$AA?$AA@" +// CHECK: @"??_C@_13IIGBBHPI@?$AAW?$AA?$AA@" +// CHECK: @"??_C@_13NAACAHKO@?$AAX?$AA?$AA@" +// CHECK: @"??_C@_13GILOGAML@?$AAY?$AA?$AA@" +// CHECK: @"??_C@_13HKALMPCF@?$AAZ?$AA?$AA@" +// CHECK: @"??_C@_13MCLHKIEA@?$AA?$FL?$AA?$AA@" +// CHECK: @"??_C@_13FPGAJAPJ@?$AA?2?$AA?$AA@" +// CHECK: @"??_C@_13OHNMPHJM@?$AA?$FN?$AA?$AA@" +// CHECK: @"??_C@_13PFGJFIHC@?$AA?$FO?$AA?$AA@" +// CHECK: @"??_C@_13ENNFDPBH@?$AA_?$AA?$AA@" +// CHECK: @"??_C@_13OFJNNHOA@?$AA?$GA?$AA?$AA@" +// CHECK: @"??_C@_13FNCBLAIF@?$AAa?$AA?$AA@" +// CHECK: @"??_C@_13EPJEBPGL@?$AAb?$AA?$AA@" +// CHECK: @"??_C@_13PHCIHIAO@?$AAc?$AA?$AA@" +// CHECK: @"??_C@_13GKPPEALH@?$AAd?$AA?$AA@" +// CHECK: @"??_C@_13NCEDCHNC@?$AAe?$AA?$AA@" +// CHECK: @"??_C@_13MAPGIIDM@?$AAf?$AA?$AA@" +// CHECK: @"??_C@_13HIEKOPFJ@?$AAg?$AA?$AA@" +// CHECK: @"??_C@_13CACJPPAP@?$AAh?$AA?$AA@" +// CHECK: @"??_C@_13JIJFJIGK@?$AAi?$AA?$AA@" +// CHECK: @"??_C@_13IKCADHIE@?$AAj?$AA?$AA@" +// CHECK: @"??_C@_13DCJMFAOB@?$AAk?$AA?$AA@" +// CHECK: @"??_C@_13KPELGIFI@?$AAl?$AA?$AA@" +// CHECK: @"??_C@_13BHPHAPDN@?$AAm?$AA?$AA@" +// CHECK: @"??_C@_13FECKAND@?$AAn?$AA?$AA@" +// CHECK: @"??_C@_13LNPOMHLG@?$AAo?$AA?$AA@" +// CHECK: @"??_C@_13LFIEIAHP@?$AAp?$AA?$AA@" +// CHECK: @"??_C@_13NDIOHBK@?$AAq?$AA?$AA@" +// CHECK: @"??_C@_13BPINEIPE@?$AAr?$AA?$AA@" +// CHECK: @"??_C@_13KHDBCPJB@?$AAs?$AA?$AA@" +// CHECK: @"??_C@_13DKOGBHCI@?$AAt?$AA?$AA@" +// CHECK: @"??_C@_13ICFKHAEN@?$AAu?$AA?$AA@" +// CHECK: @"??_C@_13JAOPNPKD@?$AAv?$AA?$AA@" +// CHECK: @"??_C@_13CIFDLIMG@?$AAw?$AA?$AA@" +// CHECK: @"??_C@_13HADAKIJA@?$AAx?$AA?$AA@" +// CHECK: @"??_C@_13MIIMMPPF@?$AAy?$AA?$AA@" +// CHECK: @"??_C@_13NKDJGABL@?$AAz?$AA?$AA@" +// CHECK: @"??_C@_13GCIFAHHO@?$AA?$HL?$AA?$AA@" +// CHECK: @"??_C@_13PPFCDPMH@?$AA?$HM?$AA?$AA@" +// CHECK: @"??_C@_13EHOOFIKC@?$AA?$HN?$AA?$AA@" +// CHECK: @"??_C@_13FFFLPHEM@?$AA?$HO?$AA?$AA@" const char *LongASCIIString = "012345678901234567890123456789ABCDEF"; -// CHECK: @"\01??_C@_0CF@LABBIIMO@012345678901234567890123456789AB@" +// CHECK: @"??_C@_0CF@LABBIIMO@012345678901234567890123456789AB@" const wchar_t *LongWideString = L"012345678901234567890123456789ABCDEF"; -// CHECK: @"\01??_C@_1EK@KFPEBLPK@?$AA0?$AA1?$AA2?$AA3?$AA4?$AA5?$AA6?$AA7?$AA8?$AA9?$AA0?$AA1?$AA2?$AA3?$AA4?$AA5?$AA6?$AA7?$AA8?$AA9?$AA0?$AA1?$AA2?$AA3?$AA4?$AA5?$AA6?$AA7?$AA8?$AA9?$AAA?$AAB@" +// CHECK: @"??_C@_1EK@KFPEBLPK@?$AA0?$AA1?$AA2?$AA3?$AA4?$AA5?$AA6?$AA7?$AA8?$AA9?$AA0?$AA1?$AA2?$AA3?$AA4?$AA5?$AA6?$AA7?$AA8?$AA9?$AA0?$AA1?$AA2?$AA3?$AA4?$AA5?$AA6?$AA7?$AA8?$AA9?$AAA?$AAB@" const wchar_t *UnicodeLiteral = L"\ud7ff"; -// CHECK: @"\01??_C@_13IIHIAFKH@?W?$PP?$AA?$AA@" +// CHECK: @"??_C@_13IIHIAFKH@?W?$PP?$AA?$AA@" + const char *U8Literal = u8"hi"; -// CHECK: @"\01??_C@_02PCEFGMJL@hi?$AA@" +// CHECK: @"??_C@_02PCEFGMJL@hi?$AA@" +const char *LongU8Literal = u8"012345678901234567890123456789ABCDEF"; +// CHECK: @"??_C@_0CF@LABBIIMO@012345678901234567890123456789AB@" + const char16_t *U16Literal = u"hi"; -// CHECK: @"\01??_C@_05OMLEGLOC@h?$AAi?$AA?$AA?$AA@" +// CHECK: @"??_C@_05OMLEGLOC@h?$AAi?$AA?$AA?$AA@" +// Note this starts with o instead of 0. Else LongWideString would have +// the same initializer and CodeGenModule::ConstantStringMap would map them +// to the same global with a shared mangling. +// FIXME: ConstantStringMap probably shouldn't map things with the same data +// but different manglings to the same variable. +const char16_t *LongU16Literal = u"o12345678901234567890123456789ABCDEF"; +// CHECK: @"??_C@_0EK@FEAOBHPP@o?$AA1?$AA2?$AA3?$AA4?$AA5?$AA6?$AA7?$AA8?$AA9?$AA0?$AA1?$AA2?$AA3?$AA4?$AA5?$AA@" + const char32_t *U32Literal = U"hi"; -// CHECK: @"\01??_C@_0M@GFNAJIPG@h?$AA?$AA?$AAi?$AA?$AA?$AA?$AA?$AA?$AA?$AA@" +// CHECK: @"??_C@_0M@GFNAJIPG@h?$AA?$AA?$AAi?$AA?$AA?$AA?$AA?$AA?$AA?$AA@" +const char32_t *LongU32Literal = U"012345678901234567890123456789ABCDEF"; +// CHECK: @"??_C@_0JE@IMHFEDAA@0?$AA?$AA?$AA1?$AA?$AA?$AA2?$AA?$AA?$AA3?$AA?$AA?$AA4?$AA?$AA?$AA5?$AA?$AA?$AA6?$AA?$AA?$AA7?$AA?$AA?$AA@" + +// These all have just the right length that the trailing 0 just fits. +const char *MaxASCIIString = "012345678901234567890123456789A"; +// CHECK: @"??_C@_0CA@NMANGEKF@012345678901234567890123456789A?$AA@" +const wchar_t *MaxWideString = L"012345678901234567890123456789A"; +// CHECK: @"??_C@_1EA@LJAFPILO@?$AA0?$AA1?$AA2?$AA3?$AA4?$AA5?$AA6?$AA7?$AA8?$AA9?$AA0?$AA1?$AA2?$AA3?$AA4?$AA5?$AA6?$AA7?$AA8?$AA9?$AA0?$AA1?$AA2?$AA3?$AA4?$AA5?$AA6?$AA7?$AA8?$AA9?$AAA?$AA?$AA@" +const char *MaxU8String = u8"012345678901234567890123456789A"; +// CHECK: @"??_C@_0CA@NMANGEKF@012345678901234567890123456789A?$AA@" +const char16_t *MaxU16String = u"012345678901234"; +// CHECK: @"??_C@_0CA@NFEFHIFO@0?$AA1?$AA2?$AA3?$AA4?$AA5?$AA6?$AA7?$AA8?$AA9?$AA0?$AA1?$AA2?$AA3?$AA4?$AA?$AA?$AA@" +const char32_t *MaxU32String = U"0123456"; +// CHECK: @"??_C@_0CA@KFPHPCC@0?$AA?$AA?$AA1?$AA?$AA?$AA2?$AA?$AA?$AA3?$AA?$AA?$AA4?$AA?$AA?$AA5?$AA?$AA?$AA6?$AA?$AA?$AA?$AA?$AA?$AA?$AA@" diff --git a/test/CodeGenCXX/mangle-ms-template-callback.cpp b/test/CodeGenCXX/mangle-ms-template-callback.cpp index 1a8f82fc82566..25e719f5e6973 100644 --- a/test/CodeGenCXX/mangle-ms-template-callback.cpp +++ b/test/CodeGenCXX/mangle-ms-template-callback.cpp @@ -14,42 +14,42 @@ template<typename Ret, typename Arg1, typename Arg2> class C<Ret(Arg1, Arg2)> {}; C0 callback_void; -// CHECK: "\01?callback_void@@3V?$C@$$A6AXXZ@@A" +// CHECK: "?callback_void@@3V?$C@$$A6AXXZ@@A" volatile C0 callback_void_volatile; -// CHECK: "\01?callback_void_volatile@@3V?$C@$$A6AXXZ@@C" +// CHECK: "?callback_void_volatile@@3V?$C@$$A6AXXZ@@C" class Type {}; C<int(void)> callback_int; -// CHECK: "\01?callback_int@@3V?$C@$$A6AHXZ@@A" +// CHECK: "?callback_int@@3V?$C@$$A6AHXZ@@A" C<Type(void)> callback_Type; -// CHECK: "\01?callback_Type@@3V?$C@$$A6A?AVType@@XZ@@A" +// CHECK: "?callback_Type@@3V?$C@$$A6A?AVType@@XZ@@A" C<void(int)> callback_void_int; -// CHECK: "\01?callback_void_int@@3V?$C@$$A6AXH@Z@@A" +// CHECK: "?callback_void_int@@3V?$C@$$A6AXH@Z@@A" C<int(int)> callback_int_int; -// CHECK: "\01?callback_int_int@@3V?$C@$$A6AHH@Z@@A" +// CHECK: "?callback_int_int@@3V?$C@$$A6AHH@Z@@A" C<void(Type)> callback_void_Type; -// CHECK: "\01?callback_void_Type@@3V?$C@$$A6AXVType@@@Z@@A" +// CHECK: "?callback_void_Type@@3V?$C@$$A6AXVType@@@Z@@A" void foo(C0 c) {} -// CHECK: "\01?foo@@YAXV?$C@$$A6AXXZ@@@Z" +// CHECK: "?foo@@YAXV?$C@$$A6AXXZ@@@Z" // Here be dragons! // Let's face the magic of template partial specialization... void function(C<void(void)>) {} -// CHECK: "\01?function@@YAXV?$C@$$A6AXXZ@@@Z" +// CHECK: "?function@@YAXV?$C@$$A6AXXZ@@@Z" template<typename Ret> class C<Ret(*)(void)> {}; void function_pointer(C<void(*)(void)>) {} -// CHECK: "\01?function_pointer@@YAXV?$C@P6AXXZ@@@Z" +// CHECK: "?function_pointer@@YAXV?$C@P6AXXZ@@@Z" // Block equivalent to the previous definitions. template<typename Ret> class C<Ret(^)(void)> {}; void block(C<void(^)(void)>) {} -// CHECK: "\01?block@@YAXV?$C@P_EAXXZ@@@Z" +// CHECK: "?block@@YAXV?$C@P_EAXXZ@@@Z" // FYI blocks are not present in MSVS, so we're free to choose the spec. template<typename T> class C<void (T::*)(void)> {}; @@ -58,16 +58,16 @@ class Z { void method() {} }; void member_pointer(C<void (Z::*)(void)>) {} -// CHECK: "\01?member_pointer@@YAXV?$C@P8Z@@AEXXZ@@@Z" +// CHECK: "?member_pointer@@YAXV?$C@P8Z@@AEXXZ@@@Z" template<typename T> void bar(T) {} void call_bar() { bar<int (*)(int)>(0); -// CHECK: "\01??$bar@P6AHH@Z@@YAXP6AHH@Z@Z" +// CHECK: "??$bar@P6AHH@Z@@YAXP6AHH@Z@Z" bar<int (^)(int)>(0); -// CHECK: "\01??$bar@P_EAHH@Z@@YAXP_EAHH@Z@Z" +// CHECK: "??$bar@P_EAHH@Z@@YAXP_EAHH@Z@Z" // FYI blocks are not present in MSVS, so we're free to choose the spec. } @@ -83,7 +83,7 @@ void CallWrapper() { WrapFnPtr<Thing::VoidStaticMethod>(); WrapFnRef<Thing::VoidStaticMethod>(); } -// CHECK: call {{.*}} @"\01??$WrapFnPtr@$1?VoidFn@@YAXXZ@@YAXXZ" -// CHECK: call {{.*}} @"\01??$WrapFnRef@$1?VoidFn@@YAXXZ@@YAXXZ" -// CHECK: call {{.*}} @"\01??$WrapFnPtr@$1?VoidStaticMethod@Thing@@SAXXZ@@YAXXZ" -// CHECK: call {{.*}} @"\01??$WrapFnRef@$1?VoidStaticMethod@Thing@@SAXXZ@@YAXXZ" +// CHECK: call {{.*}} @"??$WrapFnPtr@$1?VoidFn@@YAXXZ@@YAXXZ" +// CHECK: call {{.*}} @"??$WrapFnRef@$1?VoidFn@@YAXXZ@@YAXXZ" +// CHECK: call {{.*}} @"??$WrapFnPtr@$1?VoidStaticMethod@Thing@@SAXXZ@@YAXXZ" +// CHECK: call {{.*}} @"??$WrapFnRef@$1?VoidStaticMethod@Thing@@SAXXZ@@YAXXZ" diff --git a/test/CodeGenCXX/mangle-ms-templates-memptrs-2.cpp b/test/CodeGenCXX/mangle-ms-templates-memptrs-2.cpp index b01d6099d8f76..e4a608aa6c25f 100644 --- a/test/CodeGenCXX/mangle-ms-templates-memptrs-2.cpp +++ b/test/CodeGenCXX/mangle-ms-templates-memptrs-2.cpp @@ -8,31 +8,31 @@ struct K {}; struct __single_inheritance M; J<M> m; -// CHECK-DAG: @"\01?m@@3U?$J@UM@@$0A@@@A" +// CHECK-DAG: @"?m@@3U?$J@UM@@$0A@@@A" K<M> m2; -// CHECK-DAG: @"\01?m2@@3U?$K@UM@@$0?0@@A" +// CHECK-DAG: @"?m2@@3U?$K@UM@@$0?0@@A" struct __multiple_inheritance N; J<N> n; -// CHECK-DAG: @"\01?n@@3U?$J@UN@@$HA@@@A" +// CHECK-DAG: @"?n@@3U?$J@UN@@$HA@@@A" K<N> n2; -// CHECK-DAG: @"\01?n2@@3U?$K@UN@@$0?0@@A" +// CHECK-DAG: @"?n2@@3U?$K@UN@@$0?0@@A" struct __virtual_inheritance O; J<O> o; -// CHECK-DAG: @"\01?o@@3U?$J@UO@@$IA@A@@@A" +// CHECK-DAG: @"?o@@3U?$J@UO@@$IA@A@@@A" K<O> o2; -// CHECK-DAG: @"\01?o2@@3U?$K@UO@@$FA@?0@@A" +// CHECK-DAG: @"?o2@@3U?$K@UO@@$FA@?0@@A" struct P; J<P> p; -// CHECK-DAG: @"\01?p@@3U?$J@UP@@$JA@A@?0@@A" +// CHECK-DAG: @"?p@@3U?$J@UP@@$JA@A@?0@@A" K<P> p2; -// CHECK-DAG: @"\01?p2@@3U?$K@UP@@$GA@A@?0@@A" +// CHECK-DAG: @"?p2@@3U?$K@UP@@$GA@A@?0@@A" #pragma pointers_to_members(full_generality, virtual_inheritance) @@ -57,4 +57,4 @@ template struct ClassTemplate<&MostGeneral::h>; // Test that we mangle in the vbptr offset, which is 12 here. // -// CHECK: define weak_odr x86_thiscallcc %struct.ClassTemplate* @"\01??0?$ClassTemplate@$J??_9MostGeneral@@$BA@AEA@M@3@@QAE@XZ" +// CHECK: define weak_odr dso_local x86_thiscallcc %struct.ClassTemplate* @"??0?$ClassTemplate@$J??_9MostGeneral@@$BA@AEA@M@3@@QAE@XZ" diff --git a/test/CodeGenCXX/mangle-ms-templates-memptrs.cpp b/test/CodeGenCXX/mangle-ms-templates-memptrs.cpp index e710abe97e985..3078c5a5d2683 100644 --- a/test/CodeGenCXX/mangle-ms-templates-memptrs.cpp +++ b/test/CodeGenCXX/mangle-ms-templates-memptrs.cpp @@ -56,31 +56,31 @@ void ReadFields() { } // CHECK-LABEL: define {{.*}}ReadFields -// CHECK: call {{.*}} @"\01??$ReadField@US@@$03@@YAHAAUS@@@Z" -// CHECK: call {{.*}} @"\01??$ReadField@UM@@$0M@@@YAHAAUM@@@Z" -// CHECK: call {{.*}} @"\01??$ReadField@UV@@$F7A@@@YAHAAUV@@@Z" -// CHECK: call {{.*}} @"\01??$ReadField@UU@@$G3A@A@@@YAHAAUU@@@Z" -// CHECK: call {{.*}} @"\01??$ReadField@US@@$07@@YAHAAUS@@@Z" -// CHECK: call {{.*}} @"\01??$ReadField@UM@@$0BA@@@YAHAAUM@@@Z" -// CHECK: call {{.*}} @"\01??$ReadField@UV@@$FM@A@@@YAHAAUV@@@Z" -// CHECK: call {{.*}} @"\01??$ReadField@UU@@$G7A@A@@@YAHAAUU@@@Z" +// CHECK: call {{.*}} @"??$ReadField@US@@$03@@YAHAAUS@@@Z" +// CHECK: call {{.*}} @"??$ReadField@UM@@$0M@@@YAHAAUM@@@Z" +// CHECK: call {{.*}} @"??$ReadField@UV@@$F7A@@@YAHAAUV@@@Z" +// CHECK: call {{.*}} @"??$ReadField@UU@@$G3A@A@@@YAHAAUU@@@Z" +// CHECK: call {{.*}} @"??$ReadField@US@@$07@@YAHAAUS@@@Z" +// CHECK: call {{.*}} @"??$ReadField@UM@@$0BA@@@YAHAAUM@@@Z" +// CHECK: call {{.*}} @"??$ReadField@UV@@$FM@A@@@YAHAAUV@@@Z" +// CHECK: call {{.*}} @"??$ReadField@UU@@$G7A@A@@@YAHAAUU@@@Z" // MSVC mangles null member pointers in function templates wrong, but it gets // them right in class templates. -// CHECK: call {{.*}} @"\01??$ReadField@US@@$0A@@@YAHAAUS@@@Z" -// CHECK: call {{.*}} @"\01??$ReadField@UM@@$0A@@@YAHAAUM@@@Z" -// CHECK: call {{.*}} @"\01??$ReadField@UV@@$0A@@@YAHAAUV@@@Z" -// CHECK: call {{.*}} @"\01??$ReadField@UU@@$0A@@@YAHAAUU@@@Z" +// CHECK: call {{.*}} @"??$ReadField@US@@$0A@@@YAHAAUS@@@Z" +// CHECK: call {{.*}} @"??$ReadField@UM@@$0A@@@YAHAAUM@@@Z" +// CHECK: call {{.*}} @"??$ReadField@UV@@$0A@@@YAHAAUV@@@Z" +// CHECK: call {{.*}} @"??$ReadField@UU@@$0A@@@YAHAAUU@@@Z" // Non-polymorphic null data memptr vs first field memptr. MSVC mangles these // the same. -// CHECK: call {{.*}} @"\01??$ReadField@UA@@$0A@@@YAHAAUA@@@Z" -// CHECK: call {{.*}} @"\01??$ReadField@UA@@$0?0@@YAHAAUA@@@Z" +// CHECK: call {{.*}} @"??$ReadField@UA@@$0A@@@YAHAAUA@@@Z" +// CHECK: call {{.*}} @"??$ReadField@UA@@$0?0@@YAHAAUA@@@Z" // Indirect fields are handled as-if they were simply members of their enclosing // record. -// CHECK: call {{.*}} @"\01??$ReadField@UI@@$0A@@@YAHAAUI@@@Z" -// CHECK: call {{.*}} @"\01??$ReadField@UI@@$03@@YAHAAUI@@@Z" +// CHECK: call {{.*}} @"??$ReadField@UI@@$0A@@@YAHAAUI@@@Z" +// CHECK: call {{.*}} @"??$ReadField@UI@@$03@@YAHAAUI@@@Z" // Test member function pointers. template <typename T, void (T::*MFP)()> @@ -119,10 +119,10 @@ void CallMethods() { } // CHECK-LABEL: define {{.*}}CallMethods -// CHECK: call {{.*}} @"\01??$CallMethod@US@@$1?f@1@QAEXXZ@@YAXAAUS@@@Z" -// CHECK: call {{.*}} @"\01??$CallMethod@UM@@$H?f@1@QAEXXZA@@@YAXAAUM@@@Z" -// CHECK: call {{.*}} @"\01??$CallMethod@UV@@$I?f@1@QAEXXZA@A@@@YAXAAUV@@@Z" -// CHECK: call {{.*}} @"\01??$CallMethod@UU@@$J?f@1@QAEXXZA@A@A@@@YAXAAUU@@@Z" +// CHECK: call {{.*}} @"??$CallMethod@US@@$1?f@1@QAEXXZ@@YAXAAUS@@@Z" +// CHECK: call {{.*}} @"??$CallMethod@UM@@$H?f@1@QAEXXZA@@@YAXAAUM@@@Z" +// CHECK: call {{.*}} @"??$CallMethod@UV@@$I?f@1@QAEXXZA@A@@@YAXAAUV@@@Z" +// CHECK: call {{.*}} @"??$CallMethod@UU@@$J?f@1@QAEXXZA@A@A@@@YAXAAUU@@@Z" // PR17034: MSVC reuses the same thunk for every virtual g method because they // are all at vftable offset zero. They then mangle the name of the first thunk @@ -130,17 +130,17 @@ void CallMethods() { // bug. We don't follow them here. Instead of ?_91@ backref below, they would // get ?_9S@@ in every instantiation after the first. -// CHECK: call {{.*}} @"\01??$CallMethod@US@@$1??_91@$BA@AE@@YAXAAUS@@@Z" -// CHECK: call {{.*}} @"\01??$CallMethod@UM@@$H??_91@$BA@AEA@@@YAXAAUM@@@Z" -// CHECK: call {{.*}} @"\01??$CallMethod@UV@@$I??_91@$BA@AEA@A@@@YAXAAUV@@@Z" -// CHECK: call {{.*}} @"\01??$CallMethod@UU@@$J??_91@$BA@AEA@A@A@@@YAXAAUU@@@Z" +// CHECK: call {{.*}} @"??$CallMethod@US@@$1??_91@$BA@AE@@YAXAAUS@@@Z" +// CHECK: call {{.*}} @"??$CallMethod@UM@@$H??_91@$BA@AEA@@@YAXAAUM@@@Z" +// CHECK: call {{.*}} @"??$CallMethod@UV@@$I??_91@$BA@AEA@A@@@YAXAAUV@@@Z" +// CHECK: call {{.*}} @"??$CallMethod@UU@@$J??_91@$BA@AEA@A@A@@@YAXAAUU@@@Z" -// CHECK: call {{.*}} @"\01??$CallMethod@UO@@$H??_91@$BA@AE3@@YAXAAUO@@@Z" +// CHECK: call {{.*}} @"??$CallMethod@UO@@$H??_91@$BA@AE3@@YAXAAUO@@@Z" -// CHECK: call {{.*}} @"\01??$CallMethod@US@@$0A@@@YAXAAUS@@@Z" -// CHECK: call {{.*}} @"\01??$CallMethod@UM@@$0A@@@YAXAAUM@@@Z" -// CHECK: call {{.*}} @"\01??$CallMethod@UV@@$0A@@@YAXAAUV@@@Z" -// CHECK: call {{.*}} @"\01??$CallMethod@UU@@$0A@@@YAXAAUU@@@Z" +// CHECK: call {{.*}} @"??$CallMethod@US@@$0A@@@YAXAAUS@@@Z" +// CHECK: call {{.*}} @"??$CallMethod@UM@@$0A@@@YAXAAUM@@@Z" +// CHECK: call {{.*}} @"??$CallMethod@UV@@$0A@@@YAXAAUV@@@Z" +// CHECK: call {{.*}} @"??$CallMethod@UU@@$0A@@@YAXAAUU@@@Z" namespace NegativeNVOffset { struct A {}; @@ -152,4 +152,4 @@ struct C : B { template void CallMethod<NegativeNVOffset::C, &NegativeNVOffset::C::f>(NegativeNVOffset::C &); -// CHECK-LABEL: define {{.*}} @"\01??$CallMethod@UC@NegativeNVOffset@@$I??_912@$BA@AEPPPPPPPM@A@@@YAXAAUC@NegativeNVOffset@@@Z" +// CHECK-LABEL: define {{.*}} @"??$CallMethod@UC@NegativeNVOffset@@$I??_912@$BA@AEPPPPPPPM@A@@@YAXAAUC@NegativeNVOffset@@@Z" diff --git a/test/CodeGenCXX/mangle-ms-templates.cpp b/test/CodeGenCXX/mangle-ms-templates.cpp index 46ab251af14f8..8c6062b6d5ee4 100644 --- a/test/CodeGenCXX/mangle-ms-templates.cpp +++ b/test/CodeGenCXX/mangle-ms-templates.cpp @@ -51,118 +51,118 @@ class BoolTemplate<true> { void template_mangling() { Class<Typename> c1; -// CHECK: call {{.*}} @"\01??0?$Class@VTypename@@@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$Class@VTypename@@@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$Class@VTypename@@@@QAE@XZ" +// X64: call {{.*}} @"??0?$Class@VTypename@@@@QEAA@XZ" Class<const Typename> c1_const; -// CHECK: call {{.*}} @"\01??0?$Class@$$CBVTypename@@@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$Class@$$CBVTypename@@@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$Class@$$CBVTypename@@@@QAE@XZ" +// X64: call {{.*}} @"??0?$Class@$$CBVTypename@@@@QEAA@XZ" Class<volatile Typename> c1_volatile; -// CHECK: call {{.*}} @"\01??0?$Class@$$CCVTypename@@@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$Class@$$CCVTypename@@@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$Class@$$CCVTypename@@@@QAE@XZ" +// X64: call {{.*}} @"??0?$Class@$$CCVTypename@@@@QEAA@XZ" Class<const volatile Typename> c1_cv; -// CHECK: call {{.*}} @"\01??0?$Class@$$CDVTypename@@@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$Class@$$CDVTypename@@@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$Class@$$CDVTypename@@@@QAE@XZ" +// X64: call {{.*}} @"??0?$Class@$$CDVTypename@@@@QEAA@XZ" Class<Nested<Typename> > c2; -// CHECK: call {{.*}} @"\01??0?$Class@V?$Nested@VTypename@@@@@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$Class@V?$Nested@VTypename@@@@@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$Class@V?$Nested@VTypename@@@@@@QAE@XZ" +// X64: call {{.*}} @"??0?$Class@V?$Nested@VTypename@@@@@@QEAA@XZ" Class<int * const> c_intpc; -// CHECK: call {{.*}} @"\01??0?$Class@QAH@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$Class@QEAH@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$Class@QAH@@QAE@XZ" +// X64: call {{.*}} @"??0?$Class@QEAH@@QEAA@XZ" Class<int()> c_ft; -// CHECK: call {{.*}} @"\01??0?$Class@$$A6AHXZ@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$Class@$$A6AHXZ@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$Class@$$A6AHXZ@@QAE@XZ" +// X64: call {{.*}} @"??0?$Class@$$A6AHXZ@@QEAA@XZ" Class<int[]> c_inti; -// CHECK: call {{.*}} @"\01??0?$Class@$$BY0A@H@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$Class@$$BY0A@H@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$Class@$$BY0A@H@@QAE@XZ" +// X64: call {{.*}} @"??0?$Class@$$BY0A@H@@QEAA@XZ" Class<int[5]> c_int5; -// CHECK: call {{.*}} @"\01??0?$Class@$$BY04H@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$Class@$$BY04H@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$Class@$$BY04H@@QAE@XZ" +// X64: call {{.*}} @"??0?$Class@$$BY04H@@QEAA@XZ" Class<const int[5]> c_intc5; -// CHECK: call {{.*}} @"\01??0?$Class@$$BY04$$CBH@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$Class@$$BY04$$CBH@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$Class@$$BY04$$CBH@@QAE@XZ" +// X64: call {{.*}} @"??0?$Class@$$BY04$$CBH@@QEAA@XZ" Class<int * const[5]> c_intpc5; -// CHECK: call {{.*}} @"\01??0?$Class@$$BY04QAH@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$Class@$$BY04QEAH@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$Class@$$BY04QAH@@QAE@XZ" +// X64: call {{.*}} @"??0?$Class@$$BY04QEAH@@QEAA@XZ" BoolTemplate<false> _false; -// CHECK: call {{.*}} @"\01??0?$BoolTemplate@$0A@@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$BoolTemplate@$0A@@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$BoolTemplate@$0A@@@QAE@XZ" +// X64: call {{.*}} @"??0?$BoolTemplate@$0A@@@QEAA@XZ" BoolTemplate<true> _true; // PR13158 _true.Foo(1); -// CHECK: call {{.*}} @"\01??0?$BoolTemplate@$00@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$BoolTemplate@$00@@QEAA@XZ" -// CHECK: call {{.*}} @"\01??$Foo@H@?$BoolTemplate@$00@@QAEXH@Z" -// X64: call {{.*}} @"\01??$Foo@H@?$BoolTemplate@$00@@QEAAXH@Z" +// CHECK: call {{.*}} @"??0?$BoolTemplate@$00@@QAE@XZ" +// X64: call {{.*}} @"??0?$BoolTemplate@$00@@QEAA@XZ" +// CHECK: call {{.*}} @"??$Foo@H@?$BoolTemplate@$00@@QAEXH@Z" +// X64: call {{.*}} @"??$Foo@H@?$BoolTemplate@$00@@QEAAXH@Z" IntTemplate<0> zero; -// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0A@@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$IntTemplate@$0A@@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$IntTemplate@$0A@@@QAE@XZ" +// X64: call {{.*}} @"??0?$IntTemplate@$0A@@@QEAA@XZ" IntTemplate<5> five; -// CHECK: call {{.*}} @"\01??0?$IntTemplate@$04@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$IntTemplate@$04@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$IntTemplate@$04@@QAE@XZ" +// X64: call {{.*}} @"??0?$IntTemplate@$04@@QEAA@XZ" IntTemplate<11> eleven; -// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0L@@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$IntTemplate@$0L@@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$IntTemplate@$0L@@@QAE@XZ" +// X64: call {{.*}} @"??0?$IntTemplate@$0L@@@QEAA@XZ" IntTemplate<256> _256; -// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0BAA@@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$IntTemplate@$0BAA@@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$IntTemplate@$0BAA@@@QAE@XZ" +// X64: call {{.*}} @"??0?$IntTemplate@$0BAA@@@QEAA@XZ" IntTemplate<513> _513; -// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0CAB@@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$IntTemplate@$0CAB@@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$IntTemplate@$0CAB@@@QAE@XZ" +// X64: call {{.*}} @"??0?$IntTemplate@$0CAB@@@QEAA@XZ" IntTemplate<1026> _1026; -// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0EAC@@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$IntTemplate@$0EAC@@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$IntTemplate@$0EAC@@@QAE@XZ" +// X64: call {{.*}} @"??0?$IntTemplate@$0EAC@@@QEAA@XZ" IntTemplate<65535> ffff; -// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0PPPP@@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$IntTemplate@$0PPPP@@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$IntTemplate@$0PPPP@@@QAE@XZ" +// X64: call {{.*}} @"??0?$IntTemplate@$0PPPP@@@QEAA@XZ" IntTemplate<-1> neg_1; -// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0?0@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$IntTemplate@$0?0@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$IntTemplate@$0?0@@QAE@XZ" +// X64: call {{.*}} @"??0?$IntTemplate@$0?0@@QEAA@XZ" IntTemplate<-9> neg_9; -// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0?8@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$IntTemplate@$0?8@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$IntTemplate@$0?8@@QAE@XZ" +// X64: call {{.*}} @"??0?$IntTemplate@$0?8@@QEAA@XZ" IntTemplate<-10> neg_10; -// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0?9@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$IntTemplate@$0?9@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$IntTemplate@$0?9@@QAE@XZ" +// X64: call {{.*}} @"??0?$IntTemplate@$0?9@@QEAA@XZ" IntTemplate<-11> neg_11; -// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0?L@@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$IntTemplate@$0?L@@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$IntTemplate@$0?L@@@QAE@XZ" +// X64: call {{.*}} @"??0?$IntTemplate@$0?L@@@QEAA@XZ" UnsignedIntTemplate<4294967295> ffffffff; -// CHECK: call {{.*}} @"\01??0?$UnsignedIntTemplate@$0PPPPPPPP@@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$UnsignedIntTemplate@$0PPPPPPPP@@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$UnsignedIntTemplate@$0PPPPPPPP@@@QAE@XZ" +// X64: call {{.*}} @"??0?$UnsignedIntTemplate@$0PPPPPPPP@@@QEAA@XZ" LongLongTemplate<-9223372036854775807LL-1LL> int64_min; -// CHECK: call {{.*}} @"\01??0?$LongLongTemplate@$0?IAAAAAAAAAAAAAAA@@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$LongLongTemplate@$0?IAAAAAAAAAAAAAAA@@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$LongLongTemplate@$0?IAAAAAAAAAAAAAAA@@@QAE@XZ" +// X64: call {{.*}} @"??0?$LongLongTemplate@$0?IAAAAAAAAAAAAAAA@@@QEAA@XZ" LongLongTemplate<9223372036854775807LL> int64_max; -// CHECK: call {{.*}} @"\01??0?$LongLongTemplate@$0HPPPPPPPPPPPPPPP@@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$LongLongTemplate@$0HPPPPPPPPPPPPPPP@@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$LongLongTemplate@$0HPPPPPPPPPPPPPPP@@@QAE@XZ" +// X64: call {{.*}} @"??0?$LongLongTemplate@$0HPPPPPPPPPPPPPPP@@@QEAA@XZ" UnsignedLongLongTemplate<18446744073709551615ULL> uint64_max; -// CHECK: call {{.*}} @"\01??0?$UnsignedLongLongTemplate@$0?0@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$UnsignedLongLongTemplate@$0?0@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$UnsignedLongLongTemplate@$0?0@@QAE@XZ" +// X64: call {{.*}} @"??0?$UnsignedLongLongTemplate@$0?0@@QEAA@XZ" UnsignedLongLongTemplate<(unsigned long long)-1> uint64_neg_1; -// CHECK: call {{.*}} @"\01??0?$UnsignedLongLongTemplate@$0?0@@QAE@XZ" -// X64: call {{.*}} @"\01??0?$UnsignedLongLongTemplate@$0?0@@QEAA@XZ" +// CHECK: call {{.*}} @"??0?$UnsignedLongLongTemplate@$0?0@@QAE@XZ" +// X64: call {{.*}} @"??0?$UnsignedLongLongTemplate@$0?0@@QEAA@XZ" } namespace space { template<class T> const T& foo(const T& l) { return l; } } -// CHECK: "\01??$foo@H@space@@YAABHABH@Z" -// X64: "\01??$foo@H@space@@YAAEBHAEBH@Z" +// CHECK: "??$foo@H@space@@YAABHABH@Z" +// X64: "??$foo@H@space@@YAAEBHAEBH@Z" void use() { space::foo(42); @@ -178,8 +178,8 @@ void FunctionPointerTemplate() { void spam() { FunctionPointerTemplate<spam>(); -// CHECK: "\01??$FunctionPointerTemplate@$1?spam@@YAXXZ@@YAXXZ" -// X64: "\01??$FunctionPointerTemplate@$1?spam@@YAXXZ@@YAXXZ" +// CHECK: "??$FunctionPointerTemplate@$1?spam@@YAXXZ@@YAXXZ" +// X64: "??$FunctionPointerTemplate@$1?spam@@YAXXZ@@YAXXZ" } // Unlike Itanium, there is no character code to indicate an argument pack. @@ -190,8 +190,8 @@ void variadic_fn_instantiate() { variadic_fn_template(0, 1, 3, 4); variadic_fn_template(0, 1, 'a', "b"); } -// CHECK: "\01??$variadic_fn_template@HHHH@@YAXABH000@Z" -// CHECK: "\01??$variadic_fn_template@HHD$$BY01D@@YAXABH0ABDAAY01$$CBD@Z" +// CHECK: "??$variadic_fn_template@HHHH@@YAXABH000@Z" +// CHECK: "??$variadic_fn_template@HHD$$BY01D@@YAXABH0ABDAAY01$$CBD@Z" template <typename ...Ts> struct VariadicClass { @@ -202,8 +202,8 @@ void variadic_class_instantiate() { VariadicClass<int, char, bool> a; VariadicClass<bool, char, int> b; } -// CHECK: call {{.*}} @"\01??0?$VariadicClass@HD_N@@QAE@XZ" -// CHECK: call {{.*}} @"\01??0?$VariadicClass@_NDH@@QAE@XZ" +// CHECK: call {{.*}} @"??0?$VariadicClass@HD_N@@QAE@XZ" +// CHECK: call {{.*}} @"??0?$VariadicClass@_NDH@@QAE@XZ" template <typename T> struct Second {}; @@ -224,7 +224,7 @@ template <template <class> class T> struct Thing<T, true> { }; void template_template_fun(Type<Thing<Second, true>, Second>) { } -// CHECK: "\01?template_template_fun@@YAXU?$Type@U?$Thing@USecond@@$00@@USecond@@@@@Z" +// CHECK: "?template_template_fun@@YAXU?$Type@U?$Thing@USecond@@$00@@USecond@@@@@Z" template <typename T> void template_template_specialization(); @@ -232,12 +232,12 @@ void template_template_specialization(); template <> void template_template_specialization<void (Type<Thing<Second, true>, Second>)>() { } -// CHECK: "\01??$template_template_specialization@$$A6AXU?$Type@U?$Thing@USecond@@$00@@USecond@@@@@Z@@YAXXZ" +// CHECK: "??$template_template_specialization@$$A6AXU?$Type@U?$Thing@USecond@@$00@@USecond@@@@@Z@@YAXXZ" // PR16788 template <decltype(nullptr)> struct S1 {}; void f(S1<nullptr>) {} -// CHECK: "\01?f@@YAXU?$S1@$0A@@@@Z" +// CHECK: "?f@@YAXU?$S1@$0A@@@@Z" struct record { int first; @@ -248,7 +248,7 @@ struct type1 { }; extern const record inst; void recref(type1<inst>) {} -// CHECK: "\01?recref@@YAXU?$type1@$E?inst@@3Urecord@@B@@@Z" +// CHECK: "?recref@@YAXU?$type1@$E?inst@@3Urecord@@B@@@Z" struct _GUID {}; struct __declspec(uuid("{12345678-1234-1234-1234-1234567890aB}")) uuid; @@ -260,18 +260,18 @@ template <typename T, const _GUID &G = __uuidof(T)> struct UUIDType2 {}; void fun(UUIDType1<uuid> a) {} -// CHECK: "\01?fun@@YAXU?$UUIDType1@Uuuid@@$1?_GUID_12345678_1234_1234_1234_1234567890ab@@3U__s_GUID@@B@@@Z" +// CHECK: "?fun@@YAXU?$UUIDType1@Uuuid@@$1?_GUID_12345678_1234_1234_1234_1234567890ab@@3U__s_GUID@@B@@@Z" void fun(UUIDType2<uuid> b) {} -// CHECK: "\01?fun@@YAXU?$UUIDType2@Uuuid@@$E?_GUID_12345678_1234_1234_1234_1234567890ab@@3U__s_GUID@@B@@@Z" +// CHECK: "?fun@@YAXU?$UUIDType2@Uuuid@@$E?_GUID_12345678_1234_1234_1234_1234567890ab@@3U__s_GUID@@B@@@Z" template <typename T> struct TypeWithFriendDefinition { friend void FunctionDefinedWithInjectedName(TypeWithFriendDefinition<T>) {} }; -// CHECK: call {{.*}} @"\01?FunctionDefinedWithInjectedName@@YAXU?$TypeWithFriendDefinition@H@@@Z" +// CHECK: call {{.*}} @"?FunctionDefinedWithInjectedName@@YAXU?$TypeWithFriendDefinition@H@@@Z" void CallFunctionDefinedWithInjectedName() { FunctionDefinedWithInjectedName(TypeWithFriendDefinition<int>()); } -// CHECK: @"\01?FunctionDefinedWithInjectedName@@YAXU?$TypeWithFriendDefinition@H@@@Z" +// CHECK: @"?FunctionDefinedWithInjectedName@@YAXU?$TypeWithFriendDefinition@H@@@Z" // We need to be able to feed GUIDs through a couple rounds of template // substitution. @@ -284,5 +284,5 @@ struct UUIDType4 : UUIDType3<G> { void bar() { UUIDType4::foo(); } }; template struct UUIDType4<&__uuidof(uuid)>; -// CHECK: "\01?bar@?$UUIDType4@$1?_GUID_12345678_1234_1234_1234_1234567890ab@@3U__s_GUID@@B@@QAEXXZ" -// CHECK: "\01?foo@?$UUIDType3@$1?_GUID_12345678_1234_1234_1234_1234567890ab@@3U__s_GUID@@B@@QAEXXZ" +// CHECK: "?bar@?$UUIDType4@$1?_GUID_12345678_1234_1234_1234_1234567890ab@@3U__s_GUID@@B@@QAEXXZ" +// CHECK: "?foo@?$UUIDType3@$1?_GUID_12345678_1234_1234_1234_1234567890ab@@3U__s_GUID@@B@@QAEXXZ" diff --git a/test/CodeGenCXX/mangle-ms-vector-types.cpp b/test/CodeGenCXX/mangle-ms-vector-types.cpp index 53a1a43fe4af3..f55713e6c0c81 100644 --- a/test/CodeGenCXX/mangle-ms-vector-types.cpp +++ b/test/CodeGenCXX/mangle-ms-vector-types.cpp @@ -1,37 +1,98 @@ -// RUN: %clang_cc1 -fms-extensions -ffreestanding -target-feature +avx -emit-llvm %s -o - -triple=i686-pc-win32 | FileCheck %s +// RUN: %clang_cc1 -fms-extensions -fcxx-exceptions -ffreestanding -target-feature +avx -emit-llvm %s -o - -triple=i686-pc-win32 | FileCheck %s #include <xmmintrin.h> #include <emmintrin.h> #include <immintrin.h> +void thow(int i) { + switch (i) { + case 0: throw __m64(); + // CHECK: ??_R0?AT__m64@@@8 + // CHECK: _CT??_R0?AT__m64@@@88 + // CHECK: _CTA1?AT__m64@@ + // CHECK: _TI1?AT__m64@@ + case 1: throw __m128(); + // CHECK: ??_R0?AT__m128@@@8 + // CHECK: _CT??_R0?AT__m128@@@816 + // CHECK: _CTA1?AT__m128@@ + // CHECK: _TI1?AT__m128@@ + case 2: throw __m128d(); + // CHECK: ??_R0?AU__m128d@@@8 + // CHECK: _CT??_R0?AU__m128d@@@816 + // CHECK: _CTA1?AU__m128d@@ + // CHECK: _TI1?AU__m128d@@ + case 3: throw __m128i(); + // CHECK: ??_R0?AT__m128i@@@8 + // CHECK: _CT??_R0?AT__m128i@@@816 + // CHECK: _CTA1?AT__m128i@@ + // CHECK: _TI1?AT__m128i@@ + case 4: throw __m256(); + // CHECK: ??_R0?AT__m256@@@8 + // CHECK: _CT??_R0?AT__m256@@@832 + // CHECK: _CTA1?AT__m256@@ + // CHECK: _TI1?AT__m256@@ + case 5: throw __m256d(); + // CHECK: ??_R0?AU__m256d@@@8 + // CHECK: _CT??_R0?AU__m256d@@@832 + // CHECK: _CTA1?AU__m256d@@ + // CHECK: _TI1?AU__m256d@@ + case 6: throw __m256i(); + // CHECK: ??_R0?AT__m256@@@8 + // CHECK: _CT??_R0?AT__m256@@@832 + // CHECK: _CTA1?AT__m256@@ + // CHECK: _TI1?AT__m256@@ + } +} + void foo64(__m64) {} -// CHECK: define void @"\01?foo64@@YAXT__m64@@@Z" +// CHECK: define dso_local void @"?foo64@@YAXT__m64@@@Z" + +__m64 rfoo64() { return __m64(); } +// CHECK: define dso_local <1 x i64> @"?rfoo64@@YA?AT__m64@@XZ" void foo128(__m128) {} -// CHECK: define void @"\01?foo128@@YAXT__m128@@@Z" +// CHECK: define dso_local void @"?foo128@@YAXT__m128@@@Z" + +const __m128 rfoo128() { return __m128(); } +// CHECK: define dso_local <4 x float> @"?rfoo128@@YA?BT__m128@@XZ" void foo128d(__m128d) {} -// CHECK: define void @"\01?foo128d@@YAXU__m128d@@@Z" +// CHECK: define dso_local void @"?foo128d@@YAXU__m128d@@@Z" + +volatile __m128d rfoo128d() { return __m128d(); } +// CHECK: define dso_local <2 x double> @"?rfoo128d@@YA?CU__m128d@@XZ" void foo128i(__m128i) {} -// CHECK: define void @"\01?foo128i@@YAXT__m128i@@@Z" +// CHECK: define dso_local void @"?foo128i@@YAXT__m128i@@@Z" + +const volatile __m128i rfoo128i() { return __m128i(); } +// CHECK: define dso_local <2 x i64> @"?rfoo128i@@YA?DT__m128i@@XZ" void foo256(__m256) {} -// CHECK: define void @"\01?foo256@@YAXT__m256@@@Z" +// CHECK: define dso_local void @"?foo256@@YAXT__m256@@@Z" + +__m256 rfoo256() { return __m256(); } +// CHECK: define dso_local <8 x float> @"?rfoo256@@YA?AT__m256@@XZ" void foo256d(__m256d) {} -// CHECK: define void @"\01?foo256d@@YAXU__m256d@@@Z" +// CHECK: define dso_local void @"?foo256d@@YAXU__m256d@@@Z" + +__m256d rfoo256d() { return __m256d(); } +// CHECK: define dso_local <4 x double> @"?rfoo256d@@YA?AU__m256d@@XZ" void foo256i(__m256i) {} -// CHECK: define void @"\01?foo256i@@YAXT__m256i@@@Z" +// CHECK: define dso_local void @"?foo256i@@YAXT__m256i@@@Z" + +__m256i rfoo256i() { return __m256i(); } +// CHECK: define dso_local <4 x i64> @"?rfoo256i@@YA?AT__m256i@@XZ" // We have a custom mangling for vector types not standardized by Intel. void foov8hi(__v8hi) {} -// CHECK: define void @"\01?foov8hi@@YAXT?$__vector@F$07@__clang@@@Z" +// CHECK: define dso_local void @"?foov8hi@@YAXT?$__vector@F$07@__clang@@@Z" typedef __attribute__((ext_vector_type(4))) int vi4b; void foovi4b(vi4b) {} -// CHECK: define void @"\01?foovi4b@@YAXT?$__vector@H$03@__clang@@@Z" +// CHECK: define dso_local void @"?foovi4b@@YAXT?$__vector@H$03@__clang@@@Z" // Clang does not support vectors of complex types, so we can't test the // mangling of them. diff --git a/test/CodeGenCXX/mangle-ms.cpp b/test/CodeGenCXX/mangle-ms.cpp index 7e2f17f27a965..3cc1b1645e9ca 100644 --- a/test/CodeGenCXX/mangle-ms.cpp +++ b/test/CodeGenCXX/mangle-ms.cpp @@ -2,7 +2,7 @@ // RUN: %clang_cc1 -fblocks -emit-llvm %s -o - -triple=x86_64-pc-win32 -std=c++98| FileCheck -check-prefix X64 %s int a; -// CHECK-DAG: @"\01?a@@3HA" +// CHECK-DAG: @"?a@@3HA" extern "C++" { static int __attribute__((used)) ignore_transparent_context; @@ -11,11 +11,11 @@ static int __attribute__((used)) ignore_transparent_context; namespace N { int b; -// CHECK-DAG: @"\01?b@N@@3HA" +// CHECK-DAG: @"?b@N@@3HA" namespace { int anonymous; -// CHECK-DAG: @"\01?anonymous@?A@N@@3HA" +// CHECK-DAG: @"?anonymous@?A@N@@3HA" } } @@ -23,38 +23,38 @@ static int c; // CHECK-DAG: @c int _c(void) {return N::anonymous + c;} -// CHECK-DAG: @"\01?_c@@YAHXZ" -// X64-DAG: @"\01?_c@@YAHXZ" +// CHECK-DAG: @"?_c@@YAHXZ" +// X64-DAG: @"?_c@@YAHXZ" const int &NeedsReferenceTemporary = 2; -// CHECK-DAG: @"\01?NeedsReferenceTemporary@@3ABHB" = constant i32* @"\01?$RT1@NeedsReferenceTemporary@@3ABHB" -// X64-DAG: @"\01?NeedsReferenceTemporary@@3AEBHEB" = constant i32* @"\01?$RT1@NeedsReferenceTemporary@@3AEBHEB" +// CHECK-DAG: @"?NeedsReferenceTemporary@@3ABHB" = dso_local constant i32* @"?$RT1@NeedsReferenceTemporary@@3ABHB" +// X64-DAG: @"?NeedsReferenceTemporary@@3AEBHEB" = dso_local constant i32* @"?$RT1@NeedsReferenceTemporary@@3AEBHEB" class foo { static const short d; -// CHECK-DAG: @"\01?d@foo@@0FB" +// CHECK-DAG: @"?d@foo@@0FB" protected: static volatile long e; -// CHECK-DAG: @"\01?e@foo@@1JC" +// CHECK-DAG: @"?e@foo@@1JC" public: static const volatile char f; -// CHECK-DAG: @"\01?f@foo@@2DD" +// CHECK-DAG: @"?f@foo@@2DD" int operator+(int a); foo(){} -// CHECK-DAG: @"\01??0foo@@QAE@XZ" -// X64-DAG: @"\01??0foo@@QEAA@XZ" +// CHECK-DAG: @"??0foo@@QAE@XZ" +// X64-DAG: @"??0foo@@QEAA@XZ" ~foo(){} -// CHECK-DAG: @"\01??1foo@@QAE@XZ" -// X64-DAG: @"\01??1foo@@QEAA@XZ +// CHECK-DAG: @"??1foo@@QAE@XZ" +// X64-DAG: @"??1foo@@QEAA@XZ foo(int i){} -// CHECK-DAG: @"\01??0foo@@QAE@H@Z" -// X64-DAG: @"\01??0foo@@QEAA@H@Z" +// CHECK-DAG: @"??0foo@@QAE@H@Z" +// X64-DAG: @"??0foo@@QEAA@H@Z" foo(char *q){} -// CHECK-DAG: @"\01??0foo@@QAE@PAD@Z" -// X64-DAG: @"\01??0foo@@QEAA@PEAD@Z" +// CHECK-DAG: @"??0foo@@QAE@PAD@Z" +// X64-DAG: @"??0foo@@QEAA@PEAD@Z" static foo* static_method() { return 0; } @@ -79,16 +79,16 @@ enum quux { }; foo bar() { return foo(); } -// CHECK-DAG: @"\01?bar@@YA?AVfoo@@XZ" -// X64-DAG: @"\01?bar@@YA?AVfoo@@XZ" +// CHECK-DAG: @"?bar@@YA?AVfoo@@XZ" +// X64-DAG: @"?bar@@YA?AVfoo@@XZ" int foo::operator+(int a) { -// CHECK-DAG: @"\01??Hfoo@@QAEHH@Z" -// X64-DAG: @"\01??Hfoo@@QEAAHH@Z" +// CHECK-DAG: @"??Hfoo@@QAEHH@Z" +// X64-DAG: @"??Hfoo@@QEAAHH@Z" foo::static_method(); -// CHECK-DAG: @"\01?static_method@foo@@SAPAV1@XZ" -// X64-DAG: @"\01?static_method@foo@@SAPEAV1@XZ" +// CHECK-DAG: @"?static_method@foo@@SAPAV1@XZ" +// X64-DAG: @"?static_method@foo@@SAPEAV1@XZ" bar(); return a; } @@ -98,33 +98,33 @@ volatile long foo::e; const volatile char foo::f = 'C'; int bar::g; -// CHECK-DAG: @"\01?g@bar@@2HA" +// CHECK-DAG: @"?g@bar@@2HA" extern int * const h1 = &a; -// CHECK-DAG: @"\01?h1@@3QAHA" +// CHECK-DAG: @"?h1@@3QAHA" extern const int * const h2 = &a; -// CHECK-DAG: @"\01?h2@@3QBHB" +// CHECK-DAG: @"?h2@@3QBHB" extern int * const __restrict h3 = &a; -// CHECK-DAG: @"\01?h3@@3QIAHIA" -// X64-DAG: @"\01?h3@@3QEIAHEIA" +// CHECK-DAG: @"?h3@@3QIAHIA" +// X64-DAG: @"?h3@@3QEIAHEIA" int i[10][20]; -// CHECK-DAG: @"\01?i@@3PAY0BE@HA" +// CHECK-DAG: @"?i@@3PAY0BE@HA" typedef int (*FunT)(int, int); FunT FunArr[10][20]; -// CHECK-DAG: @"\01?FunArr@@3PAY0BE@P6AHHH@ZA" -// X64-DAG: @"\01?FunArr@@3PAY0BE@P6AHHH@ZA" +// CHECK-DAG: @"?FunArr@@3PAY0BE@P6AHHH@ZA" +// X64-DAG: @"?FunArr@@3PAY0BE@P6AHHH@ZA" int (__stdcall *j)(signed char, unsigned char); -// CHECK-DAG: @"\01?j@@3P6GHCE@ZA" +// CHECK-DAG: @"?j@@3P6GHCE@ZA" const volatile char foo2::*k; -// CHECK-DAG: @"\01?k@@3PTfoo@@DT1@" -// X64-DAG: @"\01?k@@3PETfoo@@DET1@" +// CHECK-DAG: @"?k@@3PTfoo@@DT1@" +// X64-DAG: @"?k@@3PETfoo@@DET1@" int (foo2::*l)(int); -// CHECK-DAG: @"\01?l@@3P8foo@@AEHH@ZQ1@" +// CHECK-DAG: @"?l@@3P8foo@@AEHH@ZQ1@" // Ensure typedef CV qualifiers are mangled correctly typedef const int cInt; @@ -135,141 +135,141 @@ extern cInt g_cInt = 1; vInt g_vInt = 2; cvInt g_cvInt = 3; -// CHECK-DAG: @"\01?g_cInt@@3HB" -// CHECK-DAG: @"\01?g_vInt@@3HC" -// CHECK-DAG: @"\01?g_cvInt@@3HD" +// CHECK-DAG: @"?g_cInt@@3HB" +// CHECK-DAG: @"?g_vInt@@3HC" +// CHECK-DAG: @"?g_cvInt@@3HD" // Static functions are mangled, too. // Also make sure calling conventions, arglists, and throw specs work. static void __stdcall alpha(float a, double b) throw() {} bool __fastcall beta(long long a, wchar_t b) throw(signed char, unsigned char) { -// CHECK-DAG: @"\01?beta@@YI_N_J_W@Z" -// X64-DAG: @"\01?beta@@YA_N_J_W@Z" +// CHECK-DAG: @"?beta@@YI_N_J_W@Z" +// X64-DAG: @"?beta@@YA_N_J_W@Z" alpha(0.f, 0.0); return false; } -// CHECK-DAG: @"\01?alpha@@YGXMN@Z" -// X64-DAG: @"\01?alpha@@YAXMN@Z" +// CHECK-DAG: @"?alpha@@YGXMN@Z" +// X64-DAG: @"?alpha@@YAXMN@Z" // Make sure tag-type mangling works. void gamma(class foo, struct bar, union baz, enum quux) {} -// CHECK-DAG: @"\01?gamma@@YAXVfoo@@Ubar@@Tbaz@@W4quux@@@Z" -// X64-DAG: @"\01?gamma@@YAXVfoo@@Ubar@@Tbaz@@W4quux@@@Z" +// CHECK-DAG: @"?gamma@@YAXVfoo@@Ubar@@Tbaz@@W4quux@@@Z" +// X64-DAG: @"?gamma@@YAXVfoo@@Ubar@@Tbaz@@W4quux@@@Z" // Make sure pointer/reference-type mangling works. void delta(int * const a, const long &) {} -// CHECK-DAG: @"\01?delta@@YAXQAHABJ@Z" -// X64-DAG: @"\01?delta@@YAXQEAHAEBJ@Z" +// CHECK-DAG: @"?delta@@YAXQAHABJ@Z" +// X64-DAG: @"?delta@@YAXQEAHAEBJ@Z" // Array mangling. void epsilon(int a[][10][20]) {} -// CHECK-DAG: @"\01?epsilon@@YAXQAY19BE@H@Z" -// X64-DAG: @"\01?epsilon@@YAXQEAY19BE@H@Z" +// CHECK-DAG: @"?epsilon@@YAXQAY19BE@H@Z" +// X64-DAG: @"?epsilon@@YAXQEAY19BE@H@Z" void zeta(int (*)(int, int)) {} -// CHECK-DAG: @"\01?zeta@@YAXP6AHHH@Z@Z" -// X64-DAG: @"\01?zeta@@YAXP6AHHH@Z@Z" +// CHECK-DAG: @"?zeta@@YAXP6AHHH@Z@Z" +// X64-DAG: @"?zeta@@YAXP6AHHH@Z@Z" // Blocks mangling (Clang extension). A block should be mangled slightly // differently from a similar function pointer. void eta(int (^)(int, int)) {} -// CHECK-DAG: @"\01?eta@@YAXP_EAHHH@Z@Z" +// CHECK-DAG: @"?eta@@YAXP_EAHHH@Z@Z" typedef int theta_arg(int,int); void theta(theta_arg^ block) {} -// CHECK-DAG: @"\01?theta@@YAXP_EAHHH@Z@Z" +// CHECK-DAG: @"?theta@@YAXP_EAHHH@Z@Z" void operator_new_delete() { char *ptr = new char; -// CHECK-DAG: @"\01??2@YAPAXI@Z" +// CHECK-DAG: @"??2@YAPAXI@Z" delete ptr; -// CHECK-DAG: @"\01??3@YAXPAX@Z" +// CHECK-DAG: @"??3@YAXPAX@Z" char *array = new char[42]; -// CHECK-DAG: @"\01??_U@YAPAXI@Z" +// CHECK-DAG: @"??_U@YAPAXI@Z" delete [] array; -// CHECK-DAG: @"\01??_V@YAXPAX@Z" +// CHECK-DAG: @"??_V@YAXPAX@Z" } // PR13022 void (redundant_parens)(); void redundant_parens_use() { redundant_parens(); } -// CHECK-DAG: @"\01?redundant_parens@@YAXXZ" -// X64-DAG: @"\01?redundant_parens@@YAXXZ" +// CHECK-DAG: @"?redundant_parens@@YAXXZ" +// X64-DAG: @"?redundant_parens@@YAXXZ" // PR13047 typedef double RGB[3]; RGB color1; -// CHECK-DAG: @"\01?color1@@3PANA" +// CHECK-DAG: @"?color1@@3PANA" extern const RGB color2 = {}; -// CHECK-DAG: @"\01?color2@@3QBNB" +// CHECK-DAG: @"?color2@@3QBNB" extern RGB const color3[5] = {}; -// CHECK-DAG: @"\01?color3@@3QAY02$$CBNA" +// CHECK-DAG: @"?color3@@3QAY02$$CBNA" extern RGB const ((color4)[5]) = {}; -// CHECK-DAG: @"\01?color4@@3QAY02$$CBNA" +// CHECK-DAG: @"?color4@@3QAY02$$CBNA" struct B; volatile int B::* volatile memptr1; -// X64-DAG: @"\01?memptr1@@3RESB@@HES1@" +// X64-DAG: @"?memptr1@@3RESB@@HES1@" volatile int B::* memptr2; -// X64-DAG: @"\01?memptr2@@3PESB@@HES1@" +// X64-DAG: @"?memptr2@@3PESB@@HES1@" int B::* volatile memptr3; -// X64-DAG: @"\01?memptr3@@3REQB@@HEQ1@" +// X64-DAG: @"?memptr3@@3REQB@@HEQ1@" typedef int (*fun)(); volatile fun B::* volatile funmemptr1; -// X64-DAG: @"\01?funmemptr1@@3RESB@@R6AHXZES1@" +// X64-DAG: @"?funmemptr1@@3RESB@@R6AHXZES1@" volatile fun B::* funmemptr2; -// X64-DAG: @"\01?funmemptr2@@3PESB@@R6AHXZES1@" +// X64-DAG: @"?funmemptr2@@3PESB@@R6AHXZES1@" fun B::* volatile funmemptr3; -// X64-DAG: @"\01?funmemptr3@@3REQB@@P6AHXZEQ1@" +// X64-DAG: @"?funmemptr3@@3REQB@@P6AHXZEQ1@" void (B::* volatile memptrtofun1)(); -// X64-DAG: @"\01?memptrtofun1@@3R8B@@EAAXXZEQ1@" +// X64-DAG: @"?memptrtofun1@@3R8B@@EAAXXZEQ1@" const void (B::* memptrtofun2)(); -// X64-DAG: @"\01?memptrtofun2@@3P8B@@EAAXXZEQ1@" +// X64-DAG: @"?memptrtofun2@@3P8B@@EAAXXZEQ1@" volatile void (B::* memptrtofun3)(); -// X64-DAG: @"\01?memptrtofun3@@3P8B@@EAAXXZEQ1@" +// X64-DAG: @"?memptrtofun3@@3P8B@@EAAXXZEQ1@" int (B::* volatile memptrtofun4)(); -// X64-DAG: @"\01?memptrtofun4@@3R8B@@EAAHXZEQ1@" +// X64-DAG: @"?memptrtofun4@@3R8B@@EAAHXZEQ1@" volatile int (B::* memptrtofun5)(); -// X64-DAG: @"\01?memptrtofun5@@3P8B@@EAA?CHXZEQ1@" +// X64-DAG: @"?memptrtofun5@@3P8B@@EAA?CHXZEQ1@" const int (B::* memptrtofun6)(); -// X64-DAG: @"\01?memptrtofun6@@3P8B@@EAA?BHXZEQ1@" +// X64-DAG: @"?memptrtofun6@@3P8B@@EAA?BHXZEQ1@" fun (B::* volatile memptrtofun7)(); -// X64-DAG: @"\01?memptrtofun7@@3R8B@@EAAP6AHXZXZEQ1@" +// X64-DAG: @"?memptrtofun7@@3R8B@@EAAP6AHXZXZEQ1@" volatile fun (B::* memptrtofun8)(); -// X64-DAG: @"\01?memptrtofun8@@3P8B@@EAAR6AHXZXZEQ1@" +// X64-DAG: @"?memptrtofun8@@3P8B@@EAAR6AHXZXZEQ1@" const fun (B::* memptrtofun9)(); -// X64-DAG: @"\01?memptrtofun9@@3P8B@@EAAQ6AHXZXZEQ1@" +// X64-DAG: @"?memptrtofun9@@3P8B@@EAAQ6AHXZXZEQ1@" // PR12603 enum E {}; -// CHECK-DAG: "\01?fooE@@YA?AW4E@@XZ" -// X64-DAG: "\01?fooE@@YA?AW4E@@XZ" +// CHECK-DAG: "?fooE@@YA?AW4E@@XZ" +// X64-DAG: "?fooE@@YA?AW4E@@XZ" E fooE() { return E(); } class X {}; -// CHECK-DAG: "\01?fooX@@YA?AVX@@XZ" -// X64-DAG: "\01?fooX@@YA?AVX@@XZ" +// CHECK-DAG: "?fooX@@YA?AVX@@XZ" +// X64-DAG: "?fooX@@YA?AVX@@XZ" X fooX() { return X(); } namespace PR13182 { extern char s0[]; - // CHECK-DAG: @"\01?s0@PR13182@@3PADA" + // CHECK-DAG: @"?s0@PR13182@@3PADA" extern char s1[42]; - // CHECK-DAG: @"\01?s1@PR13182@@3PADA" + // CHECK-DAG: @"?s1@PR13182@@3PADA" extern const char s2[]; - // CHECK-DAG: @"\01?s2@PR13182@@3QBDB" + // CHECK-DAG: @"?s2@PR13182@@3QBDB" extern const char s3[42]; - // CHECK-DAG: @"\01?s3@PR13182@@3QBDB" + // CHECK-DAG: @"?s3@PR13182@@3QBDB" extern volatile char s4[]; - // CHECK-DAG: @"\01?s4@PR13182@@3RCDC" + // CHECK-DAG: @"?s4@PR13182@@3RCDC" extern const volatile char s5[]; - // CHECK-DAG: @"\01?s5@PR13182@@3SDDD" + // CHECK-DAG: @"?s5@PR13182@@3SDDD" extern const char* const* s6; - // CHECK-DAG: @"\01?s6@PR13182@@3PBQBDB" + // CHECK-DAG: @"?s6@PR13182@@3PBQBDB" char foo() { return s0[0] + s1[0] + s2[0] + s3[0] + s4[0] + s5[0] + s6[0][0]; @@ -278,8 +278,8 @@ namespace PR13182 { extern "C" inline void extern_c_func() { static int local; -// CHECK-DAG: @"\01?local@?1??extern_c_func@@9@4HA" -// X64-DAG: @"\01?local@?1??extern_c_func@@9@4HA" +// CHECK-DAG: @"?local@?1??extern_c_func@@9@4HA" +// X64-DAG: @"?local@?1??extern_c_func@@9@4HA" } void call_extern_c_func() { @@ -310,7 +310,7 @@ inline int inline_function_with_local_type() { static struct { int a_field; } static_variable_in_inline_function = { 20 }, second_static = { 40 }; - // CHECK: @"\01?static_variable_in_inline_function@?1??inline_function_with_local_type@@YAHXZ@4U<unnamed-type-static_variable_in_inline_function>@?1??1@YAHXZ@A" + // CHECK: @"?static_variable_in_inline_function@?1??inline_function_with_local_type@@YAHXZ@4U<unnamed-type-static_variable_in_inline_function>@?1??1@YAHXZ@A" return static_variable_in_inline_function.a_field + second_static.a_field; } @@ -325,7 +325,7 @@ inline int templated_inline_function_with_local_type() { int a_field; } static_variable_in_templated_inline_function = { 20 }, second_static = { 40 }; - // CHECK: @"\01?static_variable_in_templated_inline_function@?1???$templated_inline_function_with_local_type@H@@YAHXZ@4U<unnamed-type-static_variable_in_templated_inline_function>@?1???$templated_inline_function_with_local_type@H@@YAHXZ@A" + // CHECK: @"?static_variable_in_templated_inline_function@?1???$templated_inline_function_with_local_type@H@@YAHXZ@4U<unnamed-type-static_variable_in_templated_inline_function>@?1???$templated_inline_function_with_local_type@H@@YAHXZ@A" return static_variable_in_templated_inline_function.a_field + second_static.a_field; @@ -388,16 +388,16 @@ void TypedefNewDelete::operator delete[](void *) { } // CHECK-DAG: ??_VTypedefNewDelete@@SAXPAX@Z void __vectorcall vector_func() { } -// CHECK-DAG: @"\01?vector_func@@YQXXZ" +// CHECK-DAG: @"?vector_func@@YQXXZ" template <void (*)(void)> void fn_tmpl() {} template void fn_tmpl<extern_c_func>(); -// CHECK-DAG: @"\01??$fn_tmpl@$1?extern_c_func@@YAXXZ@@YAXXZ" +// CHECK-DAG: @"??$fn_tmpl@$1?extern_c_func@@YAXXZ@@YAXXZ" extern "C" void __attribute__((overloadable)) overloaded_fn() {} -// CHECK-DAG: @"\01?overloaded_fn@@$$J0YAXXZ" +// CHECK-DAG: @"?overloaded_fn@@$$J0YAXXZ" extern "C" void overloaded_fn2() {} // CHECK-DAG: @overloaded_fn2 @@ -420,19 +420,19 @@ void f(S::T3) {} void f(S::T4) {} void f(S::T5) {} void f(S::T6) {} -// CHECK-DAG: @"\01?f@UnnamedType@@YAXQAPAU<unnamed-type-T1>@S@1@@Z" -// CHECK-DAG: @"\01?f@UnnamedType@@YAXUT2@S@1@@Z" -// CHECK-DAG: @"\01?f@UnnamedType@@YAXPAUT4@S@1@@Z" -// CHECK-DAG: @"\01?f@UnnamedType@@YAXUT4@S@1@@Z" -// CHECK-DAG: @"\01?f@UnnamedType@@YAXUT5@S@1@@Z" -// CHECK-DAG: @"\01?f@UnnamedType@@YAXPAU<unnamed-type-T6>@S@1@@Z" - -// X64-DAG: @"\01?f@UnnamedType@@YAXQEAPEAU<unnamed-type-T1>@S@1@@Z" -// X64-DAG: @"\01?f@UnnamedType@@YAXUT2@S@1@@Z" -// X64-DAG: @"\01?f@UnnamedType@@YAXPEAUT4@S@1@@Z"(%"struct.UnnamedType::S::T4" -// X64-DAG: @"\01?f@UnnamedType@@YAXUT4@S@1@@Z" -// X64-DAG: @"\01?f@UnnamedType@@YAXUT5@S@1@@Z" -// X64-DAG: @"\01?f@UnnamedType@@YAXPEAU<unnamed-type-T6>@S@1@@Z" +// CHECK-DAG: @"?f@UnnamedType@@YAXQAPAU<unnamed-type-T1>@S@1@@Z" +// CHECK-DAG: @"?f@UnnamedType@@YAXUT2@S@1@@Z" +// CHECK-DAG: @"?f@UnnamedType@@YAXPAUT4@S@1@@Z" +// CHECK-DAG: @"?f@UnnamedType@@YAXUT4@S@1@@Z" +// CHECK-DAG: @"?f@UnnamedType@@YAXUT5@S@1@@Z" +// CHECK-DAG: @"?f@UnnamedType@@YAXPAU<unnamed-type-T6>@S@1@@Z" + +// X64-DAG: @"?f@UnnamedType@@YAXQEAPEAU<unnamed-type-T1>@S@1@@Z" +// X64-DAG: @"?f@UnnamedType@@YAXUT2@S@1@@Z" +// X64-DAG: @"?f@UnnamedType@@YAXPEAUT4@S@1@@Z"(%"struct.UnnamedType::S::T4" +// X64-DAG: @"?f@UnnamedType@@YAXUT4@S@1@@Z" +// X64-DAG: @"?f@UnnamedType@@YAXUT5@S@1@@Z" +// X64-DAG: @"?f@UnnamedType@@YAXPEAU<unnamed-type-T6>@S@1@@Z" } namespace PassObjectSize { @@ -448,24 +448,28 @@ namespace PassObjectSize { // void foo(void *const, __clang::__pass_object_size0); // where __clang is a top-level namespace. -// CHECK-DAG: define i32 @"\01?foo@PassObjectSize@@YAHQAHW4__pass_object_size0@__clang@@@Z" +// CHECK-DAG: define dso_local i32 @"?foo@PassObjectSize@@YAHQAHW4__pass_object_size0@__clang@@@Z" int foo(int *const i __attribute__((pass_object_size(0)))) { return 0; } -// CHECK-DAG: define i32 @"\01?bar@PassObjectSize@@YAHQAHW4__pass_object_size1@__clang@@@Z" +// CHECK-DAG: define dso_local i32 @"?bar@PassObjectSize@@YAHQAHW4__pass_object_size1@__clang@@@Z" int bar(int *const i __attribute__((pass_object_size(1)))) { return 0; } -// CHECK-DAG: define i32 @"\01?qux@PassObjectSize@@YAHQAHW4__pass_object_size1@__clang@@0W4__pass_object_size0@3@@Z" +// CHECK-DAG: define dso_local i32 @"?qux@PassObjectSize@@YAHQAHW4__pass_object_size1@__clang@@0W4__pass_object_size0@3@@Z" int qux(int *const i __attribute__((pass_object_size(1))), int *const j __attribute__((pass_object_size(0)))) { return 0; } -// CHECK-DAG: define i32 @"\01?zot@PassObjectSize@@YAHQAHW4__pass_object_size1@__clang@@01@Z" +// CHECK-DAG: define dso_local i32 @"?zot@PassObjectSize@@YAHQAHW4__pass_object_size1@__clang@@01@Z" int zot(int *const i __attribute__((pass_object_size(1))), int *const j __attribute__((pass_object_size(1)))) { return 0; } } namespace Atomic { -// CHECK-DAG: define void @"\01?f@Atomic@@YAXU?$_Atomic@H@__clang@@@Z"( +// CHECK-DAG: define dso_local void @"?f@Atomic@@YAXU?$_Atomic@H@__clang@@@Z"( void f(_Atomic(int)) {} } namespace Complex { -// CHECK-DAG: define void @"\01?f@Complex@@YAXU?$_Complex@H@__clang@@@Z"( +// CHECK-DAG: define dso_local void @"?f@Complex@@YAXU?$_Complex@H@__clang@@@Z"( void f(_Complex int) {} } +namespace Float16 { +// CHECK-DAG: define dso_local void @"?f@Float16@@YAXU_Float16@__clang@@@Z"( +void f(_Float16) {} +} namespace PR26029 { template <class> @@ -489,5 +493,5 @@ void runOnFunction() { L<H<int *> > b; m_fn3<int>(); } -// CHECK-DAG: call {{.*}} @"\01??0?$L@V?$H@PAH@PR26029@@@PR26029@@QAE@XZ" +// CHECK-DAG: call {{.*}} @"??0?$L@V?$H@PAH@PR26029@@@PR26029@@QAE@XZ" } diff --git a/test/CodeGenCXX/mangle-windows.cpp b/test/CodeGenCXX/mangle-windows.cpp index 85644475ddf5b..a9d7be1197cc8 100644 --- a/test/CodeGenCXX/mangle-windows.cpp +++ b/test/CodeGenCXX/mangle-windows.cpp @@ -5,20 +5,20 @@ // RUN: FileCheck --check-prefix=ITANIUM %s void __stdcall f1(void) {} -// WIN: define x86_stdcallcc void @"\01?f1@@YGXXZ" -// ITANIUM: define x86_stdcallcc void @"\01__Z2f1v@0" +// WIN: define dso_local x86_stdcallcc void @"?f1@@YGXXZ" +// ITANIUM: define dso_local x86_stdcallcc void @"\01__Z2f1v@0" void __fastcall f2(void) {} -// WIN: define x86_fastcallcc void @"\01?f2@@YIXXZ" -// ITANIUM: define x86_fastcallcc void @"\01@_Z2f2v@0" +// WIN: define dso_local x86_fastcallcc void @"?f2@@YIXXZ" +// ITANIUM: define dso_local x86_fastcallcc void @"\01@_Z2f2v@0" extern "C" void __stdcall f3(void) {} -// WIN: define x86_stdcallcc void @"\01_f3@0" -// ITANIUM: define x86_stdcallcc void @"\01_f3@0" +// WIN: define dso_local x86_stdcallcc void @"\01_f3@0" +// ITANIUM: define dso_local x86_stdcallcc void @"\01_f3@0" extern "C" void __fastcall f4(void) {} -// WIN: define x86_fastcallcc void @"\01@f4@0" -// ITANIUM: define x86_fastcallcc void @"\01@f4@0" +// WIN: define dso_local x86_fastcallcc void @"\01@f4@0" +// ITANIUM: define dso_local x86_fastcallcc void @"\01@f4@0" struct Foo { void __stdcall foo(); @@ -26,17 +26,17 @@ struct Foo { }; void Foo::foo() {} -// WIN: define x86_stdcallcc void @"\01?foo@Foo@@QAGXXZ" -// ITANIUM: define x86_stdcallcc void @"\01__ZN3Foo3fooEv@4" +// WIN: define dso_local x86_stdcallcc void @"?foo@Foo@@QAGXXZ" +// ITANIUM: define dso_local x86_stdcallcc void @"\01__ZN3Foo3fooEv@4" void Foo::bar() {} -// WIN: define x86_stdcallcc void @"\01?bar@Foo@@SGXXZ" -// ITANIUM: define x86_stdcallcc void @"\01__ZN3Foo3barEv@0" +// WIN: define dso_local x86_stdcallcc void @"?bar@Foo@@SGXXZ" +// ITANIUM: define dso_local x86_stdcallcc void @"\01__ZN3Foo3barEv@0" // Mostly a test that we don't crash and that the names start with a \01. // gcc on mingw produces __Zpp@4 // cl produces _++@4 extern "C" void __stdcall operator++(Foo &x) { } -// WIN: define x86_stdcallcc void @"\01??E@YGXAAUFoo@@@Z" -// ITANIUM: define x86_stdcallcc void @"\01__ZppR3Foo@4" +// WIN: define dso_local x86_stdcallcc void @"??E@YGXAAUFoo@@@Z" +// ITANIUM: define dso_local x86_stdcallcc void @"\01__ZppR3Foo@4" diff --git a/test/CodeGenCXX/member-function-pointer-calls.cpp b/test/CodeGenCXX/member-function-pointer-calls.cpp index 67417ef046930..198119b7cdcf1 100644 --- a/test/CodeGenCXX/member-function-pointer-calls.cpp +++ b/test/CodeGenCXX/member-function-pointer-calls.cpp @@ -11,7 +11,7 @@ int f(A* a, int (A::*fp)()) { // CHECK-LABEL: define i32 @_Z2g1v() // CHECK: ret i32 1 -// MINGW64-LABEL: define i32 @_Z2g1v() +// MINGW64-LABEL: define dso_local i32 @_Z2g1v() // MINGW64: call i32 @_Z1fP1AMS_FivE(%struct.A* %{{.*}}, { i64, i64 }* %{{.*}}) int g1() { A a; @@ -20,7 +20,7 @@ int g1() { // CHECK-LABEL: define i32 @_Z2g2v() // CHECK: ret i32 2 -// MINGW64-LABEL: define i32 @_Z2g2v() +// MINGW64-LABEL: define dso_local i32 @_Z2g2v() // MINGW64: call i32 @_Z1fP1AMS_FivE(%struct.A* %{{.*}}, { i64, i64 }* %{{.*}}) int g2() { A a; diff --git a/test/CodeGenCXX/microsoft-abi-arg-order.cpp b/test/CodeGenCXX/microsoft-abi-arg-order.cpp index 68c141f1620fc..df945f9885e67 100644 --- a/test/CodeGenCXX/microsoft-abi-arg-order.cpp +++ b/test/CodeGenCXX/microsoft-abi-arg-order.cpp @@ -13,21 +13,21 @@ void foo(A a, A b, A c) { // Order of destruction should be left to right. // -// X86-LABEL: define void @"\01?foo@@YAXUA@@00@Z" +// X86-LABEL: define dso_local void @"?foo@@YAXUA@@00@Z" // X86: ([[argmem_ty:<{ %struct.A, %struct.A, %struct.A }>]]* inalloca) // X86: %[[a:[^ ]*]] = getelementptr inbounds [[argmem_ty]], [[argmem_ty]]* %0, i32 0, i32 0 // X86: %[[b:[^ ]*]] = getelementptr inbounds [[argmem_ty]], [[argmem_ty]]* %0, i32 0, i32 1 // X86: %[[c:[^ ]*]] = getelementptr inbounds [[argmem_ty]], [[argmem_ty]]* %0, i32 0, i32 2 -// X86: call x86_thiscallcc void @"\01??1A@@QAE@XZ"(%struct.A* %[[a]]) -// X86: call x86_thiscallcc void @"\01??1A@@QAE@XZ"(%struct.A* %[[b]]) -// X86: call x86_thiscallcc void @"\01??1A@@QAE@XZ"(%struct.A* %[[c]]) +// X86: call x86_thiscallcc void @"??1A@@QAE@XZ"(%struct.A* %[[a]]) +// X86: call x86_thiscallcc void @"??1A@@QAE@XZ"(%struct.A* %[[b]]) +// X86: call x86_thiscallcc void @"??1A@@QAE@XZ"(%struct.A* %[[c]]) // X86: ret void -// X64-LABEL: define void @"\01?foo@@YAXUA@@00@Z" +// X64-LABEL: define dso_local void @"?foo@@YAXUA@@00@Z" // X64: (%struct.A* %[[a:[^,]*]], %struct.A* %[[b:[^,]*]], %struct.A* %[[c:[^)]*]]) -// X64: call void @"\01??1A@@QEAA@XZ"(%struct.A* %[[a]]) -// X64: call void @"\01??1A@@QEAA@XZ"(%struct.A* %[[b]]) -// X64: call void @"\01??1A@@QEAA@XZ"(%struct.A* %[[c]]) +// X64: call void @"??1A@@QEAA@XZ"(%struct.A* %[[a]]) +// X64: call void @"??1A@@QEAA@XZ"(%struct.A* %[[b]]) +// X64: call void @"??1A@@QEAA@XZ"(%struct.A* %[[c]]) // X64: ret void @@ -38,39 +38,39 @@ void call_foo() { // Order of evaluation should be right to left, and we should clean up the right // things as we unwind. // -// X86-LABEL: define void @"\01?call_foo@@YAXXZ"() +// X86-LABEL: define dso_local void @"?call_foo@@YAXXZ"() // X86: call i8* @llvm.stacksave() // X86: %[[argmem:[^ ]*]] = alloca inalloca [[argmem_ty]] // X86: %[[arg3:[^ ]*]] = getelementptr inbounds [[argmem_ty]], [[argmem_ty]]* %[[argmem]], i32 0, i32 2 -// X86: call x86_thiscallcc %struct.A* @"\01??0A@@QAE@H@Z"(%struct.A* %[[arg3]], i32 3) +// X86: call x86_thiscallcc %struct.A* @"??0A@@QAE@H@Z"(%struct.A* %[[arg3]], i32 3) // X86: %[[arg2:[^ ]*]] = getelementptr inbounds [[argmem_ty]], [[argmem_ty]]* %[[argmem]], i32 0, i32 1 -// X86: invoke x86_thiscallcc %struct.A* @"\01??0A@@QAE@H@Z"(%struct.A* %[[arg2]], i32 2) +// X86: invoke x86_thiscallcc %struct.A* @"??0A@@QAE@H@Z"(%struct.A* %[[arg2]], i32 2) // X86: %[[arg1:[^ ]*]] = getelementptr inbounds [[argmem_ty]], [[argmem_ty]]* %[[argmem]], i32 0, i32 0 -// X86: invoke x86_thiscallcc %struct.A* @"\01??0A@@QAE@H@Z"(%struct.A* %[[arg1]], i32 1) -// X86: call void @"\01?foo@@YAXUA@@00@Z"([[argmem_ty]]* inalloca %[[argmem]]) +// X86: invoke x86_thiscallcc %struct.A* @"??0A@@QAE@H@Z"(%struct.A* %[[arg1]], i32 1) +// X86: call void @"?foo@@YAXUA@@00@Z"([[argmem_ty]]* inalloca %[[argmem]]) // X86: call void @llvm.stackrestore // X86: ret void // // lpad2: // X86: cleanuppad within none [] -// X86: call x86_thiscallcc void @"\01??1A@@QAE@XZ"(%struct.A* %[[arg2]]) +// X86: call x86_thiscallcc void @"??1A@@QAE@XZ"(%struct.A* %[[arg2]]) // X86: cleanupret // // ehcleanup: -// X86: call x86_thiscallcc void @"\01??1A@@QAE@XZ"(%struct.A* %[[arg3]]) +// X86: call x86_thiscallcc void @"??1A@@QAE@XZ"(%struct.A* %[[arg3]]) -// X64-LABEL: define void @"\01?call_foo@@YAXXZ"() -// X64: call %struct.A* @"\01??0A@@QEAA@H@Z"(%struct.A* %[[arg3:[^,]*]], i32 3) -// X64: invoke %struct.A* @"\01??0A@@QEAA@H@Z"(%struct.A* %[[arg2:[^,]*]], i32 2) -// X64: invoke %struct.A* @"\01??0A@@QEAA@H@Z"(%struct.A* %[[arg1:[^,]*]], i32 1) -// X64: call void @"\01?foo@@YAXUA@@00@Z" +// X64-LABEL: define dso_local void @"?call_foo@@YAXXZ"() +// X64: call %struct.A* @"??0A@@QEAA@H@Z"(%struct.A* %[[arg3:[^,]*]], i32 3) +// X64: invoke %struct.A* @"??0A@@QEAA@H@Z"(%struct.A* %[[arg2:[^,]*]], i32 2) +// X64: invoke %struct.A* @"??0A@@QEAA@H@Z"(%struct.A* %[[arg1:[^,]*]], i32 1) +// X64: call void @"?foo@@YAXUA@@00@Z" // X64: (%struct.A* %[[arg1]], %struct.A* %[[arg2]], %struct.A* %[[arg3]]) // X64: ret void // // lpad2: // X64: cleanuppad within none [] -// X64: call void @"\01??1A@@QEAA@XZ"(%struct.A* %[[arg2]]) +// X64: call void @"??1A@@QEAA@XZ"(%struct.A* %[[arg2]]) // X64: cleanupret // // ehcleanup: -// X64: call void @"\01??1A@@QEAA@XZ"(%struct.A* %[[arg3]]) +// X64: call void @"??1A@@QEAA@XZ"(%struct.A* %[[arg3]]) diff --git a/test/CodeGenCXX/microsoft-abi-array-cookies.cpp b/test/CodeGenCXX/microsoft-abi-array-cookies.cpp index 146a6c8eda06e..28140451529df 100644 --- a/test/CodeGenCXX/microsoft-abi-array-cookies.cpp +++ b/test/CodeGenCXX/microsoft-abi-array-cookies.cpp @@ -5,12 +5,12 @@ struct ClassWithoutDtor { }; void check_array_no_cookies() { -// CHECK: define void @"\01?check_array_no_cookies@@YAXXZ"() [[NUW:#[0-9]+]] +// CHECK: define dso_local void @"?check_array_no_cookies@@YAXXZ"() [[NUW:#[0-9]+]] -// CHECK: call i8* @"\01??_U@YAPAXI@Z"(i32 42) +// CHECK: call i8* @"??_U@YAPAXI@Z"(i32 42) ClassWithoutDtor *array = new ClassWithoutDtor[42]; -// CHECK: call void @"\01??_V@YAXPAX@Z"( +// CHECK: call void @"??_V@YAXPAX@Z"( delete [] array; } @@ -21,10 +21,10 @@ struct ClassWithDtor { }; void check_array_cookies_simple() { -// CHECK: define {{.*}} @"\01?check_array_cookies_simple@@YAXXZ"() +// CHECK: define {{.*}} @"?check_array_cookies_simple@@YAXXZ"() ClassWithDtor *array = new ClassWithDtor[42]; -// CHECK: [[ALLOCATED:%.*]] = call i8* @"\01??_U@YAPAXI@Z"(i32 46) +// CHECK: [[ALLOCATED:%.*]] = call i8* @"??_U@YAPAXI@Z"(i32 46) // 46 = 42 + size of cookie (4) // CHECK: [[COOKIE:%.*]] = bitcast i8* [[ALLOCATED]] to i32* // CHECK: store i32 42, i32* [[COOKIE]] @@ -44,9 +44,9 @@ struct __attribute__((aligned(8))) ClassWithAlignment { }; void check_array_cookies_aligned() { -// CHECK: define {{.*}} @"\01?check_array_cookies_aligned@@YAXXZ"() +// CHECK: define {{.*}} @"?check_array_cookies_aligned@@YAXXZ"() ClassWithAlignment *array = new ClassWithAlignment[42]; -// CHECK: [[ALLOCATED:%.*]] = call i8* @"\01??_U@YAPAXI@Z"(i32 344) +// CHECK: [[ALLOCATED:%.*]] = call i8* @"??_U@YAPAXI@Z"(i32 344) // 344 = 42*8 + size of cookie (8, due to alignment) // CHECK: [[COOKIE:%.*]] = bitcast i8* [[ALLOCATED]] to i32* // CHECK: store i32 42, i32* [[COOKIE]] @@ -62,8 +62,8 @@ namespace PR23990 { struct S { char x[42]; void operator delete[](void *p, __SIZE_TYPE__); - // CHECK-LABEL: define void @"\01?delete_s@PR23990@@YAXPAUS@1@@Z"( - // CHECK: call void @"\01??_VS@PR23990@@SAXPAXI@Z"(i8* {{.*}}, i32 42) + // CHECK-LABEL: define dso_local void @"?delete_s@PR23990@@YAXPAUS@1@@Z"( + // CHECK: call void @"??_VS@PR23990@@SAXPAXI@Z"(i8* {{.*}}, i32 42) }; void delete_s(S *s) { delete[] s; } } diff --git a/test/CodeGenCXX/microsoft-abi-byval-sret.cpp b/test/CodeGenCXX/microsoft-abi-byval-sret.cpp index 57ac79500aa86..cbedec69583f7 100644 --- a/test/CodeGenCXX/microsoft-abi-byval-sret.cpp +++ b/test/CodeGenCXX/microsoft-abi-byval-sret.cpp @@ -18,7 +18,7 @@ A B::foo(A x) { return x; } -// CHECK-LABEL: define x86_thiscallcc %struct.A* @"\01?foo@B@@QAE?AUA@@U2@@Z" +// CHECK-LABEL: define dso_local x86_thiscallcc %struct.A* @"?foo@B@@QAE?AUA@@U2@@Z" // CHECK: (%struct.B* %this, <{ %struct.A*, %struct.A }>* inalloca) // CHECK: getelementptr inbounds <{ %struct.A*, %struct.A }>, <{ %struct.A*, %struct.A }>* %{{.*}}, i32 0, i32 0 // CHECK: load %struct.A*, %struct.A** @@ -28,7 +28,7 @@ A B::bar(A x) { return x; } -// CHECK-LABEL: define %struct.A* @"\01?bar@B@@QAA?AUA@@U2@@Z" +// CHECK-LABEL: define dso_local %struct.A* @"?bar@B@@QAA?AUA@@U2@@Z" // CHECK: (<{ %struct.B*, %struct.A*, %struct.A }>* inalloca) // CHECK: getelementptr inbounds <{ %struct.B*, %struct.A*, %struct.A }>, <{ %struct.B*, %struct.A*, %struct.A }>* %{{.*}}, i32 0, i32 1 // CHECK: load %struct.A*, %struct.A** @@ -38,7 +38,7 @@ A B::baz(A x) { return x; } -// CHECK-LABEL: define x86_stdcallcc %struct.A* @"\01?baz@B@@QAG?AUA@@U2@@Z" +// CHECK-LABEL: define dso_local x86_stdcallcc %struct.A* @"?baz@B@@QAG?AUA@@U2@@Z" // CHECK: (<{ %struct.B*, %struct.A*, %struct.A }>* inalloca) // CHECK: getelementptr inbounds <{ %struct.B*, %struct.A*, %struct.A }>, <{ %struct.B*, %struct.A*, %struct.A }>* %{{.*}}, i32 0, i32 1 // CHECK: load %struct.A*, %struct.A** @@ -48,7 +48,7 @@ A B::qux(A x) { return x; } -// CHECK-LABEL: define x86_fastcallcc void @"\01?qux@B@@QAI?AUA@@U2@@Z" +// CHECK-LABEL: define dso_local x86_fastcallcc void @"?qux@B@@QAI?AUA@@U2@@Z" // CHECK: (%struct.B* inreg %this, %struct.A* inreg noalias sret %agg.result, <{ %struct.A }>* inalloca) // CHECK: ret void @@ -60,11 +60,11 @@ int main() { a = b.qux(a); } -// CHECK: call x86_thiscallcc %struct.A* @"\01?foo@B@@QAE?AUA@@U2@@Z" +// CHECK: call x86_thiscallcc %struct.A* @"?foo@B@@QAE?AUA@@U2@@Z" // CHECK: (%struct.B* %{{[^,]*}}, <{ %struct.A*, %struct.A }>* inalloca %{{[^,]*}}) -// CHECK: call %struct.A* @"\01?bar@B@@QAA?AUA@@U2@@Z" +// CHECK: call %struct.A* @"?bar@B@@QAA?AUA@@U2@@Z" // CHECK: (<{ %struct.B*, %struct.A*, %struct.A }>* inalloca %{{[^,]*}}) -// CHECK: call x86_stdcallcc %struct.A* @"\01?baz@B@@QAG?AUA@@U2@@Z" +// CHECK: call x86_stdcallcc %struct.A* @"?baz@B@@QAG?AUA@@U2@@Z" // CHECK: (<{ %struct.B*, %struct.A*, %struct.A }>* inalloca %{{[^,]*}}) -// CHECK: call x86_fastcallcc void @"\01?qux@B@@QAI?AUA@@U2@@Z" +// CHECK: call x86_fastcallcc void @"?qux@B@@QAI?AUA@@U2@@Z" // CHECK: (%struct.B* inreg %{{[^,]*}}, %struct.A* inreg sret %{{.*}}, <{ %struct.A }>* inalloca %{{[^,]*}}) diff --git a/test/CodeGenCXX/microsoft-abi-byval-thunks.cpp b/test/CodeGenCXX/microsoft-abi-byval-thunks.cpp index 8ae85c0b66a32..45dd4d0ca74ed 100644 --- a/test/CodeGenCXX/microsoft-abi-byval-thunks.cpp +++ b/test/CodeGenCXX/microsoft-abi-byval-thunks.cpp @@ -14,17 +14,17 @@ struct B { virtual void foo(Agg x); }; struct C : A, B { C(); virtual void foo(Agg x); }; C::C() {} // force emission -// CHECK32-LABEL: define linkonce_odr x86_thiscallcc void @"\01?foo@C@byval_thunk@@W3AEXUAgg@2@@Z" +// CHECK32-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"?foo@C@byval_thunk@@W3AEXUAgg@2@@Z" // CHECK32: (%"struct.byval_thunk::C"* %this, <{ %"struct.byval_thunk::Agg" }>* inalloca) // CHECK32: getelementptr i8, i8* %{{.*}}, i32 -4 -// CHECK32: musttail call x86_thiscallcc void @"\01?foo@C@byval_thunk@@UAEXUAgg@2@@Z" +// CHECK32: musttail call x86_thiscallcc void @"?foo@C@byval_thunk@@UAEXUAgg@2@@Z" // CHECK32: (%"struct.byval_thunk::C"* %{{.*}}, <{ %"struct.byval_thunk::Agg" }>* inalloca %0) // CHECK32-NEXT: ret void -// CHECK64-LABEL: define linkonce_odr void @"\01?foo@C@byval_thunk@@W7EAAXUAgg@2@@Z" +// CHECK64-LABEL: define linkonce_odr dso_local void @"?foo@C@byval_thunk@@W7EAAXUAgg@2@@Z" // CHECK64: (%"struct.byval_thunk::C"* %this, %"struct.byval_thunk::Agg"* %x) // CHECK64: getelementptr i8, i8* %{{.*}}, i32 -8 -// CHECK64: call void @"\01?foo@C@byval_thunk@@UEAAXUAgg@2@@Z" +// CHECK64: call void @"?foo@C@byval_thunk@@UEAAXUAgg@2@@Z" // CHECK64: (%"struct.byval_thunk::C"* %{{.*}}, %"struct.byval_thunk::Agg"* %x) // CHECK64-NOT: call // CHECK64: ret void @@ -43,20 +43,20 @@ struct B { virtual void __stdcall foo(Agg x); }; struct C : A, B { C(); virtual void __stdcall foo(Agg x); }; C::C() {} // force emission -// CHECK32-LABEL: define linkonce_odr x86_stdcallcc void @"\01?foo@C@stdcall_thunk@@W3AGXUAgg@2@@Z" +// CHECK32-LABEL: define linkonce_odr dso_local x86_stdcallcc void @"?foo@C@stdcall_thunk@@W3AGXUAgg@2@@Z" // CHECK32: (<{ %"struct.stdcall_thunk::C"*, %"struct.stdcall_thunk::Agg" }>* inalloca) // CHECK32: %[[this_slot:[^ ]*]] = getelementptr inbounds <{ %"struct.stdcall_thunk::C"*, %"struct.stdcall_thunk::Agg" }>, <{ %"struct.stdcall_thunk::C"*, %"struct.stdcall_thunk::Agg" }>* %0, i32 0, i32 0 // CHECK32: load %"struct.stdcall_thunk::C"*, %"struct.stdcall_thunk::C"** %[[this_slot]] // CHECK32: getelementptr i8, i8* %{{.*}}, i32 -4 // CHECK32: store %"struct.stdcall_thunk::C"* %{{.*}}, %"struct.stdcall_thunk::C"** %[[this_slot]] -// CHECK32: musttail call x86_stdcallcc void @"\01?foo@C@stdcall_thunk@@UAGXUAgg@2@@Z" +// CHECK32: musttail call x86_stdcallcc void @"?foo@C@stdcall_thunk@@UAGXUAgg@2@@Z" // CHECK32: (<{ %"struct.stdcall_thunk::C"*, %"struct.stdcall_thunk::Agg" }>* inalloca %0) // CHECK32-NEXT: ret void -// CHECK64-LABEL: define linkonce_odr void @"\01?foo@C@stdcall_thunk@@W7EAAXUAgg@2@@Z" +// CHECK64-LABEL: define linkonce_odr dso_local void @"?foo@C@stdcall_thunk@@W7EAAXUAgg@2@@Z" // CHECK64: (%"struct.stdcall_thunk::C"* %this, %"struct.stdcall_thunk::Agg"* %x) // CHECK64: getelementptr i8, i8* %{{.*}}, i32 -8 -// CHECK64: call void @"\01?foo@C@stdcall_thunk@@UEAAXUAgg@2@@Z" +// CHECK64: call void @"?foo@C@stdcall_thunk@@UEAAXUAgg@2@@Z" // CHECK64: (%"struct.stdcall_thunk::C"* %{{.*}}, %"struct.stdcall_thunk::Agg"* %x) // CHECK64-NOT: call // CHECK64: ret void @@ -75,20 +75,20 @@ struct B { virtual Agg __cdecl foo(Agg x); }; struct C : A, B { C(); virtual Agg __cdecl foo(Agg x); }; C::C() {} // force emission -// CHECK32-LABEL: define linkonce_odr %"struct.sret_thunk::Agg"* @"\01?foo@C@sret_thunk@@W3AA?AUAgg@2@U32@@Z" +// CHECK32-LABEL: define linkonce_odr dso_local %"struct.sret_thunk::Agg"* @"?foo@C@sret_thunk@@W3AA?AUAgg@2@U32@@Z" // CHECK32: (<{ %"struct.sret_thunk::C"*, %"struct.sret_thunk::Agg"*, %"struct.sret_thunk::Agg" }>* inalloca) // CHECK32: %[[this_slot:[^ ]*]] = getelementptr inbounds <{ %"struct.sret_thunk::C"*, %"struct.sret_thunk::Agg"*, %"struct.sret_thunk::Agg" }>, <{ %"struct.sret_thunk::C"*, %"struct.sret_thunk::Agg"*, %"struct.sret_thunk::Agg" }>* %0, i32 0, i32 0 // CHECK32: load %"struct.sret_thunk::C"*, %"struct.sret_thunk::C"** %[[this_slot]] // CHECK32: getelementptr i8, i8* %{{.*}}, i32 -4 // CHECK32: store %"struct.sret_thunk::C"* %{{.*}}, %"struct.sret_thunk::C"** %[[this_slot]] -// CHECK32: %[[rv:[^ ]*]] = musttail call %"struct.sret_thunk::Agg"* @"\01?foo@C@sret_thunk@@UAA?AUAgg@2@U32@@Z" +// CHECK32: %[[rv:[^ ]*]] = musttail call %"struct.sret_thunk::Agg"* @"?foo@C@sret_thunk@@UAA?AUAgg@2@U32@@Z" // CHECK32: (<{ %"struct.sret_thunk::C"*, %"struct.sret_thunk::Agg"*, %"struct.sret_thunk::Agg" }>* inalloca %0) // CHECK32-NEXT: ret %"struct.sret_thunk::Agg"* %[[rv]] -// CHECK64-LABEL: define linkonce_odr void @"\01?foo@C@sret_thunk@@W7EAA?AUAgg@2@U32@@Z" +// CHECK64-LABEL: define linkonce_odr dso_local void @"?foo@C@sret_thunk@@W7EAA?AUAgg@2@U32@@Z" // CHECK64: (%"struct.sret_thunk::C"* %this, %"struct.sret_thunk::Agg"* noalias sret %agg.result, %"struct.sret_thunk::Agg"* %x) // CHECK64: getelementptr i8, i8* %{{.*}}, i32 -8 -// CHECK64: call void @"\01?foo@C@sret_thunk@@UEAA?AUAgg@2@U32@@Z" +// CHECK64: call void @"?foo@C@sret_thunk@@UEAA?AUAgg@2@U32@@Z" // CHECK64: (%"struct.sret_thunk::C"* %{{.*}}, %"struct.sret_thunk::Agg"* sret %agg.result, %"struct.sret_thunk::Agg"* %x) // CHECK64-NOT: call // CHECK64: ret void diff --git a/test/CodeGenCXX/microsoft-abi-byval-vararg.cpp b/test/CodeGenCXX/microsoft-abi-byval-vararg.cpp index 6a0a8601c0cc2..e6a36e243b675 100644 --- a/test/CodeGenCXX/microsoft-abi-byval-vararg.cpp +++ b/test/CodeGenCXX/microsoft-abi-byval-vararg.cpp @@ -19,14 +19,14 @@ int foo(A a, ...) { return sum; } -// CHECK-LABEL: define i32 @"\01?foo@@YAHUA@@ZZ"(<{ %struct.A }>* inalloca, ...) +// CHECK-LABEL: define dso_local i32 @"?foo@@YAHUA@@ZZ"(<{ %struct.A }>* inalloca, ...) int main() { return foo(A(3), 1, 2, 3); } -// CHECK-LABEL: define i32 @main() +// CHECK-LABEL: define dso_local i32 @main() // CHECK: %[[argmem:[^ ]*]] = alloca inalloca <{ %struct.A, i32, i32, i32 }> -// CHECK: call i32 {{.*bitcast.*}}@"\01?foo@@YAHUA@@ZZ"{{.*}}(<{ %struct.A, i32, i32, i32 }>* inalloca %[[argmem]]) +// CHECK: call i32 {{.*bitcast.*}}@"?foo@@YAHUA@@ZZ"{{.*}}(<{ %struct.A, i32, i32, i32 }>* inalloca %[[argmem]]) void varargs_zero(...); void varargs_one(int, ...); @@ -40,13 +40,13 @@ void call_var_args() { varargs_three(1, 2, 3, x); } -// CHECK-LABEL: define void @"\01?call_var_args@@YAXXZ"() +// CHECK-LABEL: define dso_local void @"?call_var_args@@YAXXZ"() // CHECK: call void {{.*bitcast.*varargs_zero.*}}(<{ %struct.A }>* inalloca %{{.*}}) // CHECK: call void {{.*bitcast.*varargs_one.*}}(<{ i32, %struct.A }>* inalloca %{{.*}}) // CHECK: call void {{.*bitcast.*varargs_two.*}}(<{ i32, i32, %struct.A }>* inalloca %{{.*}}) // CHECK: call void {{.*bitcast.*varargs_three.*}}(<{ i32, i32, i32, %struct.A }>* inalloca %{{.*}}) -// CHECK-LABEL: declare void @"\01?varargs_zero@@YAXZZ"(...) -// CHECK-LABEL: declare void @"\01?varargs_one@@YAXHZZ"(i32, ...) -// CHECK-LABEL: declare void @"\01?varargs_two@@YAXHHZZ"(i32, i32, ...) -// CHECK-LABEL: declare void @"\01?varargs_three@@YAXHHHZZ"(i32, i32, i32, ...) +// CHECK-LABEL: declare dso_local void @"?varargs_zero@@YAXZZ"(...) +// CHECK-LABEL: declare dso_local void @"?varargs_one@@YAXHZZ"(i32, ...) +// CHECK-LABEL: declare dso_local void @"?varargs_two@@YAXHHZZ"(i32, i32, ...) +// CHECK-LABEL: declare dso_local void @"?varargs_three@@YAXHHHZZ"(i32, i32, i32, ...) diff --git a/test/CodeGenCXX/microsoft-abi-cdecl-method-sret.cpp b/test/CodeGenCXX/microsoft-abi-cdecl-method-sret.cpp index 6da7a50b617ea..34e2bc5706353 100644 --- a/test/CodeGenCXX/microsoft-abi-cdecl-method-sret.cpp +++ b/test/CodeGenCXX/microsoft-abi-cdecl-method-sret.cpp @@ -19,9 +19,9 @@ S C::variadic_sret(const char *f, ...) { return S(); } S C::cdecl_sret() { return S(); } S C::byval_and_sret(S a) { return S(); } -// CHECK: define void @"\01?variadic_sret@C@@QAA?AUS@@PBDZZ"(%struct.C* %this, %struct.S* noalias sret %agg.result, i8* %f, ...) -// CHECK: define void @"\01?cdecl_sret@C@@QAA?AUS@@XZ"(%struct.C* %this, %struct.S* noalias sret %agg.result) -// CHECK: define void @"\01?byval_and_sret@C@@QAA?AUS@@U2@@Z"(%struct.C* %this, %struct.S* noalias sret %agg.result, %struct.S* byval align 4 %a) +// CHECK: define dso_local void @"?variadic_sret@C@@QAA?AUS@@PBDZZ"(%struct.C* %this, %struct.S* noalias sret %agg.result, i8* %f, ...) +// CHECK: define dso_local void @"?cdecl_sret@C@@QAA?AUS@@XZ"(%struct.C* %this, %struct.S* noalias sret %agg.result) +// CHECK: define dso_local void @"?byval_and_sret@C@@QAA?AUS@@U2@@Z"(%struct.C* %this, %struct.S* noalias sret %agg.result, %struct.S* byval align 4 %a) int main() { C c; @@ -29,10 +29,10 @@ int main() { c.cdecl_sret(); c.byval_and_sret(S()); } -// CHECK-LABEL: define i32 @main() -// CHECK: call void {{.*}} @"\01?variadic_sret@C@@QAA?AUS@@PBDZZ" -// CHECK: call void @"\01?cdecl_sret@C@@QAA?AUS@@XZ" -// CHECK: call void @"\01?byval_and_sret@C@@QAA?AUS@@U2@@Z" +// CHECK-LABEL: define dso_local i32 @main() +// CHECK: call void {{.*}} @"?variadic_sret@C@@QAA?AUS@@PBDZZ" +// CHECK: call void @"?cdecl_sret@C@@QAA?AUS@@XZ" +// CHECK: call void @"?byval_and_sret@C@@QAA?AUS@@U2@@Z" // __fastcall has similar issues. struct A { @@ -41,4 +41,4 @@ struct A { S A::f(int x) { return S(); } -// CHECK-LABEL: define x86_fastcallcc void @"\01?f@A@@QAI?AUS@@H@Z"(%struct.A* inreg %this, %struct.S* inreg noalias sret %agg.result, i32 %x) +// CHECK-LABEL: define dso_local x86_fastcallcc void @"?f@A@@QAI?AUS@@H@Z"(%struct.A* inreg %this, %struct.S* inreg noalias sret %agg.result, i32 %x) diff --git a/test/CodeGenCXX/microsoft-abi-constexpr-vs-inheritance.cpp b/test/CodeGenCXX/microsoft-abi-constexpr-vs-inheritance.cpp index 6972dacd774f0..6f426038252bd 100644 --- a/test/CodeGenCXX/microsoft-abi-constexpr-vs-inheritance.cpp +++ b/test/CodeGenCXX/microsoft-abi-constexpr-vs-inheritance.cpp @@ -7,7 +7,7 @@ struct A { }; A a(42); -// CHECK: @"\01?a@@3UA@@A" = global { { [1 x i8*] }*, i32 } { { [1 x i8*] }* @"\01??_7A@@6B@", i32 42 }, align 4 +// CHECK: @"?a@@3UA@@A" = dso_local global { { [1 x i8*] }*, i32 } { { [1 x i8*] }* @"??_7A@@6B@", i32 42 }, align 4 struct B { constexpr B(int y) : y(y) {} @@ -20,4 +20,4 @@ struct C : A, B { }; C c; -// CHECK: @"\01?c@@3UC@@A" = global { { [1 x i8*] }*, i32, { [1 x i8*] }*, i32 } { { [1 x i8*] }* @"\01??_7C@@6BA@@@", i32 777, { [1 x i8*] }* @"\01??_7C@@6BB@@@", i32 13 } +// CHECK: @"?c@@3UC@@A" = dso_local global { { [1 x i8*] }*, i32, { [1 x i8*] }*, i32 } { { [1 x i8*] }* @"??_7C@@6BA@@@", i32 777, { [1 x i8*] }* @"??_7C@@6BB@@@", i32 13 } diff --git a/test/CodeGenCXX/microsoft-abi-default-cc.cpp b/test/CodeGenCXX/microsoft-abi-default-cc.cpp index 6259a53dbf39d..804ee5197b856 100644 --- a/test/CodeGenCXX/microsoft-abi-default-cc.cpp +++ b/test/CodeGenCXX/microsoft-abi-default-cc.cpp @@ -13,13 +13,13 @@ void foo(); void __cdecl foo(); void __cdecl foo() {} // GCABI-LABEL: define void @_Z3foov() -// MSABI: define void @"\01?foo@@YAXXZ" +// MSABI: define dso_local void @"?foo@@YAXXZ" void __cdecl bar(); void bar(); void bar() {} // GCABI-LABEL: define void @_Z3barv() -// MSABI: define void @"\01?bar@@YAXXZ" +// MSABI: define dso_local void @"?bar@@YAXXZ" // Test that it's OK to mark either the method declaration or method definition // with a default CC explicitly. @@ -34,23 +34,23 @@ public: void METHOD_CC A::baz() {} // GCABI-LABEL: define void @_ZN1A3bazEv -// MSABI: define x86_thiscallcc void @"\01?baz@A@@QAEXXZ" +// MSABI: define dso_local x86_thiscallcc void @"?baz@A@@QAEXXZ" void A::qux() {} // GCABI-LABEL: define void @_ZN1A3quxEv -// MSABI: define x86_thiscallcc void @"\01?qux@A@@QAEXXZ" +// MSABI: define dso_local x86_thiscallcc void @"?qux@A@@QAEXXZ" void __cdecl static_baz() {} // GCABI-LABEL: define void @_Z10static_bazv -// MSABI: define void @"\01?static_baz@@YAXXZ" +// MSABI: define dso_local void @"?static_baz@@YAXXZ" void static_qux() {} // GCABI-LABEL: define void @_Z10static_quxv -// MSABI: define void @"\01?static_qux@@YAXXZ" +// MSABI: define dso_local void @"?static_qux@@YAXXZ" namespace PR31656 { template <int I> void __cdecl callee(int args[I]); // GCABI-LABEL: declare void @_ZN7PR316566calleeILi1EEEvPi( -// MSABI: declare void @"\01??$callee@$00@PR31656@@YAXQAH@Z"( +// MSABI: declare dso_local void @"??$callee@$00@PR31656@@YAXQAH@Z"( void caller() { callee<1>(0); } } diff --git a/test/CodeGenCXX/microsoft-abi-dynamic-cast.cpp b/test/CodeGenCXX/microsoft-abi-dynamic-cast.cpp index 8d75ed4d9d69a..e45d37273cea1 100644 --- a/test/CodeGenCXX/microsoft-abi-dynamic-cast.cpp +++ b/test/CodeGenCXX/microsoft-abi-dynamic-cast.cpp @@ -7,30 +7,30 @@ struct B : S, virtual V {}; struct T {}; T* test0() { return dynamic_cast<T*>((B*)0); } -// CHECK-LABEL: define noalias %struct.T* @"\01?test0@@YAPAUT@@XZ"() +// CHECK-LABEL: define dso_local noalias %struct.T* @"?test0@@YAPAUT@@XZ"() // CHECK: ret %struct.T* null T* test1(V* x) { return &dynamic_cast<T&>(*x); } -// CHECK-LABEL: define %struct.T* @"\01?test1@@YAPAUT@@PAUV@@@Z"(%struct.V* %x) +// CHECK-LABEL: define dso_local %struct.T* @"?test1@@YAPAUT@@PAUV@@@Z"(%struct.V* %x) // CHECK: [[CAST:%.*]] = bitcast %struct.V* %x to i8* -// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* [[CAST]], i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUV@@@8" to i8*), i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUT@@@8" to i8*), i32 1) +// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* [[CAST]], i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUV@@@8" to i8*), i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 1) // CHECK-NEXT: [[RET:%.*]] = bitcast i8* [[CALL]] to %struct.T* // CHECK-NEXT: ret %struct.T* [[RET]] T* test2(A* x) { return &dynamic_cast<T&>(*x); } -// CHECK-LABEL: define %struct.T* @"\01?test2@@YAPAUT@@PAUA@@@Z"(%struct.A* %x) +// CHECK-LABEL: define dso_local %struct.T* @"?test2@@YAPAUT@@PAUA@@@Z"(%struct.A* %x) // CHECK: [[CAST:%.*]] = bitcast %struct.A* %x to i8* // CHECK-NEXT: [[VBPTRPTR:%.*]] = getelementptr inbounds %struct.A, %struct.A* %x, i32 0, i32 0 // CHECK-NEXT: [[VBTBL:%.*]] = load i32*, i32** [[VBPTRPTR]], align 4 // CHECK-NEXT: [[VBOFFP:%.*]] = getelementptr inbounds i32, i32* [[VBTBL]], i32 1 // CHECK-NEXT: [[VBOFFS:%.*]] = load i32, i32* [[VBOFFP]], align 4 // CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, i8* [[CAST]], i32 [[VBOFFS]] -// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* [[ADJ]], i32 [[VBOFFS]], i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUA@@@8" to i8*), i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUT@@@8" to i8*), i32 1) +// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* [[ADJ]], i32 [[VBOFFS]], i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUA@@@8" to i8*), i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 1) // CHECK-NEXT: [[RET:%.*]] = bitcast i8* [[CALL]] to %struct.T* // CHECK-NEXT: ret %struct.T* [[RET]] T* test3(B* x) { return &dynamic_cast<T&>(*x); } -// CHECK-LABEL: define %struct.T* @"\01?test3@@YAPAUT@@PAUB@@@Z"(%struct.B* %x) +// CHECK-LABEL: define dso_local %struct.T* @"?test3@@YAPAUT@@PAUB@@@Z"(%struct.B* %x) // CHECK: [[VOIDP:%.*]] = getelementptr inbounds %struct.B, %struct.B* %x, i32 0, i32 0, i32 0 // CHECK-NEXT: [[VBPTR:%.*]] = getelementptr inbounds i8, i8* [[VOIDP]], i32 4 // CHECK-NEXT: [[VBPTRPTR:%.*]] = bitcast i8* [[VBPTR:%.*]] to i32** @@ -39,19 +39,19 @@ T* test3(B* x) { return &dynamic_cast<T&>(*x); } // CHECK-NEXT: [[VBOFFS:%.*]] = load i32, i32* [[VBOFFP]], align 4 // CHECK-NEXT: [[DELTA:%.*]] = add nsw i32 [[VBOFFS]], 4 // CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, i8* [[VOIDP]], i32 [[DELTA]] -// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* [[ADJ]], i32 [[DELTA]], i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUB@@@8" to i8*), i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUT@@@8" to i8*), i32 1) +// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* [[ADJ]], i32 [[DELTA]], i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUB@@@8" to i8*), i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 1) // CHECK-NEXT: [[RET:%.*]] = bitcast i8* [[CALL]] to %struct.T* // CHECK-NEXT: ret %struct.T* [[RET]] T* test4(V* x) { return dynamic_cast<T*>(x); } -// CHECK-LABEL: define %struct.T* @"\01?test4@@YAPAUT@@PAUV@@@Z"(%struct.V* %x) +// CHECK-LABEL: define dso_local %struct.T* @"?test4@@YAPAUT@@PAUV@@@Z"(%struct.V* %x) // CHECK: [[CAST:%.*]] = bitcast %struct.V* %x to i8* -// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* [[CAST]], i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUV@@@8" to i8*), i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUT@@@8" to i8*), i32 0) +// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* [[CAST]], i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUV@@@8" to i8*), i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 0) // CHECK-NEXT: [[RET:%.*]] = bitcast i8* [[CALL]] to %struct.T* // CHECK-NEXT: ret %struct.T* [[RET]] T* test5(A* x) { return dynamic_cast<T*>(x); } -// CHECK-LABEL: define %struct.T* @"\01?test5@@YAPAUT@@PAUA@@@Z"(%struct.A* %x) +// CHECK-LABEL: define dso_local %struct.T* @"?test5@@YAPAUT@@PAUA@@@Z"(%struct.A* %x) // CHECK: [[CHECK:%.*]] = icmp eq %struct.A* %x, null // CHECK-NEXT: br i1 [[CHECK]] // CHECK: [[VOIDP:%.*]] = bitcast %struct.A* %x to i8* @@ -60,14 +60,14 @@ T* test5(A* x) { return dynamic_cast<T*>(x); } // CHECK-NEXT: [[VBOFFP:%.*]] = getelementptr inbounds i32, i32* [[VBTBL]], i32 1 // CHECK-NEXT: [[VBOFFS:%.*]] = load i32, i32* [[VBOFFP]], align 4 // CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, i8* [[VOIDP]], i32 [[VBOFFS]] -// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* [[ADJ]], i32 [[VBOFFS]], i8* {{.*}}bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUA@@@8" to i8*), i8* {{.*}}bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUT@@@8" to i8*), i32 0) +// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* [[ADJ]], i32 [[VBOFFS]], i8* {{.*}}bitcast (%rtti.TypeDescriptor7* @"??_R0?AUA@@@8" to i8*), i8* {{.*}}bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 0) // CHECK-NEXT: [[RES:%.*]] = bitcast i8* [[CALL]] to %struct.T* // CHECK-NEXT: br label // CHECK: [[RET:%.*]] = phi %struct.T* // CHECK-NEXT: ret %struct.T* [[RET]] T* test6(B* x) { return dynamic_cast<T*>(x); } -// CHECK-LABEL: define %struct.T* @"\01?test6@@YAPAUT@@PAUB@@@Z"(%struct.B* %x) +// CHECK-LABEL: define dso_local %struct.T* @"?test6@@YAPAUT@@PAUB@@@Z"(%struct.B* %x) // CHECK: [[CHECK:%.*]] = icmp eq %struct.B* %x, null // CHECK-NEXT: br i1 [[CHECK]] // CHECK: [[CAST:%.*]] = getelementptr inbounds %struct.B, %struct.B* %x, i32 0, i32 0, i32 0 @@ -78,20 +78,20 @@ T* test6(B* x) { return dynamic_cast<T*>(x); } // CHECK-NEXT: [[VBOFFS:%.*]] = load i32, i32* [[VBOFFP]], align 4 // CHECK-NEXT: [[DELTA:%.*]] = add nsw i32 [[VBOFFS]], 4 // CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, i8* [[CAST]], i32 [[DELTA]] -// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* nonnull [[ADJ]], i32 [[DELTA]], i8* {{.*}}bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUB@@@8" to i8*), i8* {{.*}}bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUT@@@8" to i8*), i32 0) +// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* nonnull [[ADJ]], i32 [[DELTA]], i8* {{.*}}bitcast (%rtti.TypeDescriptor7* @"??_R0?AUB@@@8" to i8*), i8* {{.*}}bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 0) // CHECK-NEXT: [[RES:%.*]] = bitcast i8* [[CALL]] to %struct.T* // CHECK-NEXT: br label // CHECK: [[RET:%.*]] = phi %struct.T* // CHECK-NEXT: ret %struct.T* [[RET]] void* test7(V* x) { return dynamic_cast<void*>(x); } -// CHECK-LABEL: define i8* @"\01?test7@@YAPAXPAUV@@@Z"(%struct.V* %x) +// CHECK-LABEL: define dso_local i8* @"?test7@@YAPAXPAUV@@@Z"(%struct.V* %x) // CHECK: [[CAST:%.*]] = bitcast %struct.V* %x to i8* // CHECK-NEXT: [[RET:%.*]] = tail call i8* @__RTCastToVoid(i8* [[CAST]]) // CHECK-NEXT: ret i8* [[RET]] void* test8(A* x) { return dynamic_cast<void*>(x); } -// CHECK-LABEL: define i8* @"\01?test8@@YAPAXPAUA@@@Z"(%struct.A* %x) +// CHECK-LABEL: define dso_local i8* @"?test8@@YAPAXPAUA@@@Z"(%struct.A* %x) // CHECK: [[CHECK:%.*]] = icmp eq %struct.A* %x, null // CHECK-NEXT: br i1 [[CHECK]] // CHECK: [[VOIDP:%.*]] = bitcast %struct.A* %x to i8* @@ -106,7 +106,7 @@ void* test8(A* x) { return dynamic_cast<void*>(x); } // CHECK-NEXT: ret i8* [[RET]] void* test9(B* x) { return dynamic_cast<void*>(x); } -// CHECK-LABEL: define i8* @"\01?test9@@YAPAXPAUB@@@Z"(%struct.B* %x) +// CHECK-LABEL: define dso_local i8* @"?test9@@YAPAXPAUB@@@Z"(%struct.B* %x) // CHECK: [[CHECK:%.*]] = icmp eq %struct.B* %x, null // CHECK-NEXT: br i1 [[CHECK]] // CHECK: [[CAST:%.*]] = getelementptr inbounds %struct.B, %struct.B* %x, i32 0, i32 0, i32 0 @@ -134,10 +134,10 @@ S3 *f(S2 &s) { Cleanup c; return dynamic_cast<S3 *>(&s); } -// CHECK-LABEL: define %"struct.PR25606::S3"* @"\01?f@PR25606@@YAPAUS3@1@AAUS2@1@@Z"( +// CHECK-LABEL: define dso_local %"struct.PR25606::S3"* @"?f@PR25606@@YAPAUS3@1@AAUS2@1@@Z"( // CHECK: [[CALL:%.*]] = invoke i8* @__RTDynamicCast // CHECK: [[BC:%.*]] = bitcast i8* [[CALL]] to %"struct.PR25606::S3"* -// CHECK: call x86_thiscallcc void @"\01??_DCleanup@PR25606@@QAEXXZ"( +// CHECK: call x86_thiscallcc void @"??1Cleanup@PR25606@@QAE@XZ"( // CHECK: ret %"struct.PR25606::S3"* [[BC]] } diff --git a/test/CodeGenCXX/microsoft-abi-eh-catch.cpp b/test/CodeGenCXX/microsoft-abi-eh-catch.cpp index 6e18b92e0f41e..53f87177e700a 100644 --- a/test/CodeGenCXX/microsoft-abi-eh-catch.cpp +++ b/test/CodeGenCXX/microsoft-abi-eh-catch.cpp @@ -17,7 +17,7 @@ extern "C" void catch_all() { } } -// WIN64-LABEL: define void @catch_all() +// WIN64-LABEL: define dso_local void @catch_all() // WIN64: invoke void @might_throw() // WIN64-NEXT: to label %[[cont:[^ ]*]] unwind label %[[catchswitch_lpad:[^ ]*]] // @@ -46,8 +46,8 @@ extern "C" void catch_int() { } } -// WIN64-LABEL: define void @catch_int() -// WIN64: catchpad within %{{[^ ]*}} [%rtti.TypeDescriptor2* @"\01??_R0H@8", i32 0, i32* %[[e_addr:[^\]]*]]] +// WIN64-LABEL: define dso_local void @catch_int() +// WIN64: catchpad within %{{[^ ]*}} [%rtti.TypeDescriptor2* @"??_R0H@8", i32 0, i32* %[[e_addr:[^\]]*]]] // // The catchpad instruction starts the lifetime of 'e'. Unfortunately, that // leaves us with nowhere to put lifetime.start, so we don't emit lifetime @@ -68,8 +68,8 @@ extern "C" void catch_int_unnamed() { } } -// WIN64-LABEL: define void @catch_int_unnamed() -// WIN64: catchpad within %{{.*}} [%rtti.TypeDescriptor2* @"\01??_R0H@8", i32 0, i8* null] +// WIN64-LABEL: define dso_local void @catch_int_unnamed() +// WIN64: catchpad within %{{.*}} [%rtti.TypeDescriptor2* @"??_R0H@8", i32 0, i8* null] // WIN64: catchret struct A { @@ -94,9 +94,9 @@ extern "C" void catch_a_byval() { } } -// WIN64-LABEL: define void @catch_a_byval() +// WIN64-LABEL: define dso_local void @catch_a_byval() // WIN64: %[[e_addr:[^ ]*]] = alloca %struct.A -// WIN64: catchpad within %{{[^ ]*}} [%rtti.TypeDescriptor7* @"\01??_R0?AUA@@@8", i32 0, %struct.A* %[[e_addr]]] +// WIN64: catchpad within %{{[^ ]*}} [%rtti.TypeDescriptor7* @"??_R0?AUA@@@8", i32 0, %struct.A* %[[e_addr]]] // WIN64: %[[e_i8:[^ ]*]] = bitcast %struct.A* %[[e_addr]] to i8* // WIN64: call void @handle_exception(i8* %[[e_i8]]) // WIN64: catchret @@ -109,9 +109,9 @@ extern "C" void catch_a_ref() { } } -// WIN64-LABEL: define void @catch_a_ref() +// WIN64-LABEL: define dso_local void @catch_a_ref() // WIN64: %[[e_addr:[^ ]*]] = alloca %struct.A* -// WIN64: catchpad within %{{[^ ]*}} [%rtti.TypeDescriptor7* @"\01??_R0?AUA@@@8", i32 8, %struct.A** %[[e_addr]]] +// WIN64: catchpad within %{{[^ ]*}} [%rtti.TypeDescriptor7* @"??_R0?AUA@@@8", i32 8, %struct.A** %[[e_addr]]] // WIN64: %[[eptr:[^ ]*]] = load %struct.A*, %struct.A** %[[e_addr]] // WIN64: %[[eptr_i8:[^ ]*]] = bitcast %struct.A* %[[eptr]] to i8* // WIN64: call void @handle_exception(i8* %[[eptr_i8]]) @@ -121,7 +121,7 @@ extern "C" void fn_with_exc_spec() throw(int) { might_throw(); } -// WIN64-LABEL: define void @fn_with_exc_spec() +// WIN64-LABEL: define dso_local void @fn_with_exc_spec() // WIN64: call void @might_throw() // WIN64-NEXT: ret void @@ -137,7 +137,7 @@ extern "C" void catch_nested() { } } -// WIN64-LABEL: define void @catch_nested() +// WIN64-LABEL: define dso_local void @catch_nested() // WIN64: invoke void @might_throw() // WIN64-NEXT: to label %{{.*}} unwind label %[[catchswitch_outer:[^ ]*]] // @@ -145,7 +145,7 @@ extern "C" void catch_nested() { // WIN64: %[[catchswitch_outer_scope:[^ ]*]] = catchswitch within none [label %[[catch_int_outer:[^ ]*]]] unwind to caller // // WIN64: [[catch_int_outer]] -// WIN64: %[[catchpad:[^ ]*]] = catchpad within %[[catchswitch_outer_scope]] [%rtti.TypeDescriptor2* @"\01??_R0H@8", i32 0, i8* null] +// WIN64: %[[catchpad:[^ ]*]] = catchpad within %[[catchswitch_outer_scope]] [%rtti.TypeDescriptor2* @"??_R0H@8", i32 0, i8* null] // WIN64: invoke void @might_throw() // WIN64-NEXT: to label %[[cont2:[^ ]*]] unwind label %[[catchswitch_inner:[^ ]*]] // @@ -153,7 +153,7 @@ extern "C" void catch_nested() { // WIN64: %[[catchswitch_inner_scope:[^ ]*]] = catchswitch within %[[catchpad]] [label %[[catch_int_inner:[^ ]*]]] unwind to caller // // WIN64: [[catch_int_inner]] -// WIN64: catchpad within %[[catchswitch_inner_scope]] [%rtti.TypeDescriptor2* @"\01??_R0H@8", i32 0, i8* null] +// WIN64: catchpad within %[[catchswitch_inner_scope]] [%rtti.TypeDescriptor2* @"??_R0H@8", i32 0, i8* null] // WIN64-NEXT: call void @might_throw() // WIN64: catchret {{.*}} to label %[[catchret2:[^ ]*]] // diff --git a/test/CodeGenCXX/microsoft-abi-eh-cleanups.cpp b/test/CodeGenCXX/microsoft-abi-eh-cleanups.cpp index 96b4fa3478a2c..6682fafc91f91 100644 --- a/test/CodeGenCXX/microsoft-abi-eh-cleanups.cpp +++ b/test/CodeGenCXX/microsoft-abi-eh-cleanups.cpp @@ -15,21 +15,21 @@ void HasEHCleanup() { } // With exceptions, we need to clean up at least one of these temporaries. -// WIN32-LABEL: define void @"\01?HasEHCleanup@@YAXXZ"() {{.*}} { +// WIN32-LABEL: define dso_local void @"?HasEHCleanup@@YAXXZ"() {{.*}} { // WIN32: %[[base:.*]] = call i8* @llvm.stacksave() // If this call throws, we have to restore the stack. -// WIN32: call void @"\01?getA@@YA?AUA@@XZ"(%struct.A* sret %{{.*}}) +// WIN32: call void @"?getA@@YA?AUA@@XZ"(%struct.A* sret %{{.*}}) // If this call throws, we have to cleanup the first temporary. -// WIN32: invoke void @"\01?getA@@YA?AUA@@XZ"(%struct.A* sret %{{.*}}) +// WIN32: invoke void @"?getA@@YA?AUA@@XZ"(%struct.A* sret %{{.*}}) // If this call throws, we have to cleanup the stacksave. -// WIN32: call i32 @"\01?TakesTwo@@YAHUA@@0@Z" +// WIN32: call i32 @"?TakesTwo@@YAHUA@@0@Z" // WIN32: call void @llvm.stackrestore // WIN32: ret void // // There should be one dtor call for unwinding from the second getA. // WIN32: cleanuppad -// WIN32: call x86_thiscallcc void @"\01??1A@@QAE@XZ"({{.*}}) -// WIN32-NOT: @"\01??1A@@QAE@XZ" +// WIN32: call x86_thiscallcc void @"??1A@@QAE@XZ"({{.*}}) +// WIN32-NOT: @"??1A@@QAE@XZ" // WIN32: } void TakeRef(const A &a); @@ -37,33 +37,33 @@ int HasDeactivatedCleanups() { return TakesTwo((TakeRef(A()), A()), (TakeRef(A()), A())); } -// WIN32-LABEL: define i32 @"\01?HasDeactivatedCleanups@@YAHXZ"() {{.*}} { +// WIN32-LABEL: define dso_local i32 @"?HasDeactivatedCleanups@@YAHXZ"() {{.*}} { // WIN32: %[[isactive:.*]] = alloca i1 // WIN32: call i8* @llvm.stacksave() // WIN32: %[[argmem:.*]] = alloca inalloca [[argmem_ty:<{ %struct.A, %struct.A }>]] // WIN32: %[[arg1:.*]] = getelementptr inbounds [[argmem_ty]], [[argmem_ty]]* %[[argmem]], i32 0, i32 1 -// WIN32: call x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ" -// WIN32: invoke void @"\01?TakeRef@@YAXABUA@@@Z" +// WIN32: call x86_thiscallcc %struct.A* @"??0A@@QAE@XZ" +// WIN32: invoke void @"?TakeRef@@YAXABUA@@@Z" // -// WIN32: invoke x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ"(%struct.A* %[[arg1]]) +// WIN32: invoke x86_thiscallcc %struct.A* @"??0A@@QAE@XZ"(%struct.A* %[[arg1]]) // WIN32: store i1 true, i1* %[[isactive]] // // WIN32: %[[arg0:.*]] = getelementptr inbounds [[argmem_ty]], [[argmem_ty]]* %[[argmem]], i32 0, i32 0 -// WIN32: invoke x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ" -// WIN32: invoke void @"\01?TakeRef@@YAXABUA@@@Z" -// WIN32: invoke x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ" +// WIN32: invoke x86_thiscallcc %struct.A* @"??0A@@QAE@XZ" +// WIN32: invoke void @"?TakeRef@@YAXABUA@@@Z" +// WIN32: invoke x86_thiscallcc %struct.A* @"??0A@@QAE@XZ" // WIN32: store i1 false, i1* %[[isactive]] // -// WIN32: invoke i32 @"\01?TakesTwo@@YAHUA@@0@Z"([[argmem_ty]]* inalloca %[[argmem]]) +// WIN32: invoke i32 @"?TakesTwo@@YAHUA@@0@Z"([[argmem_ty]]* inalloca %[[argmem]]) // Destroy the two const ref temporaries. -// WIN32: call x86_thiscallcc void @"\01??1A@@QAE@XZ"({{.*}}) -// WIN32: call x86_thiscallcc void @"\01??1A@@QAE@XZ"({{.*}}) +// WIN32: call x86_thiscallcc void @"??1A@@QAE@XZ"({{.*}}) +// WIN32: call x86_thiscallcc void @"??1A@@QAE@XZ"({{.*}}) // WIN32: ret i32 // // Conditionally destroy arg1. // WIN32: %[[cond:.*]] = load i1, i1* %[[isactive]] // WIN32: br i1 %[[cond]] -// WIN32: call x86_thiscallcc void @"\01??1A@@QAE@XZ"(%struct.A* %[[arg1]]) +// WIN32: call x86_thiscallcc void @"??1A@@QAE@XZ"(%struct.A* %[[arg1]]) // WIN32: } // Test putting the cleanups inside a conditional. @@ -72,22 +72,22 @@ int HasConditionalCleanup(bool cond) { return (cond ? TakesTwo(A(), A()) : CouldThrow()); } -// WIN32-LABEL: define i32 @"\01?HasConditionalCleanup@@YAH_N@Z"(i1 zeroext %{{.*}}) {{.*}} { +// WIN32-LABEL: define dso_local i32 @"?HasConditionalCleanup@@YAH_N@Z"(i1 zeroext %{{.*}}) {{.*}} { // WIN32: store i1 false // WIN32: br i1 // WIN32: call i8* @llvm.stacksave() -// WIN32: call x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ"(%struct.A* %{{.*}}) +// WIN32: call x86_thiscallcc %struct.A* @"??0A@@QAE@XZ"(%struct.A* %{{.*}}) // WIN32: store i1 true -// WIN32: invoke x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ"(%struct.A* %{{.*}}) -// WIN32: call i32 @"\01?TakesTwo@@YAHUA@@0@Z" +// WIN32: invoke x86_thiscallcc %struct.A* @"??0A@@QAE@XZ"(%struct.A* %{{.*}}) +// WIN32: call i32 @"?TakesTwo@@YAHUA@@0@Z" // // WIN32: call void @llvm.stackrestore // -// WIN32: call i32 @"\01?CouldThrow@@YAHXZ"() +// WIN32: call i32 @"?CouldThrow@@YAHXZ"() // // Only one dtor in the invoke for arg1 -// WIN32: call x86_thiscallcc void @"\01??1A@@QAE@XZ"({{.*}}) -// WIN32-NOT: invoke x86_thiscallcc void @"\01??1A@@QAE@XZ" +// WIN32: call x86_thiscallcc void @"??1A@@QAE@XZ"({{.*}}) +// WIN32-NOT: invoke x86_thiscallcc void @"??1A@@QAE@XZ" // WIN32: } // Now test both. @@ -95,7 +95,7 @@ int HasConditionalDeactivatedCleanups(bool cond) { return (cond ? TakesTwo((TakeRef(A()), A()), (TakeRef(A()), A())) : CouldThrow()); } -// WIN32-O0-LABEL: define i32 @"\01?HasConditionalDeactivatedCleanups@@YAH_N@Z"{{.*}} { +// WIN32-O0-LABEL: define dso_local i32 @"?HasConditionalDeactivatedCleanups@@YAH_N@Z"{{.*}} { // WIN32-O0: alloca i1 // WIN32-O0: %[[arg1_cond:.*]] = alloca i1 // Start all four cleanups as deactivated. @@ -105,32 +105,32 @@ int HasConditionalDeactivatedCleanups(bool cond) { // WIN32-O0: store i1 false // WIN32-O0: br i1 // True condition. -// WIN32-O0: call x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ" +// WIN32-O0: call x86_thiscallcc %struct.A* @"??0A@@QAE@XZ" // WIN32-O0: store i1 true -// WIN32-O0: invoke void @"\01?TakeRef@@YAXABUA@@@Z" -// WIN32-O0: invoke x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ" +// WIN32-O0: invoke void @"?TakeRef@@YAXABUA@@@Z" +// WIN32-O0: invoke x86_thiscallcc %struct.A* @"??0A@@QAE@XZ" // WIN32-O0: store i1 true, i1* %[[arg1_cond]] -// WIN32-O0: invoke x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ" +// WIN32-O0: invoke x86_thiscallcc %struct.A* @"??0A@@QAE@XZ" // WIN32-O0: store i1 true -// WIN32-O0: invoke void @"\01?TakeRef@@YAXABUA@@@Z" -// WIN32-O0: invoke x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ" +// WIN32-O0: invoke void @"?TakeRef@@YAXABUA@@@Z" +// WIN32-O0: invoke x86_thiscallcc %struct.A* @"??0A@@QAE@XZ" // WIN32-O0: store i1 true // WIN32-O0: store i1 false, i1* %[[arg1_cond]] -// WIN32-O0: invoke i32 @"\01?TakesTwo@@YAHUA@@0@Z" +// WIN32-O0: invoke i32 @"?TakesTwo@@YAHUA@@0@Z" // False condition. -// WIN32-O0: invoke i32 @"\01?CouldThrow@@YAHXZ"() +// WIN32-O0: invoke i32 @"?CouldThrow@@YAHXZ"() // Two normal cleanups for TakeRef args. -// WIN32-O0: call x86_thiscallcc void @"\01??1A@@QAE@XZ"({{.*}}) -// WIN32-O0-NOT: invoke x86_thiscallcc void @"\01??1A@@QAE@XZ" +// WIN32-O0: call x86_thiscallcc void @"??1A@@QAE@XZ"({{.*}}) +// WIN32-O0-NOT: invoke x86_thiscallcc void @"??1A@@QAE@XZ" // WIN32-O0: ret i32 // // Somewhere in the landing pad soup, we conditionally destroy arg1. // WIN32-O0: %[[isactive:.*]] = load i1, i1* %[[arg1_cond]] // WIN32-O0: br i1 %[[isactive]] -// WIN32-O0: call x86_thiscallcc void @"\01??1A@@QAE@XZ"({{.*}}) +// WIN32-O0: call x86_thiscallcc void @"??1A@@QAE@XZ"({{.*}}) // WIN32-O0: } -// WIN32-O3-LABEL: define i32 @"\01?HasConditionalDeactivatedCleanups@@YAH_N@Z"{{.*}} { +// WIN32-O3-LABEL: define dso_local i32 @"?HasConditionalDeactivatedCleanups@@YAH_N@Z"{{.*}} { // WIN32-O3: alloca i1 // WIN32-O3: alloca i1 // WIN32-O3: %[[arg1_cond:.*]] = alloca i1 @@ -143,29 +143,29 @@ int HasConditionalDeactivatedCleanups(bool cond) { // WIN32-O3: store i1 false // WIN32-O3: br i1 // True condition. -// WIN32-O3: call x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ" +// WIN32-O3: call x86_thiscallcc %struct.A* @"??0A@@QAE@XZ" // WIN32-O3: store i1 true -// WIN32-O3: invoke void @"\01?TakeRef@@YAXABUA@@@Z" -// WIN32-O3: invoke x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ" +// WIN32-O3: invoke void @"?TakeRef@@YAXABUA@@@Z" +// WIN32-O3: invoke x86_thiscallcc %struct.A* @"??0A@@QAE@XZ" // WIN32-O3: store i1 true, i1* %[[arg1_cond]] -// WIN32-O3: invoke x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ" +// WIN32-O3: invoke x86_thiscallcc %struct.A* @"??0A@@QAE@XZ" // WIN32-O3: store i1 true -// WIN32-O3: invoke void @"\01?TakeRef@@YAXABUA@@@Z" -// WIN32-O3: invoke x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ" +// WIN32-O3: invoke void @"?TakeRef@@YAXABUA@@@Z" +// WIN32-O3: invoke x86_thiscallcc %struct.A* @"??0A@@QAE@XZ" // WIN32-O3: store i1 true // WIN32-O3: store i1 false, i1* %[[arg1_cond]] -// WIN32-O3: invoke i32 @"\01?TakesTwo@@YAHUA@@0@Z" +// WIN32-O3: invoke i32 @"?TakesTwo@@YAHUA@@0@Z" // False condition. -// WIN32-O3: invoke i32 @"\01?CouldThrow@@YAHXZ"() +// WIN32-O3: invoke i32 @"?CouldThrow@@YAHXZ"() // Two normal cleanups for TakeRef args. -// WIN32-O3: call x86_thiscallcc void @"\01??1A@@QAE@XZ"({{.*}}) -// WIN32-O3-NOT: invoke x86_thiscallcc void @"\01??1A@@QAE@XZ" +// WIN32-O3: call x86_thiscallcc void @"??1A@@QAE@XZ"({{.*}}) +// WIN32-O3-NOT: invoke x86_thiscallcc void @"??1A@@QAE@XZ" // WIN32-O3: ret i32 // // Somewhere in the landing pad soup, we conditionally destroy arg1. // WIN32-O3: %[[isactive:.*]] = load i1, i1* %[[arg1_cond]] // WIN32-O3: br i1 %[[isactive]] -// WIN32-O3: call x86_thiscallcc void @"\01??1A@@QAE@XZ"({{.*}}) +// WIN32-O3: call x86_thiscallcc void @"??1A@@QAE@XZ"({{.*}}) // WIN32-O3: } namespace crash_on_partial_destroy { @@ -187,7 +187,7 @@ C::C() { foo(); } // Verify that we don't bother with a vbtable lookup when adjusting the this // pointer to call a base destructor from a constructor while unwinding. -// WIN32-LABEL: define {{.*}} @"\01??0C@crash_on_partial_destroy@@QAE@XZ"{{.*}} { +// WIN32-LABEL: define dso_local {{.*}} @"??0C@crash_on_partial_destroy@@QAE@XZ"{{.*}} { // WIN32: cleanuppad // // We shouldn't do any vbptr loads, just constant GEPs. @@ -195,7 +195,7 @@ C::C() { foo(); } // WIN32: getelementptr i8, i8* %{{.*}}, i32 4 // WIN32-NOT: load // WIN32: bitcast i8* %{{.*}} to %"struct.crash_on_partial_destroy::B"* -// WIN32: call x86_thiscallcc void @"\01??1B@crash_on_partial_destroy@@UAE@XZ" +// WIN32: call x86_thiscallcc void @"??1B@crash_on_partial_destroy@@UAE@XZ" // // WIN32-NOT: load // WIN32: bitcast %"struct.crash_on_partial_destroy::C"* %{{.*}} to i8* @@ -203,7 +203,7 @@ C::C() { foo(); } // WIN32: getelementptr inbounds i8, i8* %{{.*}}, i32 4 // WIN32-NOT: load // WIN32: bitcast i8* %{{.*}} to %"struct.crash_on_partial_destroy::A"* -// WIN32: call x86_thiscallcc void @"\01??1A@crash_on_partial_destroy@@UAE@XZ"({{.*}}) +// WIN32: call x86_thiscallcc void @"??1A@crash_on_partial_destroy@@UAE@XZ"({{.*}}) // WIN32: } } @@ -217,16 +217,16 @@ void f() { g(); } -// WIN32-LABEL: define void @"\01?f@dont_call_terminate@@YAXXZ"() -// WIN32: invoke void @"\01?g@dont_call_terminate@@YAXXZ"() +// WIN32-LABEL: define dso_local void @"?f@dont_call_terminate@@YAXXZ"() +// WIN32: invoke void @"?g@dont_call_terminate@@YAXXZ"() // WIN32-NEXT: to label %[[cont:[^ ]*]] unwind label %[[lpad:[^ ]*]] // // WIN32: [[cont]] -// WIN32: call x86_thiscallcc void @"\01??1C@dont_call_terminate@@QAE@XZ"({{.*}}) +// WIN32: call x86_thiscallcc void @"??1C@dont_call_terminate@@QAE@XZ"({{.*}}) // // WIN32: [[lpad]] // WIN32-NEXT: cleanuppad -// WIN32: call x86_thiscallcc void @"\01??1C@dont_call_terminate@@QAE@XZ"({{.*}}) +// WIN32: call x86_thiscallcc void @"??1C@dont_call_terminate@@QAE@XZ"({{.*}}) } namespace noexcept_false_dtor { @@ -239,11 +239,11 @@ void f() { } } -// WIN32-LABEL: define void @"\01?f@noexcept_false_dtor@@YAXXZ"() -// WIN32: invoke i32 @"\01?CouldThrow@@YAHXZ"() -// WIN32: call x86_thiscallcc void @"\01??1D@noexcept_false_dtor@@QAE@XZ"(%"struct.noexcept_false_dtor::D"* %{{.*}}) +// WIN32-LABEL: define dso_local void @"?f@noexcept_false_dtor@@YAXXZ"() +// WIN32: invoke i32 @"?CouldThrow@@YAHXZ"() +// WIN32: call x86_thiscallcc void @"??1D@noexcept_false_dtor@@QAE@XZ"(%"struct.noexcept_false_dtor::D"* %{{.*}}) // WIN32: cleanuppad -// WIN32: call x86_thiscallcc void @"\01??1D@noexcept_false_dtor@@QAE@XZ"(%"struct.noexcept_false_dtor::D"* %{{.*}}) +// WIN32: call x86_thiscallcc void @"??1D@noexcept_false_dtor@@QAE@XZ"(%"struct.noexcept_false_dtor::D"* %{{.*}}) // WIN32: cleanupret namespace lifetime_marker { @@ -256,21 +256,21 @@ void f() { g(); } -// WIN32-LIFETIME-LABEL: define void @"\01?f@lifetime_marker@@YAXXZ"() +// WIN32-LIFETIME-LABEL: define dso_local void @"?f@lifetime_marker@@YAXXZ"() // WIN32-LIFETIME: %[[c:.*]] = alloca %"struct.lifetime_marker::C" // WIN32-LIFETIME: %[[bc0:.*]] = bitcast %"struct.lifetime_marker::C"* %c to i8* // WIN32-LIFETIME: call void @llvm.lifetime.start.p0i8(i64 1, i8* %[[bc0]]) -// WIN32-LIFETIME: invoke void @"\01?g@lifetime_marker@@YAXXZ"() +// WIN32-LIFETIME: invoke void @"?g@lifetime_marker@@YAXXZ"() // WIN32-LIFETIME-NEXT: to label %[[cont:[^ ]*]] unwind label %[[lpad0:[^ ]*]] // // WIN32-LIFETIME: [[cont]] -// WIN32-LIFETIME: call x86_thiscallcc void @"\01??1C@lifetime_marker@@QAE@XZ"({{.*}}) +// WIN32-LIFETIME: call x86_thiscallcc void @"??1C@lifetime_marker@@QAE@XZ"({{.*}}) // WIN32-LIFETIME: %[[bc1:.*]] = bitcast %"struct.lifetime_marker::C"* %[[c]] to i8* // WIN32-LIFETIME: call void @llvm.lifetime.end.p0i8(i64 1, i8* %[[bc1]]) // // WIN32-LIFETIME: [[lpad0]] // WIN32-LIFETIME-NEXT: cleanuppad -// WIN32-LIFETIME: call x86_thiscallcc void @"\01??1C@lifetime_marker@@QAE@XZ"({{.*}}) +// WIN32-LIFETIME: call x86_thiscallcc void @"??1C@lifetime_marker@@QAE@XZ"({{.*}}) // WIN32-LIFETIME: cleanupret {{.*}} unwind label %[[lpad1:[^ ]*]] // // WIN32-LIFETIME: [[lpad1]] @@ -293,7 +293,7 @@ struct class_0 : class_1 { }; class_0::class_0() { - // WIN32: define x86_thiscallcc %struct.class_0* @"\01??0class_0@@QAE@XZ"(%struct.class_0* returned %this, i32 %is_most_derived) + // WIN32: define dso_local x86_thiscallcc %struct.class_0* @"??0class_0@@QAE@XZ"(%struct.class_0* returned %this, i32 %is_most_derived) // WIN32: store i32 %is_most_derived, i32* %[[IS_MOST_DERIVED_VAR:.*]], align 4 // WIN32: %[[IS_MOST_DERIVED_VAL:.*]] = load i32, i32* %[[IS_MOST_DERIVED_VAR]] // WIN32: %[[SHOULD_CALL_VBASE_CTORS:.*]] = icmp ne i32 %[[IS_MOST_DERIVED_VAL]], 0 @@ -309,7 +309,31 @@ class_0::class_0() { // WIN32-NEXT: %[[SHOULD_CALL_VBASE_DTOR:.*]] = icmp ne i32 %[[IS_MOST_DERIVED_VAL]], 0 // WIN32-NEXT: br i1 %[[SHOULD_CALL_VBASE_DTOR]], label %[[DTOR_VBASE:.*]], label %[[SKIP_VBASE:.*]] // WIN32: [[DTOR_VBASE]] - // WIN32-NEXT: call x86_thiscallcc void @"\01??1class_2@@UAE@XZ" + // WIN32-NEXT: call x86_thiscallcc void @"??1class_2@@UAE@XZ" // WIN32: br label %[[SKIP_VBASE]] // WIN32: [[SKIP_VBASE]] } + +namespace PR37146 { +// Check that IRGen doesn't emit calls to synthesized destructors for +// non-trival C structs. + +// WIN32: define dso_local void @"?test@PR37146@@YAXXZ"() +// WIN32: call void @llvm.memset.p0i8.i32( +// WIN32: call i32 @"?getS@PR37146@@YA?AUS@1@XZ"( +// WIN32: call void @"?func@PR37146@@YAXUS@1@0@Z"( +// WIN32-NEXT: ret void +// WIN32-NEXT: {{^}$}} + +struct S { + int f; +}; + +void func(S, S); +S getS(); + +void test() { + func(getS(), S()); +} + +} diff --git a/test/CodeGenCXX/microsoft-abi-eh-inlineasm.cpp b/test/CodeGenCXX/microsoft-abi-eh-inlineasm.cpp new file mode 100644 index 0000000000000..4179508a8da58 --- /dev/null +++ b/test/CodeGenCXX/microsoft-abi-eh-inlineasm.cpp @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -triple=x86_64-pc-windows-msvc \ +// RUN: -fexceptions -fcxx-exceptions | FileCheck %s + +// Make sure calls to inline asm have funclet bundles. + +extern "C" void might_throw(); +extern "C" void foo() { + try { + might_throw(); + } catch (int) { + __asm__("nop"); + } +} + +// CHECK-LABEL: define dso_local void @foo() +// CHECK: invoke void @might_throw() +// CHECK: %[[CATCHPAD:[^ ]*]] = catchpad within +// CHECK: call void asm sideeffect "nop", {{.*}} [ "funclet"(token %[[CATCHPAD]]) ] diff --git a/test/CodeGenCXX/microsoft-abi-eh-terminate.cpp b/test/CodeGenCXX/microsoft-abi-eh-terminate.cpp index 7836dcf32b118..394b83485b526 100644 --- a/test/CodeGenCXX/microsoft-abi-eh-terminate.cpp +++ b/test/CodeGenCXX/microsoft-abi-eh-terminate.cpp @@ -6,11 +6,11 @@ void never_throws() noexcept(true) { may_throw(); } -// CHECK-LABEL: define void @"\01?never_throws@@YAXXZ"() +// CHECK-LABEL: define dso_local void @"?never_throws@@YAXXZ"() // CHECK-SAME: personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) -// CHECK: invoke void @"\01?may_throw@@YAXXZ"() +// CHECK: invoke void @"?may_throw@@YAXXZ"() // CHECK: %[[cp:.*]] = cleanuppad within none [] -// MSVC2013: call void @"\01?terminate@@YAXXZ"() +// MSVC2013: call void @"?terminate@@YAXXZ"() // MSVC2015: call void @__std_terminate() // CHECK-SAME: [ "funclet"(token %[[cp]]) ] // CHECK-NEXT: unreachable diff --git a/test/CodeGenCXX/microsoft-abi-emit-dependent.cpp b/test/CodeGenCXX/microsoft-abi-emit-dependent.cpp new file mode 100644 index 0000000000000..e74ebc879f5b2 --- /dev/null +++ b/test/CodeGenCXX/microsoft-abi-emit-dependent.cpp @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -emit-llvm-only -fmodules -triple x86_64-windows %s +// PR36181 +#pragma clang module build foo +module foo {} +#pragma clang module contents +template <typename T> struct A { + friend void f(A<T>) {} +}; +#pragma clang module endbuild +#pragma clang module import foo +void g() { f(A<int>()); } diff --git a/test/CodeGenCXX/microsoft-abi-extern-template.cpp b/test/CodeGenCXX/microsoft-abi-extern-template.cpp index c69b4f5b8d867..83592363844f9 100644 --- a/test/CodeGenCXX/microsoft-abi-extern-template.cpp +++ b/test/CodeGenCXX/microsoft-abi-extern-template.cpp @@ -3,17 +3,17 @@ // Even though Foo<int> has an extern template declaration, we have to emit our // own copy the vftable when emitting the available externally constructor. -// CHECK: @"\01??_7?$Foo@H@@6B@" = linkonce_odr unnamed_addr constant { [1 x i8*] } { [1 x i8*] [ -// CHECK-SAME: i8* bitcast (i8* (%struct.Foo*, i32)* @"\01??_G?$Foo@H@@UEAAPEAXI@Z" to i8*) +// CHECK: @"??_7?$Foo@H@@6B@" = linkonce_odr unnamed_addr constant { [1 x i8*] } { [1 x i8*] [ +// CHECK-SAME: i8* bitcast (i8* (%struct.Foo*, i32)* @"??_G?$Foo@H@@UEAAPEAXI@Z" to i8*) // CHECK-SAME: ] }, comdat -// CHECK-LABEL: define %struct.Foo* @"\01?f@@YAPEAU?$Foo@H@@XZ"() -// CHECK: call %struct.Foo* @"\01??0?$Foo@H@@QEAA@XZ"(%struct.Foo* %{{.*}}) +// CHECK-LABEL: define dso_local %struct.Foo* @"?f@@YAPEAU?$Foo@H@@XZ"() +// CHECK: call %struct.Foo* @"??0?$Foo@H@@QEAA@XZ"(%struct.Foo* %{{.*}}) -// CHECK: define available_externally %struct.Foo* @"\01??0?$Foo@H@@QEAA@XZ"(%struct.Foo* returned %this) -// CHECK: store {{.*}} @"\01??_7?$Foo@H@@6B@" +// CHECK: define available_externally dso_local %struct.Foo* @"??0?$Foo@H@@QEAA@XZ"(%struct.Foo* returned %this) +// CHECK: store {{.*}} @"??_7?$Foo@H@@6B@" -// CHECK: define linkonce_odr i8* @"\01??_G?$Foo@H@@UEAAPEAXI@Z"(%struct.Foo* %this, i32 %should_call_delete) +// CHECK: define linkonce_odr dso_local i8* @"??_G?$Foo@H@@UEAAPEAXI@Z"(%struct.Foo* %this, i32 %should_call_delete) struct Base { virtual ~Base(); diff --git a/test/CodeGenCXX/microsoft-abi-member-pointers.cpp b/test/CodeGenCXX/microsoft-abi-member-pointers.cpp index a3985ba09c028..cb3b41bbb4f10 100755 --- a/test/CodeGenCXX/microsoft-abi-member-pointers.cpp +++ b/test/CodeGenCXX/microsoft-abi-member-pointers.cpp @@ -1,8 +1,126 @@ -// RUN: %clang_cc1 -std=c++11 -Wno-uninitialized -fno-rtti -emit-llvm %s -o - -triple=i386-pc-win32 -fms-extensions | FileCheck %s +// RUN: %clang_cc1 -std=c++11 -Wno-uninitialized -fno-rtti -emit-llvm %s -o - -triple=i386-pc-win32 -fms-extensions | FileCheck -allow-deprecated-dag-overlap %s // RUN: %clang_cc1 -std=c++11 -Wno-uninitialized -fno-rtti -emit-llvm %s -o - -triple=x86_64-pc-win32 -fms-extensions | FileCheck %s -check-prefix=X64 // RUN: %clang_cc1 -std=c++11 -Wno-uninitialized -fno-rtti -emit-llvm %s -o - -triple=i386-pc-win32 -DINCOMPLETE_VIRTUAL -fms-extensions -verify // RUN: %clang_cc1 -std=c++11 -Wno-uninitialized -fno-rtti -emit-llvm %s -o - -triple=i386-pc-win32 -DINCOMPLETE_VIRTUAL -DMEMFUN -fms-extensions -verify +namespace pr37399 { +template <typename T> +struct Functor { + void (T::*PtrToMemberFunction)(); +}; +// CHECK-DAG: %"struct.pr37399::Functor" = type { i8* } + +template <typename SomeType> +class SimpleDerivedFunctor; +template <typename SomeType> +class SimpleDerivedFunctor : public Functor<SimpleDerivedFunctor<SomeType>> {}; +// CHECK-DAG: %"class.pr37399::SimpleDerivedFunctor" = type { %"struct.pr37399::Functor" } + +SimpleDerivedFunctor<void> SimpleFunctor; +// CHECK-DAG: @"?SimpleFunctor@pr37399@@3V?$SimpleDerivedFunctor@X@1@A" = dso_local global %"class.pr37399::SimpleDerivedFunctor" zeroinitializer, align 4 + +short Global = 0; +template <typename SomeType> +class DerivedFunctor; +template <typename SomeType> +class DerivedFunctor + : public Functor<DerivedFunctor<void>> { +public: + void Foo() { + Global = 42; + } +}; + +class MultipleBase { +public: + MultipleBase() : Value() {} + short Value; +}; +// CHECK-DAG: %"class.pr37399::MultipleBase" = type { i16 } + +template <typename SomeType> +class MultiplyDerivedFunctor; +template <typename SomeType> +class MultiplyDerivedFunctor + : public Functor<MultiplyDerivedFunctor<void>>, + public MultipleBase { +public: + void Foo() { + MultipleBase::Value = 42*2; + } +}; + +class VirtualBase { +public: + VirtualBase() : Value() {} + short Value; +}; +// CHECK-DAG: %"class.pr37399::VirtualBase" = type { i16 } + +template <typename SomeType> +class VirtBaseFunctor + : public Functor<SomeType>, + public virtual VirtualBase{}; +template <typename SomeType> +class VirtuallyDerivedFunctor; +template <typename SomeType> +class VirtuallyDerivedFunctor + : public VirtBaseFunctor<VirtuallyDerivedFunctor<void>>, + public virtual VirtualBase { +public: + void Foo() { + VirtualBase::Value = 42*3; + } +}; +} // namespace pr37399 + +pr37399::DerivedFunctor<int> BFunctor; +// CHECK-DAG: @"?BFunctor@@3V?$DerivedFunctor@H@pr37399@@A" = dso_local global %"[[BFUNCTOR:class.pr37399::DerivedFunctor(\.[0-9]+)?]]" zeroinitializer, align 8 +// CHECK-DAG: %"[[BFUNCTOR]]" = type { %"[[BFUNCTORBASE:struct.pr37399::Functor(\.[0-9]+)?]]" } +// CHECK-DAG: %"[[BFUNCTORBASE]]" = type { { i8*, i32, i32, i32 } } +pr37399::DerivedFunctor<void> AFunctor; +// CHECK-DAG: @"?AFunctor@@3V?$DerivedFunctor@X@pr37399@@A" = dso_local global %"[[AFUNCTOR:class.pr37399::DerivedFunctor(\.[0-9]+)?]]" zeroinitializer, align 8 +// CHECK-DAG: %"[[AFUNCTOR]]" = type { %"[[AFUNCTORBASE:struct.pr37399::Functor(\.[0-9]+)?]]" } +// CHECK-DAG: %"[[AFUNCTORBASE]]" = type { { i8*, i32, i32, i32 } } + +pr37399::MultiplyDerivedFunctor<int> DFunctor; +// CHECK-DAG: @"?DFunctor@@3V?$MultiplyDerivedFunctor@H@pr37399@@A" = dso_local global %"[[DFUNCTOR:class.pr37399::MultiplyDerivedFunctor(\.[0-9]+)?]]" zeroinitializer, align 8 +// CHECK-DAG: %"[[DFUNCTOR]]" = type { %"[[DFUNCTORBASE:struct.pr37399::Functor(\.[0-9]+)?]]", %"class.pr37399::MultipleBase", [6 x i8] } +// CHECK-DAG: %"[[DFUNCTORBASE]]" = type { { i8*, i32, i32, i32 } } +pr37399::MultiplyDerivedFunctor<void> CFunctor; +// CHECK-DAG: @"?CFunctor@@3V?$MultiplyDerivedFunctor@X@pr37399@@A" = dso_local global %"[[CFUNCTOR:class.pr37399::MultiplyDerivedFunctor(\.[0-9]+)?]]" zeroinitializer, align 8 +// CHECK-DAG: %"[[CFUNCTOR]]" = type { %"[[CFUNCTORBASE:struct.pr37399::Functor(\.[0-9]+)?]]", %"class.pr37399::MultipleBase", [6 x i8] } +// CHECK-DAG: %"[[CFUNCTORBASE]]" = type { { i8*, i32, i32, i32 } } + +pr37399::VirtuallyDerivedFunctor<int> FFunctor; +// CHECK-DAG: @"?FFunctor@@3V?$VirtuallyDerivedFunctor@H@pr37399@@A" = dso_local global %"[[FFUNCTOR:class.pr37399::VirtuallyDerivedFunctor(\.[0-9]+)?]]" zeroinitializer, align 8 +// CHECK-DAG: %"[[FFUNCTOR]]" = type { %"class.pr37399::VirtBaseFunctor.base", %"class.pr37399::VirtualBase" } +pr37399::VirtuallyDerivedFunctor<void> EFunctor; +// CHECK-DAG: @"?EFunctor@@3V?$VirtuallyDerivedFunctor@X@pr37399@@A" = dso_local global %"[[EFUNCTOR:class.pr37399::VirtuallyDerivedFunctor(\.[0-9]+)?]]" zeroinitializer, align 8 +// CHECK-DAG: %"[[EFUNCTOR]]" = type { %"class.pr37399::VirtBaseFunctor.base", %"class.pr37399::VirtualBase" } + +// CHECK-DAG: %"class.pr37399::VirtBaseFunctor.base" = type <{ %"[[VFUNCTORBASE:struct.pr37399::Functor(\.[0-9]+)?]]", i32*, [4 x i8] }> +// CHECK-DAG: %"[[VFUNCTORBASE]]" = type { { i8*, i32, i32, i32 } } + +namespace pr37399 { +void SingleInheritanceFnPtrCall() { + BFunctor.PtrToMemberFunction = &DerivedFunctor<void>::Foo; + (AFunctor.*(BFunctor.PtrToMemberFunction))(); +} +void MultipleInheritanceFnPtrCall() { + DFunctor.PtrToMemberFunction = &MultiplyDerivedFunctor<void>::Foo; + Global = CFunctor.MultipleBase::Value; + (CFunctor.*(DFunctor.PtrToMemberFunction))(); + Global = CFunctor.MultipleBase::Value; +} +void VirtualInheritanceFnPtrCall() { + FFunctor.PtrToMemberFunction = &VirtuallyDerivedFunctor<void>::Foo; + Global = EFunctor.VirtualBase::Value; + (EFunctor.*(FFunctor.PtrToMemberFunction))(); + Global = EFunctor.VirtualBase::Value; +} +} // namespace pr37399 + struct PR26313_Y; typedef void (PR26313_Y::*PR26313_FUNC)(); struct PR26313_X { @@ -15,17 +133,17 @@ void PR26313_f(PR26313_FUNC *p) { delete p; } struct PR26313_Z; int PR26313_Z::**a = nullptr; int PR26313_Z::*b = *a; -// CHECK-DAG: @"\01?a@@3PAPQPR26313_Z@@HA" = global %0* null, align 4 -// CHECK-DAG: @"\01?b@@3PQPR26313_Z@@HQ1@" = global { i32, i32, i32 } { i32 0, i32 0, i32 -1 }, align 4 +// CHECK-DAG: @"?a@@3PAPQPR26313_Z@@HA" = dso_local global %0* null, align 4 +// CHECK-DAG: @"?b@@3PQPR26313_Z@@HQ1@" = dso_local global { i32, i32, i32 } { i32 0, i32 0, i32 -1 }, align 4 namespace PR20947 { struct A; int A::**a = nullptr; -// CHECK-DAG: @"\01?a@PR20947@@3PAPQA@1@HA" = global %{{.*}}* null, align 4 +// CHECK-DAG: @"?a@PR20947@@3PAPQA@1@HA" = dso_local global %{{.*}}* null, align 4 struct B; int B::*&b = b; -// CHECK-DAG: @"\01?b@PR20947@@3AAPQB@1@HA" = global %{{.*}}* null, align 4 +// CHECK-DAG: @"?b@PR20947@@3AAPQB@1@HA" = dso_local global %{{.*}}* null, align 4 } namespace PR20017 { @@ -35,7 +153,7 @@ struct A { }; struct B; auto a = &A<B>::m_fn1; -// CHECK-DAG: @"\01?a@PR20017@@3P8?$A@UB@PR20017@@@1@AEPQB@1@HXZQ21@" = global i8* bitcast ({ i32, i32, i32 } ({{.*}}*)* @"\01?m_fn1@?$A@UB@PR20017@@@PR20017@@QAEPQB@2@HXZ" to i8*), align 4 +// CHECK-DAG: @"?a@PR20017@@3P8?$A@UB@PR20017@@@1@AEPQB@1@HXZQ21@" = dso_local global i8* bitcast ({ i32, i32, i32 } ({{.*}}*)* @"?m_fn1@?$A@UB@PR20017@@@PR20017@@QAEPQB@2@HXZ" to i8*), align 4 } #ifndef INCOMPLETE_VIRTUAL @@ -89,24 +207,24 @@ int Virtual ::*v_d_memptr; int NonZeroVBPtr::*n_d_memptr; int Unspecified::*u_d_memptr; int UnspecSingle::*us_d_memptr; -// CHECK: @"\01?s_d_memptr@@3PQSingle@@HQ1@" = global i32 -1, align 4 -// CHECK: @"\01?p_d_memptr@@3PQPolymorphic@@HQ1@" = global i32 0, align 4 -// CHECK: @"\01?m_d_memptr@@3PQMultiple@@HQ1@" = global i32 -1, align 4 -// CHECK: @"\01?v_d_memptr@@3PQVirtual@@HQ1@" = global { i32, i32 } +// CHECK: @"?s_d_memptr@@3PQSingle@@HQ1@" = dso_local global i32 -1, align 4 +// CHECK: @"?p_d_memptr@@3PQPolymorphic@@HQ1@" = dso_local global i32 0, align 4 +// CHECK: @"?m_d_memptr@@3PQMultiple@@HQ1@" = dso_local global i32 -1, align 4 +// CHECK: @"?v_d_memptr@@3PQVirtual@@HQ1@" = dso_local global { i32, i32 } // CHECK: { i32 0, i32 -1 }, align 4 -// CHECK: @"\01?n_d_memptr@@3PQNonZeroVBPtr@@HQ1@" = global { i32, i32 } +// CHECK: @"?n_d_memptr@@3PQNonZeroVBPtr@@HQ1@" = dso_local global { i32, i32 } // CHECK: { i32 0, i32 -1 }, align 4 -// CHECK: @"\01?u_d_memptr@@3PQUnspecified@@HQ1@" = global { i32, i32, i32 } +// CHECK: @"?u_d_memptr@@3PQUnspecified@@HQ1@" = dso_local global { i32, i32, i32 } // CHECK: { i32 0, i32 0, i32 -1 }, align 4 -// CHECK: @"\01?us_d_memptr@@3PQUnspecSingle@@HQ1@" = global { i32, i32, i32 } +// CHECK: @"?us_d_memptr@@3PQUnspecSingle@@HQ1@" = dso_local global { i32, i32, i32 } // CHECK: { i32 0, i32 0, i32 -1 }, align 4 void (Single ::*s_f_memptr)(); void (Multiple::*m_f_memptr)(); void (Virtual ::*v_f_memptr)(); -// CHECK: @"\01?s_f_memptr@@3P8Single@@AEXXZQ1@" = global i8* null, align 4 -// CHECK: @"\01?m_f_memptr@@3P8Multiple@@AEXXZQ1@" = global { i8*, i32 } zeroinitializer, align 4 -// CHECK: @"\01?v_f_memptr@@3P8Virtual@@AEXXZQ1@" = global { i8*, i32, i32 } zeroinitializer, align 4 +// CHECK: @"?s_f_memptr@@3P8Single@@AEXXZQ1@" = dso_local global i8* null, align 4 +// CHECK: @"?m_f_memptr@@3P8Multiple@@AEXXZQ1@" = dso_local global { i8*, i32 } zeroinitializer, align 4 +// CHECK: @"?v_f_memptr@@3P8Virtual@@AEXXZQ1@" = dso_local global { i8*, i32, i32 } zeroinitializer, align 4 // We can define Unspecified after locking in the inheritance model. struct Unspecified : Multiple, Virtual { @@ -125,16 +243,16 @@ void (Multiple ::*m_f_mp)() = &B2::foo; void (Virtual ::*v_f_mp)() = &Virtual::foo; void (Unspecified::*u_f_mp)() = &Unspecified::foo; void (UnspecSingle::*us_f_mp)() = &UnspecSingle::foo; -// CHECK: @"\01?s_f_mp@Const@@3P8Single@@AEXXZQ2@" = -// CHECK: global i8* bitcast ({{.*}} @"\01?foo@Single@@QAEXXZ" to i8*), align 4 -// CHECK: @"\01?m_f_mp@Const@@3P8Multiple@@AEXXZQ2@" = -// CHECK: global { i8*, i32 } { i8* bitcast ({{.*}} @"\01?foo@B2@@QAEXXZ" to i8*), i32 4 }, align 4 -// CHECK: @"\01?v_f_mp@Const@@3P8Virtual@@AEXXZQ2@" = -// CHECK: global { i8*, i32, i32 } { i8* bitcast ({{.*}} @"\01?foo@Virtual@@QAEXXZ" to i8*), i32 0, i32 0 }, align 4 -// CHECK: @"\01?u_f_mp@Const@@3P8Unspecified@@AEXXZQ2@" = -// CHECK: global { i8*, i32, i32, i32 } { i8* bitcast ({{.*}} @"\01?foo@Unspecified@@QAEXXZ" to i8*), i32 0, i32 0, i32 0 }, align 4 -// CHECK: @"\01?us_f_mp@Const@@3P8UnspecSingle@@AEXXZQ2@" = -// CHECK: global { i8*, i32, i32, i32 } { i8* bitcast ({{.*}} @"\01?foo@UnspecSingle@@QAEXXZ" to i8*), i32 0, i32 0, i32 0 }, align 4 +// CHECK: @"?s_f_mp@Const@@3P8Single@@AEXXZQ2@" = +// CHECK: global i8* bitcast ({{.*}} @"?foo@Single@@QAEXXZ" to i8*), align 4 +// CHECK: @"?m_f_mp@Const@@3P8Multiple@@AEXXZQ2@" = +// CHECK: global { i8*, i32 } { i8* bitcast ({{.*}} @"?foo@B2@@QAEXXZ" to i8*), i32 4 }, align 4 +// CHECK: @"?v_f_mp@Const@@3P8Virtual@@AEXXZQ2@" = +// CHECK: global { i8*, i32, i32 } { i8* bitcast ({{.*}} @"?foo@Virtual@@QAEXXZ" to i8*), i32 0, i32 0 }, align 4 +// CHECK: @"?u_f_mp@Const@@3P8Unspecified@@AEXXZQ2@" = +// CHECK: global { i8*, i32, i32, i32 } { i8* bitcast ({{.*}} @"?foo@Unspecified@@QAEXXZ" to i8*), i32 0, i32 0, i32 0 }, align 4 +// CHECK: @"?us_f_mp@Const@@3P8UnspecSingle@@AEXXZQ2@" = +// CHECK: global { i8*, i32, i32, i32 } { i8* bitcast ({{.*}} @"?foo@UnspecSingle@@QAEXXZ" to i8*), i32 0, i32 0, i32 0 }, align 4 } namespace CastParam { @@ -150,16 +268,16 @@ struct B { int b; }; struct C : B, A { int c; }; void (A::*ptr1)(void *) = (void (A::*)(void *)) &A::foo; -// CHECK: @"\01?ptr1@CastParam@@3P8A@1@AEXPAX@ZQ21@" = -// CHECK: global i8* bitcast (void ({{.*}})* @"\01?foo@A@CastParam@@QAEXPAU12@@Z" to i8*), align 4 +// CHECK: @"?ptr1@CastParam@@3P8A@1@AEXPAX@ZQ21@" = +// CHECK: global i8* bitcast (void ({{.*}})* @"?foo@A@CastParam@@QAEXPAU12@@Z" to i8*), align 4 // Try a reinterpret_cast followed by a memptr conversion. void (C::*ptr2)(void *) = (void (C::*)(void *)) (void (A::*)(void *)) &A::foo; -// CHECK: @"\01?ptr2@CastParam@@3P8C@1@AEXPAX@ZQ21@" = -// CHECK: global { i8*, i32 } { i8* bitcast (void ({{.*}})* @"\01?foo@A@CastParam@@QAEXPAU12@@Z" to i8*), i32 4 }, align 4 +// CHECK: @"?ptr2@CastParam@@3P8C@1@AEXPAX@ZQ21@" = +// CHECK: global { i8*, i32 } { i8* bitcast (void ({{.*}})* @"?foo@A@CastParam@@QAEXPAU12@@Z" to i8*), i32 4 }, align 4 void (C::*ptr3)(void *) = (void (C::*)(void *)) (void (A::*)(void *)) (void (A::*)(A *)) 0; -// CHECK: @"\01?ptr3@CastParam@@3P8C@1@AEXPAX@ZQ21@" = +// CHECK: @"?ptr3@CastParam@@3P8C@1@AEXPAX@ZQ21@" = // CHECK: global { i8*, i32 } zeroinitializer, align 4 struct D : C { @@ -170,11 +288,11 @@ struct D : C { // Try a cast that changes the inheritance model. Null for D is 0, but null for // C is -1. We need the cast to long in order to hit the non-APValue path. int C::*ptr4 = (int C::*) (int D::*) (long D::*) 0; -// CHECK: @"\01?ptr4@CastParam@@3PQC@1@HQ21@" = global i32 -1, align 4 +// CHECK: @"?ptr4@CastParam@@3PQC@1@HQ21@" = dso_local global i32 -1, align 4 // MSVC rejects this but we accept it. int C::*ptr5 = (int C::*) (long D::*) 0; -// CHECK: @"\01?ptr5@CastParam@@3PQC@1@HQ21@" = global i32 -1, align 4 +// CHECK: @"?ptr5@CastParam@@3PQC@1@HQ21@" = dso_local global i32 -1, align 4 } struct UnspecWithVBPtr; @@ -191,23 +309,23 @@ void EmitNonVirtualMemberPointers() { void (Virtual ::*v_f_memptr)() = &Virtual::foo; void (Unspecified::*u_f_memptr)() = &Unspecified::foo; void (UnspecWithVBPtr::*u2_f_memptr)() = &UnspecWithVBPtr::foo; -// CHECK: define void @"\01?EmitNonVirtualMemberPointers@@YAXXZ"() {{.*}} { +// CHECK: define dso_local void @"?EmitNonVirtualMemberPointers@@YAXXZ"() {{.*}} { // CHECK: alloca i8*, align 4 // CHECK: alloca { i8*, i32 }, align 4 // CHECK: alloca { i8*, i32, i32 }, align 4 // CHECK: alloca { i8*, i32, i32, i32 }, align 4 -// CHECK: store i8* bitcast (void (%{{.*}}*)* @"\01?foo@Single@@QAEXXZ" to i8*), i8** %{{.*}}, align 4 +// CHECK: store i8* bitcast (void (%{{.*}}*)* @"?foo@Single@@QAEXXZ" to i8*), i8** %{{.*}}, align 4 // CHECK: store { i8*, i32 } -// CHECK: { i8* bitcast (void (%{{.*}}*)* @"\01?foo@Multiple@@QAEXXZ" to i8*), i32 0 }, +// CHECK: { i8* bitcast (void (%{{.*}}*)* @"?foo@Multiple@@QAEXXZ" to i8*), i32 0 }, // CHECK: { i8*, i32 }* %{{.*}}, align 4 // CHECK: store { i8*, i32, i32 } -// CHECK: { i8* bitcast (void (%{{.*}}*)* @"\01?foo@Virtual@@QAEXXZ" to i8*), i32 0, i32 0 }, +// CHECK: { i8* bitcast (void (%{{.*}}*)* @"?foo@Virtual@@QAEXXZ" to i8*), i32 0, i32 0 }, // CHECK: { i8*, i32, i32 }* %{{.*}}, align 4 // CHECK: store { i8*, i32, i32, i32 } -// CHECK: { i8* bitcast (void (%{{.*}}*)* @"\01?foo@Unspecified@@QAEXXZ" to i8*), i32 0, i32 0, i32 0 }, +// CHECK: { i8* bitcast (void (%{{.*}}*)* @"?foo@Unspecified@@QAEXXZ" to i8*), i32 0, i32 0, i32 0 }, // CHECK: { i8*, i32, i32, i32 }* %{{.*}}, align 4 // CHECK: store { i8*, i32, i32, i32 } -// CHECK: { i8* bitcast (void (%{{.*}}*)* @"\01?foo@UnspecWithVBPtr@@QAEXXZ" to i8*), +// CHECK: { i8* bitcast (void (%{{.*}}*)* @"?foo@UnspecWithVBPtr@@QAEXXZ" to i8*), // CHECK: i32 0, i32 0, i32 0 }, // CHECK: { i8*, i32, i32, i32 }* %{{.*}}, align 4 // CHECK: ret void @@ -221,7 +339,7 @@ void podMemPtrs() { if (memptr) memptr = 0; // Check that member pointers use the right offsets and that null is -1. -// CHECK: define void @"\01?podMemPtrs@@YAXXZ"() {{.*}} { +// CHECK: define dso_local void @"?podMemPtrs@@YAXXZ"() {{.*}} { // CHECK: %[[memptr:.*]] = alloca i32, align 4 // CHECK-NEXT: store i32 0, i32* %[[memptr]], align 4 // CHECK-NEXT: store i32 4, i32* %[[memptr]], align 4 @@ -241,7 +359,7 @@ void polymorphicMemPtrs() { memptr = 0; // Member pointers for polymorphic classes include the vtable slot in their // offset and use 0 to represent null. -// CHECK: define void @"\01?polymorphicMemPtrs@@YAXXZ"() {{.*}} { +// CHECK: define dso_local void @"?polymorphicMemPtrs@@YAXXZ"() {{.*}} { // CHECK: %[[memptr:.*]] = alloca i32, align 4 // CHECK-NEXT: store i32 4, i32* %[[memptr]], align 4 // CHECK-NEXT: store i32 8, i32* %[[memptr]], align 4 @@ -255,7 +373,7 @@ void polymorphicMemPtrs() { bool nullTestDataUnspecified(int Unspecified::*mp) { return mp; -// CHECK: define zeroext i1 @"\01?nullTestDataUnspecified@@YA_NPQUnspecified@@H@Z"{{.*}} { +// CHECK: define dso_local zeroext i1 @"?nullTestDataUnspecified@@YA_NPQUnspecified@@H@Z"{{.*}} { // CHECK: %{{.*}} = load { i32, i32, i32 }, { i32, i32, i32 }* %{{.*}}, align 4 // CHECK: store { i32, i32, i32 } {{.*}} align 4 // CHECK: %[[mp:.*]] = load { i32, i32, i32 }, { i32, i32, i32 }* %{{.*}}, align 4 @@ -271,13 +389,13 @@ bool nullTestDataUnspecified(int Unspecified::*mp) { // CHECK: } // Pass this large type indirectly. -// X64-LABEL: define zeroext i1 @"\01?nullTestDataUnspecified@@ +// X64-LABEL: define dso_local zeroext i1 @"?nullTestDataUnspecified@@ // X64: ({ i32, i32, i32 }*) } bool nullTestFunctionUnspecified(void (Unspecified::*mp)()) { return mp; -// CHECK: define zeroext i1 @"\01?nullTestFunctionUnspecified@@YA_NP8Unspecified@@AEXXZ@Z"{{.*}} { +// CHECK: define dso_local zeroext i1 @"?nullTestFunctionUnspecified@@YA_NP8Unspecified@@AEXXZ@Z"{{.*}} { // CHECK: %{{.*}} = load { i8*, i32, i32, i32 }, { i8*, i32, i32, i32 }* %{{.*}}, align 4 // CHECK: store { i8*, i32, i32, i32 } {{.*}} align 4 // CHECK: %[[mp:.*]] = load { i8*, i32, i32, i32 }, { i8*, i32, i32, i32 }* %{{.*}}, align 4 @@ -291,7 +409,7 @@ int loadDataMemberPointerVirtual(Virtual *o, int Virtual::*memptr) { return o->*memptr; // Test that we can unpack this aggregate member pointer and load the member // data pointer. -// CHECK: define i32 @"\01?loadDataMemberPointerVirtual@@YAHPAUVirtual@@PQ1@H@Z"{{.*}} { +// CHECK: define dso_local i32 @"?loadDataMemberPointerVirtual@@YAHPAUVirtual@@PQ1@H@Z"{{.*}} { // CHECK: %[[o:.*]] = load %{{.*}}*, %{{.*}}** %{{.*}}, align 4 // CHECK: %[[memptr:.*]] = load { i32, i32 }, { i32, i32 }* %{{.*}}, align 4 // CHECK: %[[memptr0:.*]] = extractvalue { i32, i32 } %[[memptr:.*]], 0 @@ -312,7 +430,7 @@ int loadDataMemberPointerVirtual(Virtual *o, int Virtual::*memptr) { // A two-field data memptr on x64 gets coerced to i64 and is passed in a // register or memory. -// X64-LABEL: define i32 @"\01?loadDataMemberPointerVirtual@@YAHPEAUVirtual@@PEQ1@H@Z" +// X64-LABEL: define dso_local i32 @"?loadDataMemberPointerVirtual@@YAHPEAUVirtual@@PEQ1@H@Z" // X64: (%struct.Virtual* %o, i64 %memptr.coerce) } @@ -320,7 +438,7 @@ int loadDataMemberPointerUnspecified(Unspecified *o, int Unspecified::*memptr) { return o->*memptr; // Test that we can unpack this aggregate member pointer and load the member // data pointer. -// CHECK: define i32 @"\01?loadDataMemberPointerUnspecified@@YAHPAUUnspecified@@PQ1@H@Z"{{.*}} { +// CHECK: define dso_local i32 @"?loadDataMemberPointerUnspecified@@YAHPAUUnspecified@@PQ1@H@Z"{{.*}} { // CHECK: %[[o:.*]] = load %{{.*}}*, %{{.*}}** %{{.*}}, align 4 // CHECK: %[[memptr:.*]] = load { i32, i32, i32 }, { i32, i32, i32 }* %{{.*}}, align 4 // CHECK: %[[memptr0:.*]] = extractvalue { i32, i32, i32 } %[[memptr:.*]], 0 @@ -351,12 +469,12 @@ int loadDataMemberPointerUnspecified(Unspecified *o, int Unspecified::*memptr) { void callMemberPointerSingle(Single *o, void (Single::*memptr)()) { (o->*memptr)(); // Just look for an indirect thiscall. -// CHECK: define void @"\01?callMemberPointerSingle@@{{.*}} {{.*}} { +// CHECK: define dso_local void @"?callMemberPointerSingle@@{{.*}} {{.*}} { // CHECK: call x86_thiscallcc void %{{.*}}(%{{.*}} %{{.*}}) // CHECK: ret void // CHECK: } -// X64-LABEL: define void @"\01?callMemberPointerSingle@@ +// X64-LABEL: define dso_local void @"?callMemberPointerSingle@@ // X64: (%struct.Single* %o, i8* %memptr) // X64: bitcast i8* %{{[^ ]*}} to void (%struct.Single*)* // X64: ret void @@ -364,7 +482,7 @@ void callMemberPointerSingle(Single *o, void (Single::*memptr)()) { void callMemberPointerMultiple(Multiple *o, void (Multiple::*memptr)()) { (o->*memptr)(); -// CHECK: define void @"\01?callMemberPointerMultiple@@{{.*}} { +// CHECK: define dso_local void @"?callMemberPointerMultiple@@{{.*}} { // CHECK: %[[memptr0:.*]] = extractvalue { i8*, i32 } %{{.*}}, 0 // CHECK: %[[memptr1:.*]] = extractvalue { i8*, i32 } %{{.*}}, 1 // CHECK: %[[this_adjusted:.*]] = getelementptr inbounds i8, i8* %{{.*}}, i32 %[[memptr1]] @@ -378,7 +496,7 @@ void callMemberPointerMultiple(Multiple *o, void (Multiple::*memptr)()) { void callMemberPointerVirtualBase(Virtual *o, void (Virtual::*memptr)()) { (o->*memptr)(); // This shares a lot with virtual data member pointers. -// CHECK: define void @"\01?callMemberPointerVirtualBase@@{{.*}} { +// CHECK: define dso_local void @"?callMemberPointerVirtualBase@@{{.*}} { // CHECK: %[[memptr0:.*]] = extractvalue { i8*, i32, i32 } %{{.*}}, 0 // CHECK: %[[memptr1:.*]] = extractvalue { i8*, i32, i32 } %{{.*}}, 1 // CHECK: %[[memptr2:.*]] = extractvalue { i8*, i32, i32 } %{{.*}}, 2 @@ -400,21 +518,21 @@ void callMemberPointerVirtualBase(Virtual *o, void (Virtual::*memptr)()) { bool compareSingleFunctionMemptr(void (Single::*l)(), void (Single::*r)()) { return l == r; // Should only be one comparison here. -// CHECK: define zeroext i1 @"\01?compareSingleFunctionMemptr@@YA_NP8Single@@AEXXZ0@Z"{{.*}} { +// CHECK: define dso_local zeroext i1 @"?compareSingleFunctionMemptr@@YA_NP8Single@@AEXXZ0@Z"{{.*}} { // CHECK-NOT: icmp // CHECK: %[[r:.*]] = icmp eq // CHECK-NOT: icmp // CHECK: ret i1 %[[r]] // CHECK: } -// X64-LABEL: define zeroext i1 @"\01?compareSingleFunctionMemptr@@ +// X64-LABEL: define dso_local zeroext i1 @"?compareSingleFunctionMemptr@@ // X64: (i8* %{{[^,]*}}, i8* %{{[^)]*}}) } bool compareNeqSingleFunctionMemptr(void (Single::*l)(), void (Single::*r)()) { return l != r; // Should only be one comparison here. -// CHECK: define zeroext i1 @"\01?compareNeqSingleFunctionMemptr@@YA_NP8Single@@AEXXZ0@Z"{{.*}} { +// CHECK: define dso_local zeroext i1 @"?compareNeqSingleFunctionMemptr@@YA_NP8Single@@AEXXZ0@Z"{{.*}} { // CHECK-NOT: icmp // CHECK: %[[r:.*]] = icmp ne // CHECK-NOT: icmp @@ -424,7 +542,7 @@ bool compareNeqSingleFunctionMemptr(void (Single::*l)(), void (Single::*r)()) { bool unspecFuncMemptrEq(void (Unspecified::*l)(), void (Unspecified::*r)()) { return l == r; -// CHECK: define zeroext i1 @"\01?unspecFuncMemptrEq@@YA_NP8Unspecified@@AEXXZ0@Z"{{.*}} { +// CHECK: define dso_local zeroext i1 @"?unspecFuncMemptrEq@@YA_NP8Unspecified@@AEXXZ0@Z"{{.*}} { // CHECK: %[[lhs0:.*]] = extractvalue { i8*, i32, i32, i32 } %[[l:.*]], 0 // CHECK: %{{.*}} = extractvalue { i8*, i32, i32, i32 } %[[r:.*]], 0 // CHECK: %[[cmp0:.*]] = icmp eq i8* %[[lhs0]], %{{.*}} @@ -445,13 +563,13 @@ bool unspecFuncMemptrEq(void (Unspecified::*l)(), void (Unspecified::*r)()) { // CHECK: ret i1 %{{.*}} // CHECK: } -// X64-LABEL: define zeroext i1 @"\01?unspecFuncMemptrEq@@ +// X64-LABEL: define dso_local zeroext i1 @"?unspecFuncMemptrEq@@ // X64: ({ i8*, i32, i32, i32 }*, { i8*, i32, i32, i32 }*) } bool unspecFuncMemptrNeq(void (Unspecified::*l)(), void (Unspecified::*r)()) { return l != r; -// CHECK: define zeroext i1 @"\01?unspecFuncMemptrNeq@@YA_NP8Unspecified@@AEXXZ0@Z"{{.*}} { +// CHECK: define dso_local zeroext i1 @"?unspecFuncMemptrNeq@@YA_NP8Unspecified@@AEXXZ0@Z"{{.*}} { // CHECK: %[[lhs0:.*]] = extractvalue { i8*, i32, i32, i32 } %[[l:.*]], 0 // CHECK: %{{.*}} = extractvalue { i8*, i32, i32, i32 } %[[r:.*]], 0 // CHECK: %[[cmp0:.*]] = icmp ne i8* %[[lhs0]], %{{.*}} @@ -475,7 +593,7 @@ bool unspecFuncMemptrNeq(void (Unspecified::*l)(), void (Unspecified::*r)()) { bool unspecDataMemptrEq(int Unspecified::*l, int Unspecified::*r) { return l == r; -// CHECK: define zeroext i1 @"\01?unspecDataMemptrEq@@YA_NPQUnspecified@@H0@Z"{{.*}} { +// CHECK: define dso_local zeroext i1 @"?unspecDataMemptrEq@@YA_NPQUnspecified@@H0@Z"{{.*}} { // CHECK: extractvalue { i32, i32, i32 } %{{.*}}, 0 // CHECK: extractvalue { i32, i32, i32 } %{{.*}}, 0 // CHECK: icmp eq i32 @@ -490,13 +608,13 @@ bool unspecDataMemptrEq(int Unspecified::*l, int Unspecified::*r) { // CHECK: ret i1 // CHECK: } -// X64-LABEL: define zeroext i1 @"\01?unspecDataMemptrEq@@ +// X64-LABEL: define dso_local zeroext i1 @"?unspecDataMemptrEq@@ // X64: ({ i32, i32, i32 }*, { i32, i32, i32 }*) } void (Multiple::*convertB2FuncToMultiple(void (B2::*mp)()))() { return mp; -// CHECK: define i64 @"\01?convertB2FuncToMultiple@@YAP8Multiple@@AEXXZP8B2@@AEXXZ@Z"{{.*}} { +// CHECK: define dso_local i64 @"?convertB2FuncToMultiple@@YAP8Multiple@@AEXXZP8B2@@AEXXZ@Z"{{.*}} { // CHECK: store // CHECK: %[[mp:.*]] = load i8*, i8** %{{.*}}, align 4 // CHECK: icmp ne i8* %[[mp]], null @@ -520,7 +638,7 @@ void (B2::*convertMultipleFuncToB2(void (Multiple::*mp)()))() { // LLVM from optimizing away the branch. This is likely a bug in // lib/CodeGen/TargetInfo.cpp with how we classify memptr types for returns. // -// CHECK: define i32 @"\01?convertMultipleFuncToB2@@YAP8B2@@AEXXZP8Multiple@@AEXXZ@Z"{{.*}} { +// CHECK: define dso_local i32 @"?convertMultipleFuncToB2@@YAP8B2@@AEXXZP8Multiple@@AEXXZ@Z"{{.*}} { // CHECK: store // CHECK: %[[src:.*]] = load { i8*, i32 }, { i8*, i32 }* %{{.*}}, align 4 // CHECK: extractvalue { i8*, i32 } %[[src]], 0 @@ -545,7 +663,7 @@ struct D : B, C { int d; }; void (D::*convertCToD(void (C::*mp)()))() { return mp; -// CHECK: define void @"\01?convertCToD@Test1@@YAP8D@1@AEXXZP8C@1@AEXXZ@Z"{{.*}} { +// CHECK: define dso_local void @"?convertCToD@Test1@@YAP8D@1@AEXXZP8C@1@AEXXZ@Z"{{.*}} { // CHECK: store // CHECK: load { i8*, i32, i32 }, { i8*, i32, i32 }* %{{.*}}, align 4 // CHECK: extractvalue { i8*, i32, i32 } %{{.*}}, 0 @@ -585,7 +703,7 @@ struct C : A { int A::*reinterpret(int B::*mp) { return reinterpret_cast<int A::*>(mp); -// CHECK: define i32 @"\01?reinterpret@Test2@@YAPQA@1@HPQB@1@H@Z"{{.*}} { +// CHECK: define dso_local i32 @"?reinterpret@Test2@@YAPQA@1@HPQB@1@H@Z"{{.*}} { // CHECK-NOT: select // CHECK: ret i32 // CHECK: } @@ -593,7 +711,7 @@ int A::*reinterpret(int B::*mp) { int A::*reinterpret(int C::*mp) { return reinterpret_cast<int A::*>(mp); -// CHECK: define i32 @"\01?reinterpret@Test2@@YAPQA@1@HPQC@1@H@Z"{{.*}} { +// CHECK: define dso_local i32 @"?reinterpret@Test2@@YAPQA@1@HPQC@1@H@Z"{{.*}} { // CHECK: %[[mp:.*]] = load i32, i32* // CHECK: %[[cmp:.*]] = icmp ne i32 %[[mp]], 0 // CHECK: select i1 %[[cmp]], i32 %[[mp]], i32 -1 @@ -612,7 +730,7 @@ struct A { int *load_data(A *a, int A::*mp) { return &(a->*mp); -// CHECK-LABEL: define i32* @"\01?load_data@Test3@@YAPAHPAUA@1@PQ21@H@Z"{{.*}} { +// CHECK-LABEL: define dso_local i32* @"?load_data@Test3@@YAPAHPAUA@1@PQ21@H@Z"{{.*}} { // CHECK: %[[a:.*]] = load %"struct.Test3::A"*, %"struct.Test3::A"** %{{.*}}, align 4 // CHECK: %[[mp:.*]] = load i32, i32* %{{.*}}, align 4 // CHECK: %[[a_i8:.*]] = bitcast %"struct.Test3::A"* %[[a]] to i8* @@ -631,11 +749,11 @@ struct C : A, B { virtual void g(); }; void (C::*getmp())() { return &C::g; } -// CHECK-LABEL: define i64 @"\01?getmp@Test4@@YAP8C@1@AEXXZXZ"() -// CHECK: store { i8*, i32 } { i8* bitcast (void (%"struct.Test4::C"*, ...)* @"\01??_9C@Test4@@$BA@AE" to i8*), i32 4 }, { i8*, i32 }* %{{.*}} +// CHECK-LABEL: define dso_local i64 @"?getmp@Test4@@YAP8C@1@AEXXZXZ"() +// CHECK: store { i8*, i32 } { i8* bitcast (void (%"struct.Test4::C"*, ...)* @"??_9C@Test4@@$BA@AE" to i8*), i32 4 }, { i8*, i32 }* %{{.*}} // -// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @"\01??_9C@Test4@@$BA@AE"(%"struct.Test4::C"* %this, ...) {{.*}} comdat +// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @"??_9C@Test4@@$BA@AE"(%"struct.Test4::C"* %this, ...) {{.*}} comdat // CHECK-NOT: getelementptr // CHECK: load void (%"struct.Test4::C"*, ...)**, void (%"struct.Test4::C"*, ...)*** %{{.*}} // CHECK: getelementptr inbounds void (%"struct.Test4::C"*, ...)*, void (%"struct.Test4::C"*, ...)** %{{.*}}, i64 0 @@ -651,8 +769,8 @@ struct A { }; struct B : public A {}; void test() { void (B::*a)() = &B::f; } -// CHECK-LABEL: define void @"\01?test@pr20007@@YAXXZ" -// CHECK: store i8* bitcast (void (%"struct.pr20007::A"*)* @"\01?f@A@pr20007@@QAEXXZ" to i8*) +// CHECK-LABEL: define dso_local void @"?test@pr20007@@YAXXZ" +// CHECK: store i8* bitcast (void (%"struct.pr20007::A"*)* @"?f@A@pr20007@@QAEXXZ" to i8*) } namespace pr20007_kw { @@ -663,8 +781,8 @@ struct A { struct __single_inheritance B; struct B : public A {}; void test() { void (B::*a)() = &B::f; } -// CHECK-LABEL: define void @"\01?test@pr20007_kw@@YAXXZ" -// CHECK: store i8* bitcast (void (%"struct.pr20007_kw::A"*)* @"\01?f@A@pr20007_kw@@QAEXXZ" to i8*) +// CHECK-LABEL: define dso_local void @"?test@pr20007_kw@@YAXXZ" +// CHECK: store i8* bitcast (void (%"struct.pr20007_kw::A"*)* @"?f@A@pr20007_kw@@QAEXXZ" to i8*) } namespace pr20007_pragma { @@ -678,7 +796,7 @@ void test() { (void)(void (B::*)()) &B::f; } static_assert(sizeof(int B::*) == 4, ""); static_assert(sizeof(int A::*) == 4, ""); #pragma pointers_to_members(best_case) -// CHECK-LABEL: define void @"\01?test@pr20007_pragma@@YAXXZ" +// CHECK-LABEL: define dso_local void @"?test@pr20007_pragma@@YAXXZ" } namespace pr20007_pragma2 { @@ -692,7 +810,7 @@ void test() { (void)&B::f; } static_assert(sizeof(int B::*) == 4, ""); static_assert(sizeof(int A::*) == 12, ""); #pragma pointers_to_members(best_case) -// CHECK-LABEL: define void @"\01?test@pr20007_pragma2@@YAXXZ" +// CHECK-LABEL: define dso_local void @"?test@pr20007_pragma2@@YAXXZ" } namespace pr23823 { @@ -738,8 +856,8 @@ struct D : A, C {}; typedef void (D::*DMemPtrTy)(); -// CHECK-LABEL: define void @"\01?get_memptr@pr23878@@YAP8D@1@AEXXZXZ" -// CHECK: @"\01??_9C@pr23878@@$BA@AE" to i8*), i32 0, i32 4 +// CHECK-LABEL: define dso_local void @"?get_memptr@pr23878@@YAP8D@1@AEXXZXZ" +// CHECK: @"??_9C@pr23878@@$BA@AE" to i8*), i32 0, i32 4 DMemPtrTy get_memptr() { return &D::f; } } @@ -755,14 +873,14 @@ public: // CHECK-LABEL: foo_fun void foo_fun() { - // CHECK: store i8* bitcast (void (%class.CA*)* @"\01?OnHelp@CA@@QAEXXZ" to i8*), i8** + // CHECK: store i8* bitcast (void (%class.CA*)* @"?OnHelp@CA@@QAEXXZ" to i8*), i8** f func = (f)&CA::OnHelp; } namespace PR24703 { struct S; void f(int S::*&p) {} -// CHECK-LABEL: define void @"\01?f@PR24703@@YAXAAPQS@1@H@Z"( +// CHECK-LABEL: define dso_local void @"?f@PR24703@@YAXAAPQS@1@H@Z"( } namespace ReferenceToMPTWithIncompleteClass { @@ -771,14 +889,14 @@ struct J; struct K; extern K *k; -// CHECK-LABEL: @"\01?f@ReferenceToMPTWithIncompleteClass@@YAIAAPQS@1@H@Z"( +// CHECK-LABEL: @"?f@ReferenceToMPTWithIncompleteClass@@YAIAAPQS@1@H@Z"( // CHECK: ret i32 12 unsigned f(int S::*&p) { return sizeof p; } -// CHECK-LABEL: @"\01?g@ReferenceToMPTWithIncompleteClass@@YA_NAAPQJ@1@H0@Z"( +// CHECK-LABEL: @"?g@ReferenceToMPTWithIncompleteClass@@YA_NAAPQJ@1@H0@Z"( bool g(int J::*&p, int J::*&q) { return p == q; } -// CHECK-LABEL: @"\01?h@ReferenceToMPTWithIncompleteClass@@YAHAAPQK@1@H@Z"( +// CHECK-LABEL: @"?h@ReferenceToMPTWithIncompleteClass@@YAHAAPQK@1@H@Z"( int h(int K::*&p) { return k->*p; } } @@ -790,5 +908,5 @@ class A { void printd(); }; void A::printd() { JSMethod<A, &A::printd>(); } -// CHECK-LABEL: @"\01??$JSMethod@VA@PMFInTemplateArgument@@$1?printd@12@AAEHH@Z@PMFInTemplateArgument@@YAXXZ"( +// CHECK-LABEL: @"??$JSMethod@VA@PMFInTemplateArgument@@$1?printd@12@AAEHH@Z@PMFInTemplateArgument@@YAXXZ"( } diff --git a/test/CodeGenCXX/microsoft-abi-methods.cpp b/test/CodeGenCXX/microsoft-abi-methods.cpp index e58d1033e12e2..f4186a20ec529 100644 --- a/test/CodeGenCXX/microsoft-abi-methods.cpp +++ b/test/CodeGenCXX/microsoft-abi-methods.cpp @@ -18,11 +18,11 @@ void call_simple_method() { instance.simple_method(); // Make sure that the call uses the right calling convention: -// CHECK: call x86_thiscallcc void @"\01?simple_method@C@@QAEXXZ" +// CHECK: call x86_thiscallcc void @"?simple_method@C@@QAEXXZ" // CHECK: ret // Make sure that the definition uses the right calling convention: -// CHECK: define linkonce_odr x86_thiscallcc void @"\01?simple_method@C@@QAEXXZ" +// CHECK: define linkonce_odr dso_local x86_thiscallcc void @"?simple_method@C@@QAEXXZ" // CHECK: ret } @@ -30,11 +30,11 @@ void call_cdecl_method() { C instance; instance.cdecl_method(); // Make sure that the call uses the right calling convention: -// CHECK: call void @"\01?cdecl_method@C@@QAAXXZ" +// CHECK: call void @"?cdecl_method@C@@QAAXXZ" // CHECK: ret // Make sure that the definition uses the right calling convention: -// CHECK: define linkonce_odr void @"\01?cdecl_method@C@@QAAXXZ" +// CHECK: define linkonce_odr dso_local void @"?cdecl_method@C@@QAAXXZ" // CHECK: ret } @@ -42,21 +42,21 @@ void call_vararg_method() { C instance; instance.vararg_method("Hello"); // Make sure that the call uses the right calling convention: -// CHECK: call void (%class.C*, i8*, ...) @"\01?vararg_method@C@@QAAXPBDZZ" +// CHECK: call void (%class.C*, i8*, ...) @"?vararg_method@C@@QAAXPBDZZ" // CHECK: ret // Make sure that the definition uses the right calling convention: -// CHECK: define linkonce_odr void @"\01?vararg_method@C@@QAAXPBDZZ" +// CHECK: define linkonce_odr dso_local void @"?vararg_method@C@@QAAXPBDZZ" } void call_static_method() { C::static_method(); // Make sure that the call uses the right calling convention: -// CHECK: call void @"\01?static_method@C@@SAXXZ" +// CHECK: call void @"?static_method@C@@SAXXZ" // CHECK: ret // Make sure that the definition uses the right calling convention: -// CHECK: define linkonce_odr void @"\01?static_method@C@@SAXXZ" +// CHECK: define linkonce_odr dso_local void @"?static_method@C@@SAXXZ" } class Base { @@ -71,19 +71,19 @@ void constructors() { Child c; // Make sure that the Base constructor call in the Child constructor uses // the right calling convention: -// CHECK: define linkonce_odr x86_thiscallcc %class.Child* @"\01??0Child@@QAE@XZ" -// CHECK: %{{[.0-9A-Z_a-z]+}} = call x86_thiscallcc %class.Base* @"\01??0Base@@QAE@XZ" +// CHECK: define linkonce_odr dso_local x86_thiscallcc %class.Child* @"??0Child@@QAE@XZ" +// CHECK: %{{[.0-9A-Z_a-z]+}} = call x86_thiscallcc %class.Base* @"??0Base@@QAE@XZ" // CHECK: ret -// Make sure that the Base constructor definition uses the right CC: -// CHECK: define linkonce_odr x86_thiscallcc %class.Base* @"\01??0Base@@QAE@XZ" - // Make sure that the Base destructor call in the Child denstructor uses // the right calling convention: -// CHECK: define linkonce_odr x86_thiscallcc void @"\01??1Child@@QAE@XZ" -// CHECK: call x86_thiscallcc void @"\01??1Base@@QAE@XZ" +// CHECK: define linkonce_odr dso_local x86_thiscallcc void @"??1Child@@QAE@XZ" +// CHECK: call x86_thiscallcc void @"??1Base@@QAE@XZ" // CHECK: ret +// Make sure that the Base constructor definition uses the right CC: +// CHECK: define linkonce_odr dso_local x86_thiscallcc %class.Base* @"??0Base@@QAE@XZ" + // Make sure that the Base destructor definition uses the right CC: -// CHECK: define linkonce_odr x86_thiscallcc void @"\01??1Base@@QAE@XZ" +// CHECK: define linkonce_odr dso_local x86_thiscallcc void @"??1Base@@QAE@XZ" } diff --git a/test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp b/test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp index 5bed69ff117f1..cefbdafe5fc02 100644 --- a/test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp +++ b/test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp @@ -19,7 +19,7 @@ struct ChildOverride : Left, Right { extern "C" void foo(void *); void call_left_no_override(ChildNoOverride *child) { -// CHECK-LABEL: define void @"\01?call_left_no_override +// CHECK-LABEL: define dso_local void @"?call_left_no_override // CHECK: %[[CHILD:.*]] = load %struct.ChildNoOverride child->left(); @@ -34,7 +34,7 @@ void call_left_no_override(ChildNoOverride *child) { } void ChildOverride::left() { -// CHECK-LABEL: define x86_thiscallcc void @"\01?left@ChildOverride@@UAEXXZ" +// CHECK-LABEL: define dso_local x86_thiscallcc void @"?left@ChildOverride@@UAEXXZ" // CHECK-SAME: (%struct.ChildOverride* %[[THIS:.*]]) // // No need to adjust 'this' as the ChildOverride's layout begins with Left. @@ -49,7 +49,7 @@ void ChildOverride::left() { } void call_left_override(ChildOverride *child) { -// CHECK-LABEL: define void @"\01?call_left_override +// CHECK-LABEL: define dso_local void @"?call_left_override // CHECK: %[[CHILD:.*]] = load %struct.ChildOverride child->left(); @@ -63,7 +63,7 @@ void call_left_override(ChildOverride *child) { } void call_right_no_override(ChildNoOverride *child) { -// CHECK-LABEL: define void @"\01?call_right_no_override +// CHECK-LABEL: define dso_local void @"?call_right_no_override // CHECK: %[[CHILD:.*]] = load %struct.ChildNoOverride child->right(); @@ -83,13 +83,16 @@ void call_right_no_override(ChildNoOverride *child) { } void ChildOverride::right() { -// CHECK-LABEL: define x86_thiscallcc void @"\01?right@ChildOverride@@UAEXXZ"(i8* +// CHECK-LABEL: define dso_local x86_thiscallcc void @"?right@ChildOverride@@UAEXXZ"(i8* // // ChildOverride::right gets 'this' cast to Right* in ECX (i.e. this+4) so we // need to adjust 'this' before use. // +// CHECK: %[[THIS_STORE:.*]] = alloca %struct.ChildOverride*, align 4 // CHECK: %[[THIS_ADDR:.*]] = alloca %struct.ChildOverride*, align 4 -// CHECK: %[[THIS_INIT:.*]] = bitcast i8* %[[ECX:.*]] to %struct.ChildOverride* +// CHECK: %[[COERCE_VAL:.*]] = bitcast i8* %[[ECX:.*]] to %struct.ChildOverride* +// CHECK: store %struct.ChildOverride* %[[COERCE_VAL]], %struct.ChildOverride** %[[THIS_STORE]], align 4 +// CHECK: %[[THIS_INIT:.*]] = load %struct.ChildOverride*, %struct.ChildOverride** %[[THIS_STORE]], align 4 // CHECK: store %struct.ChildOverride* %[[THIS_INIT]], %struct.ChildOverride** %[[THIS_ADDR]], align 4 // CHECK: %[[THIS_RELOAD:.*]] = load %struct.ChildOverride*, %struct.ChildOverride** %[[THIS_ADDR]] // CHECK: %[[THIS_i8:.*]] = bitcast %struct.ChildOverride* %[[THIS_RELOAD]] to i8* @@ -103,7 +106,7 @@ void ChildOverride::right() { } void call_right_override(ChildOverride *child) { -// CHECK-LABEL: define void @"\01?call_right_override +// CHECK-LABEL: define dso_local void @"?call_right_override // CHECK: %[[CHILD:.*]] = load %struct.ChildOverride child->right(); @@ -111,16 +114,15 @@ void call_right_override(ChildOverride *child) { // the caller site. // // CHECK: %[[CHILD_i8:.*]] = bitcast %struct.ChildOverride* %[[CHILD]] to i8* +// CHECK: %[[RIGHT:.*]] = getelementptr inbounds i8, i8* %[[CHILD_i8]], i32 4 // +// CHECK: %[[CHILD_i8:.*]] = bitcast %struct.ChildOverride* %[[CHILD]] to i8* // CHECK: %[[VFPTR_i8:.*]] = getelementptr inbounds i8, i8* %[[CHILD_i8]], i32 4 // CHECK: %[[VFPTR:.*]] = bitcast i8* %[[VFPTR_i8]] to void (i8*)*** // CHECK: %[[VFTABLE:.*]] = load void (i8*)**, void (i8*)*** %[[VFPTR]] // CHECK: %[[VFUN:.*]] = getelementptr inbounds void (i8*)*, void (i8*)** %[[VFTABLE]], i64 0 // CHECK: %[[VFUN_VALUE:.*]] = load void (i8*)*, void (i8*)** %[[VFUN]] // -// CHECK: %[[CHILD_i8:.*]] = bitcast %struct.ChildOverride* %[[CHILD]] to i8* -// CHECK: %[[RIGHT:.*]] = getelementptr inbounds i8, i8* %[[CHILD_i8]], i32 4 -// // CHECK: call x86_thiscallcc void %[[VFUN_VALUE]](i8* %[[RIGHT]]) // CHECK: ret } @@ -130,10 +132,13 @@ struct GrandchildOverride : ChildOverride { }; void GrandchildOverride::right() { -// CHECK-LABEL: define x86_thiscallcc void @"\01?right@GrandchildOverride@@UAEXXZ"(i8* +// CHECK-LABEL: define dso_local x86_thiscallcc void @"?right@GrandchildOverride@@UAEXXZ"(i8* // +// CHECK: %[[THIS_STORE:.*]] = alloca %struct.GrandchildOverride*, align 4 // CHECK: %[[THIS_ADDR:.*]] = alloca %struct.GrandchildOverride*, align 4 -// CHECK: %[[THIS_INIT:.*]] = bitcast i8* %[[ECX:.*]] to %struct.GrandchildOverride* +// CHECK: %[[COERCE_VAL:.*]] = bitcast i8* %[[ECX:.*]] to %struct.GrandchildOverride* +// CHECK: store %struct.GrandchildOverride* %[[COERCE_VAL]], %struct.GrandchildOverride** %[[THIS_STORE]], align 4 +// CHECK: %[[THIS_INIT:.*]] = load %struct.GrandchildOverride*, %struct.GrandchildOverride** %[[THIS_STORE]], align 4 // CHECK: store %struct.GrandchildOverride* %[[THIS_INIT]], %struct.GrandchildOverride** %[[THIS_ADDR]], align 4 // CHECK: %[[THIS_RELOAD:.*]] = load %struct.GrandchildOverride*, %struct.GrandchildOverride** %[[THIS_ADDR]] // CHECK: %[[THIS_i8:.*]] = bitcast %struct.GrandchildOverride* %[[THIS_RELOAD]] to i8* @@ -153,37 +158,37 @@ void call_grandchild_right(GrandchildOverride *obj) { void emit_ctors() { Left l; - // CHECK-LABEL: define {{.*}} @"\01??0Left@@QAE@XZ" + // CHECK-LABEL: define {{.*}} @"??0Left@@QAE@XZ" // CHECK-NOT: getelementptr - // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"\01??_7Left@@6B@" to i32 (...)**) + // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"??_7Left@@6B@" to i32 (...)**) // CHECK: ret Right r; - // CHECK-LABEL: define {{.*}} @"\01??0Right@@QAE@XZ" + // CHECK-LABEL: define {{.*}} @"??0Right@@QAE@XZ" // CHECK-NOT: getelementptr - // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"\01??_7Right@@6B@" to i32 (...)**) + // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"??_7Right@@6B@" to i32 (...)**) // CHECK: ret ChildOverride co; - // CHECK-LABEL: define {{.*}} @"\01??0ChildOverride@@QAE@XZ" + // CHECK-LABEL: define {{.*}} @"??0ChildOverride@@QAE@XZ" // CHECK: %[[THIS:.*]] = load %struct.ChildOverride*, %struct.ChildOverride** // CHECK: %[[VFPTR:.*]] = bitcast %struct.ChildOverride* %[[THIS]] to i32 (...)*** - // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"\01??_7ChildOverride@@6BLeft@@@" to i32 (...)**), i32 (...)*** %[[VFPTR]] + // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"??_7ChildOverride@@6BLeft@@@" to i32 (...)**), i32 (...)*** %[[VFPTR]] // CHECK: %[[THIS_i8:.*]] = bitcast %struct.ChildOverride* %[[THIS]] to i8* // CHECK: %[[VFPTR_i8:.*]] = getelementptr inbounds i8, i8* %[[THIS_i8]], i32 4 // CHECK: %[[VFPTR:.*]] = bitcast i8* %[[VFPTR_i8]] to i32 (...)*** - // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"\01??_7ChildOverride@@6BRight@@@" to i32 (...)**), i32 (...)*** %[[VFPTR]] + // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"??_7ChildOverride@@6BRight@@@" to i32 (...)**), i32 (...)*** %[[VFPTR]] // CHECK: ret GrandchildOverride gc; - // CHECK-LABEL: define {{.*}} @"\01??0GrandchildOverride@@QAE@XZ" + // CHECK-LABEL: define {{.*}} @"??0GrandchildOverride@@QAE@XZ" // CHECK: %[[THIS:.*]] = load %struct.GrandchildOverride*, %struct.GrandchildOverride** // CHECK: %[[VFPTR:.*]] = bitcast %struct.GrandchildOverride* %[[THIS]] to i32 (...)*** - // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"\01??_7GrandchildOverride@@6BLeft@@@" to i32 (...)**), i32 (...)*** %[[VFPTR]] + // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"??_7GrandchildOverride@@6BLeft@@@" to i32 (...)**), i32 (...)*** %[[VFPTR]] // CHECK: %[[THIS_i8:.*]] = bitcast %struct.GrandchildOverride* %[[THIS]] to i8* // CHECK: %[[VFPTR_i8:.*]] = getelementptr inbounds i8, i8* %[[THIS_i8]], i32 4 // CHECK: %[[VFPTR:.*]] = bitcast i8* %[[VFPTR_i8]] to i32 (...)*** - // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"\01??_7GrandchildOverride@@6BRight@@@" to i32 (...)**), i32 (...)*** %[[VFPTR]] + // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"??_7GrandchildOverride@@6BRight@@@" to i32 (...)**), i32 (...)*** %[[VFPTR]] // CHECK: ret } @@ -197,10 +202,10 @@ struct AsymmetricChild : LeftWithNonVirtualDtor, Right { }; void call_asymmetric_child_complete_dtor() { - // CHECK-LABEL: define void @"\01?call_asymmetric_child_complete_dtor@@YAXXZ" + // CHECK-LABEL: define dso_local void @"?call_asymmetric_child_complete_dtor@@YAXXZ" AsymmetricChild obj; - // CHECK: call x86_thiscallcc %struct.AsymmetricChild* @"\01??0AsymmetricChild@@QAE@XZ"(%struct.AsymmetricChild* %[[OBJ:.*]]) + // CHECK: call x86_thiscallcc %struct.AsymmetricChild* @"??0AsymmetricChild@@QAE@XZ"(%struct.AsymmetricChild* %[[OBJ:.*]]) // CHECK-NOT: getelementptr - // CHECK: call x86_thiscallcc void @"\01??1AsymmetricChild@@UAE@XZ"(%struct.AsymmetricChild* %[[OBJ]]) + // CHECK: call x86_thiscallcc void @"??1AsymmetricChild@@UAE@XZ"(%struct.AsymmetricChild* %[[OBJ]]) // CHECK: ret } diff --git a/test/CodeGenCXX/microsoft-abi-rtti.cpp b/test/CodeGenCXX/microsoft-abi-rtti.cpp index 5738b606c111a..a9ec5f3c9d687 100644 --- a/test/CodeGenCXX/microsoft-abi-rtti.cpp +++ b/test/CodeGenCXX/microsoft-abi-rtti.cpp @@ -26,242 +26,242 @@ struct Y2 { virtual void f() {} }; struct A2 : Z2, Y2 {}; struct B2 : virtual A2 { B2() {} virtual void f() {} } b2; -// CHECK-DAG: @"\01??_R4B2@@6BZ2@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 8, i32 4, i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUB2@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"\01??_R3B2@@8" }, comdat -// CHECK-DAG: @"\01??_R0?AUB2@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"\01??_7type_info@@6B@", i8* null, [9 x i8] c".?AUB2@@\00" }, comdat -// CHECK-DAG: @"\01??_R3B2@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 3, i32 4, %rtti.BaseClassDescriptor** getelementptr inbounds ([5 x %rtti.BaseClassDescriptor*], [5 x %rtti.BaseClassDescriptor*]* @"\01??_R2B2@@8", i32 0, i32 0) }, comdat -// CHECK-DAG: @"\01??_R2B2@@8" = linkonce_odr constant [5 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@B2@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@A@3FA@A2@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@A@3EA@Z2@@8", %rtti.BaseClassDescriptor* @"\01??_R13A@3EA@Y2@@8", %rtti.BaseClassDescriptor* null], comdat -// CHECK-DAG: @"\01??_R1A@?0A@EA@B2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUB2@@@8" to i8*), i32 3, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3B2@@8" }, comdat -// CHECK-DAG: @"\01??_R1A@A@3FA@A2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUA2@@@8" to i8*), i32 2, i32 0, i32 0, i32 4, i32 80, %rtti.ClassHierarchyDescriptor* @"\01??_R3A2@@8" }, comdat -// CHECK-DAG: @"\01??_R0?AUA2@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"\01??_7type_info@@6B@", i8* null, [9 x i8] c".?AUA2@@\00" }, comdat -// CHECK-DAG: @"\01??_R3A2@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 1, i32 3, %rtti.BaseClassDescriptor** getelementptr inbounds ([4 x %rtti.BaseClassDescriptor*], [4 x %rtti.BaseClassDescriptor*]* @"\01??_R2A2@@8", i32 0, i32 0) }, comdat -// CHECK-DAG: @"\01??_R2A2@@8" = linkonce_odr constant [4 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@A2@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@Z2@@8", %rtti.BaseClassDescriptor* @"\01??_R13?0A@EA@Y2@@8", %rtti.BaseClassDescriptor* null], comdat -// CHECK-DAG: @"\01??_R1A@?0A@EA@A2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUA2@@@8" to i8*), i32 2, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3A2@@8" }, comdat -// CHECK-DAG: @"\01??_R1A@?0A@EA@Z2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUZ2@@@8" to i8*), i32 0, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3Z2@@8" }, comdat -// CHECK-DAG: @"\01??_R0?AUZ2@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"\01??_7type_info@@6B@", i8* null, [9 x i8] c".?AUZ2@@\00" }, comdat -// CHECK-DAG: @"\01??_R3Z2@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, %rtti.BaseClassDescriptor** getelementptr inbounds ([2 x %rtti.BaseClassDescriptor*], [2 x %rtti.BaseClassDescriptor*]* @"\01??_R2Z2@@8", i32 0, i32 0) }, comdat -// CHECK-DAG: @"\01??_R2Z2@@8" = linkonce_odr constant [2 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@Z2@@8", %rtti.BaseClassDescriptor* null], comdat -// CHECK-DAG: @"\01??_R13?0A@EA@Y2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUY2@@@8" to i8*), i32 0, i32 4, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3Y2@@8" }, comdat -// CHECK-DAG: @"\01??_R0?AUY2@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"\01??_7type_info@@6B@", i8* null, [9 x i8] c".?AUY2@@\00" }, comdat -// CHECK-DAG: @"\01??_R3Y2@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, %rtti.BaseClassDescriptor** getelementptr inbounds ([2 x %rtti.BaseClassDescriptor*], [2 x %rtti.BaseClassDescriptor*]* @"\01??_R2Y2@@8", i32 0, i32 0) }, comdat -// CHECK-DAG: @"\01??_R2Y2@@8" = linkonce_odr constant [2 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@Y2@@8", %rtti.BaseClassDescriptor* null], comdat -// CHECK-DAG: @"\01??_R1A@?0A@EA@Y2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUY2@@@8" to i8*), i32 0, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3Y2@@8" }, comdat -// CHECK-DAG: @"\01??_R1A@A@3EA@Z2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUZ2@@@8" to i8*), i32 0, i32 0, i32 0, i32 4, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3Z2@@8" }, comdat -// CHECK-DAG: @"\01??_R13A@3EA@Y2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUY2@@@8" to i8*), i32 0, i32 4, i32 0, i32 4, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3Y2@@8" }, comdat -// CHECK-DAG: @"\01??_R4B2@@6BY2@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 12, i32 8, i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUB2@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"\01??_R3B2@@8" }, comdat -// CHECK-DAG: @"\01??_R4A2@@6BZ2@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUA2@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"\01??_R3A2@@8" }, comdat -// CHECK-DAG: @"\01??_R4A2@@6BY2@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 4, i32 0, i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUA2@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"\01??_R3A2@@8" }, comdat -// CHECK-DAG: @"\01??_R4Y2@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUY2@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"\01??_R3Y2@@8" }, comdat -// CHECK-DAG: @"\01??_R4Z2@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUZ2@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"\01??_R3Z2@@8" }, comdat -// CHECK-DAG: @"\01??_R4B1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 8, i32 4, i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUB1@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"\01??_R3B1@@8" }, comdat -// CHECK-DAG: @"\01??_R0?AUB1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"\01??_7type_info@@6B@", i8* null, [9 x i8] c".?AUB1@@\00" }, comdat -// CHECK-DAG: @"\01??_R3B1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 2, %rtti.BaseClassDescriptor** getelementptr inbounds ([3 x %rtti.BaseClassDescriptor*], [3 x %rtti.BaseClassDescriptor*]* @"\01??_R2B1@@8", i32 0, i32 0) }, comdat -// CHECK-DAG: @"\01??_R2B1@@8" = linkonce_odr constant [3 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@B1@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@A@3FA@A1@@8", %rtti.BaseClassDescriptor* null], comdat -// CHECK-DAG: @"\01??_R1A@?0A@EA@B1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUB1@@@8" to i8*), i32 1, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3B1@@8" }, comdat -// CHECK-DAG: @"\01??_R1A@A@3FA@A1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUA1@@@8" to i8*), i32 0, i32 0, i32 0, i32 4, i32 80, %rtti.ClassHierarchyDescriptor* @"\01??_R3A1@@8" }, comdat -// CHECK-DAG: @"\01??_R0?AUA1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"\01??_7type_info@@6B@", i8* null, [9 x i8] c".?AUA1@@\00" }, comdat -// CHECK-DAG: @"\01??_R3A1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, %rtti.BaseClassDescriptor** getelementptr inbounds ([2 x %rtti.BaseClassDescriptor*], [2 x %rtti.BaseClassDescriptor*]* @"\01??_R2A1@@8", i32 0, i32 0) }, comdat -// CHECK-DAG: @"\01??_R2A1@@8" = linkonce_odr constant [2 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@A1@@8", %rtti.BaseClassDescriptor* null], comdat -// CHECK-DAG: @"\01??_R1A@?0A@EA@A1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUA1@@@8" to i8*), i32 0, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3A1@@8" }, comdat -// CHECK-DAG: @"\01??_R4A1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUA1@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"\01??_R3A1@@8" }, comdat -// CHECK-DAG: @"\01??_R4Y1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 4, i32 0, i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUY1@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"\01??_R3Y1@@8" }, comdat -// CHECK-DAG: @"\01??_R0?AUY1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"\01??_7type_info@@6B@", i8* null, [9 x i8] c".?AUY1@@\00" }, comdat -// CHECK-DAG: @"\01??_R3Y1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 3, i32 6, %rtti.BaseClassDescriptor** getelementptr inbounds ([7 x %rtti.BaseClassDescriptor*], [7 x %rtti.BaseClassDescriptor*]* @"\01??_R2Y1@@8", i32 0, i32 0) }, comdat -// CHECK-DAG: @"\01??_R2Y1@@8" = linkonce_odr constant [7 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@Y1@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@W1@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@A@3FA@V1@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@A@3EA@X1@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@A@3FA@V1@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@A@3EA@X1@@8", %rtti.BaseClassDescriptor* null], comdat -// CHECK-DAG: @"\01??_R1A@?0A@EA@Y1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUY1@@@8" to i8*), i32 5, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3Y1@@8" }, comdat -// CHECK-DAG: @"\01??_R1A@?0A@EA@W1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUW1@@@8" to i8*), i32 2, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3W1@@8" }, comdat -// CHECK-DAG: @"\01??_R0?AUW1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"\01??_7type_info@@6B@", i8* null, [9 x i8] c".?AUW1@@\00" }, comdat -// CHECK-DAG: @"\01??_R3W1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 3, %rtti.BaseClassDescriptor** getelementptr inbounds ([4 x %rtti.BaseClassDescriptor*], [4 x %rtti.BaseClassDescriptor*]* @"\01??_R2W1@@8", i32 0, i32 0) }, comdat -// CHECK-DAG: @"\01??_R2W1@@8" = linkonce_odr constant [4 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@W1@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@A@3FA@V1@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@A@3EA@X1@@8", %rtti.BaseClassDescriptor* null], comdat -// CHECK-DAG: @"\01??_R1A@A@3FA@V1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUV1@@@8" to i8*), i32 1, i32 0, i32 0, i32 4, i32 80, %rtti.ClassHierarchyDescriptor* @"\01??_R3V1@@8" }, comdat -// CHECK-DAG: @"\01??_R0?AUV1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"\01??_7type_info@@6B@", i8* null, [9 x i8] c".?AUV1@@\00" }, comdat -// CHECK-DAG: @"\01??_R3V1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 2, %rtti.BaseClassDescriptor** getelementptr inbounds ([3 x %rtti.BaseClassDescriptor*], [3 x %rtti.BaseClassDescriptor*]* @"\01??_R2V1@@8", i32 0, i32 0) }, comdat -// CHECK-DAG: @"\01??_R2V1@@8" = linkonce_odr constant [3 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@V1@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@X1@@8", %rtti.BaseClassDescriptor* null], comdat -// CHECK-DAG: @"\01??_R1A@?0A@EA@V1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUV1@@@8" to i8*), i32 1, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3V1@@8" }, comdat -// CHECK-DAG: @"\01??_R1A@?0A@EA@X1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUX1@@@8" to i8*), i32 0, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3X1@@8" }, comdat -// CHECK-DAG: @"\01??_R0?AUX1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"\01??_7type_info@@6B@", i8* null, [9 x i8] c".?AUX1@@\00" }, comdat -// CHECK-DAG: @"\01??_R3X1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, %rtti.BaseClassDescriptor** getelementptr inbounds ([2 x %rtti.BaseClassDescriptor*], [2 x %rtti.BaseClassDescriptor*]* @"\01??_R2X1@@8", i32 0, i32 0) }, comdat -// CHECK-DAG: @"\01??_R2X1@@8" = linkonce_odr constant [2 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@X1@@8", %rtti.BaseClassDescriptor* null], comdat -// CHECK-DAG: @"\01??_R1A@A@3EA@X1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUX1@@@8" to i8*), i32 0, i32 0, i32 0, i32 4, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3X1@@8" }, comdat -// CHECK-DAG: @"\01??_R4W1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 4, i32 0, i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUW1@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"\01??_R3W1@@8" }, comdat -// CHECK-DAG: @"\01??_R4V1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUV1@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"\01??_R3V1@@8" }, comdat -// CHECK-DAG: @"\01??_R4X1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor8* @"\01??_R0?AUX1@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"\01??_R3X1@@8" }, comdat -// CHECK-DAG: @"\01??_R4C@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUC@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"\01??_R3C@@8" }, comdat -// CHECK-DAG: @"\01??_R0?AUC@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUC@@\00" }, comdat -// CHECK-DAG: @"\01??_R3C@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 3, %rtti.BaseClassDescriptor** getelementptr inbounds ([4 x %rtti.BaseClassDescriptor*], [4 x %rtti.BaseClassDescriptor*]* @"\01??_R2C@@8", i32 0, i32 0) }, comdat -// CHECK-DAG: @"\01??_R2C@@8" = linkonce_odr constant [4 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@C@@8", %rtti.BaseClassDescriptor* @"\01??_R13?0A@EA@B@@8", %rtti.BaseClassDescriptor* @"\01??_R13?0A@EA@A@@8", %rtti.BaseClassDescriptor* null], comdat -// CHECK-DAG: @"\01??_R1A@?0A@EA@C@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUC@@@8" to i8*), i32 2, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3C@@8" }, comdat -// CHECK-DAG: @"\01??_R13?0A@EA@B@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUB@@@8" to i8*), i32 1, i32 4, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3B@@8" }, comdat -// CHECK-DAG: @"\01??_R0?AUB@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUB@@\00" }, comdat -// CHECK-DAG: @"\01??_R3B@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 2, %rtti.BaseClassDescriptor** getelementptr inbounds ([3 x %rtti.BaseClassDescriptor*], [3 x %rtti.BaseClassDescriptor*]* @"\01??_R2B@@8", i32 0, i32 0) }, comdat -// CHECK-DAG: @"\01??_R2B@@8" = linkonce_odr constant [3 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@B@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@A@@8", %rtti.BaseClassDescriptor* null], comdat -// CHECK-DAG: @"\01??_R1A@?0A@EA@B@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUB@@@8" to i8*), i32 1, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3B@@8" }, comdat -// CHECK-DAG: @"\01??_R1A@?0A@EA@A@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUA@@@8" to i8*), i32 0, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3A@@8" }, comdat -// CHECK-DAG: @"\01??_R0?AUA@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUA@@\00" }, comdat -// CHECK-DAG: @"\01??_R3A@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, %rtti.BaseClassDescriptor** getelementptr inbounds ([2 x %rtti.BaseClassDescriptor*], [2 x %rtti.BaseClassDescriptor*]* @"\01??_R2A@@8", i32 0, i32 0) }, comdat -// CHECK-DAG: @"\01??_R2A@@8" = linkonce_odr constant [2 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@A@@8", %rtti.BaseClassDescriptor* null], comdat -// CHECK-DAG: @"\01??_R13?0A@EA@A@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUA@@@8" to i8*), i32 0, i32 4, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3A@@8" }, comdat -// CHECK-DAG: @"\01??_R4Y@@6BZ@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AVY@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"\01??_R3Y@@8" }, comdat -// CHECK-DAG: @"\01??_R0?AVY@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AVY@@\00" }, comdat -// CHECK-DAG: @"\01??_R3Y@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 3, i32 9, %rtti.BaseClassDescriptor** getelementptr inbounds ([10 x %rtti.BaseClassDescriptor*], [10 x %rtti.BaseClassDescriptor*]* @"\01??_R2Y@@8", i32 0, i32 0) }, comdat -// CHECK-DAG: @"\01??_R2Y@@8" = linkonce_odr constant [10 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@Y@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EN@Z@@8", %rtti.BaseClassDescriptor* @"\01??_R13?0A@EN@W@@8", %rtti.BaseClassDescriptor* @"\01??_R17?0A@EN@M@@8", %rtti.BaseClassDescriptor* @"\01??_R17?0A@EN@N@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@33FN@V@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@33EJ@X@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@33FN@V@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@33EJ@X@@8", %rtti.BaseClassDescriptor* null], comdat -// CHECK-DAG: @"\01??_R1A@?0A@EA@Y@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AVY@@@8" to i8*), i32 8, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3Y@@8" }, comdat -// CHECK-DAG: @"\01??_R1A@?0A@EN@Z@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AVZ@@@8" to i8*), i32 0, i32 0, i32 -1, i32 0, i32 77, %rtti.ClassHierarchyDescriptor* @"\01??_R3Z@@8" }, comdat -// CHECK-DAG: @"\01??_R0?AVZ@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AVZ@@\00" }, comdat -// CHECK-DAG: @"\01??_R3Z@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, %rtti.BaseClassDescriptor** getelementptr inbounds ([2 x %rtti.BaseClassDescriptor*], [2 x %rtti.BaseClassDescriptor*]* @"\01??_R2Z@@8", i32 0, i32 0) }, comdat -// CHECK-DAG: @"\01??_R2Z@@8" = linkonce_odr constant [2 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@Z@@8", %rtti.BaseClassDescriptor* null], comdat -// CHECK-DAG: @"\01??_R1A@?0A@EA@Z@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AVZ@@@8" to i8*), i32 0, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3Z@@8" }, comdat -// CHECK-DAG: @"\01??_R13?0A@EN@W@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AVW@@@8" to i8*), i32 4, i32 4, i32 -1, i32 0, i32 77, %rtti.ClassHierarchyDescriptor* @"\01??_R3W@@8" }, comdat -// CHECK-DAG: @"\01??_R0?AVW@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AVW@@\00" }, comdat -// CHECK-DAG: @"\01??_R3W@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 3, i32 5, %rtti.BaseClassDescriptor** getelementptr inbounds ([6 x %rtti.BaseClassDescriptor*], [6 x %rtti.BaseClassDescriptor*]* @"\01??_R2W@@8", i32 0, i32 0) }, comdat -// CHECK-DAG: @"\01??_R2W@@8" = linkonce_odr constant [6 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@W@@8", %rtti.BaseClassDescriptor* @"\01??_R13?0A@EN@M@@8", %rtti.BaseClassDescriptor* @"\01??_R13?0A@EN@N@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@A@3FN@V@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@A@3EJ@X@@8", %rtti.BaseClassDescriptor* null], comdat -// CHECK-DAG: @"\01??_R1A@?0A@EA@W@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AVW@@@8" to i8*), i32 4, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3W@@8" }, comdat -// CHECK-DAG: @"\01??_R13?0A@EN@M@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUM@@@8" to i8*), i32 1, i32 4, i32 -1, i32 0, i32 77, %rtti.ClassHierarchyDescriptor* @"\01??_R3M@@8" }, comdat -// CHECK-DAG: @"\01??_R0?AUM@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUM@@\00" }, comdat -// CHECK-DAG: @"\01??_R3M@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 2, %rtti.BaseClassDescriptor** getelementptr inbounds ([3 x %rtti.BaseClassDescriptor*], [3 x %rtti.BaseClassDescriptor*]* @"\01??_R2M@@8", i32 0, i32 0) }, comdat -// CHECK-DAG: @"\01??_R2M@@8" = linkonce_odr constant [3 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@M@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EN@N@@8", %rtti.BaseClassDescriptor* null], comdat -// CHECK-DAG: @"\01??_R1A@?0A@EA@M@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUM@@@8" to i8*), i32 1, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3M@@8" }, comdat -// CHECK-DAG: @"\01??_R1A@?0A@EN@N@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUN@@@8" to i8*), i32 0, i32 0, i32 -1, i32 0, i32 77, %rtti.ClassHierarchyDescriptor* @"\01??_R3N@@8" }, comdat -// CHECK-DAG: @"\01??_R0?AUN@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUN@@\00" }, comdat -// CHECK-DAG: @"\01??_R3N@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, %rtti.BaseClassDescriptor** getelementptr inbounds ([2 x %rtti.BaseClassDescriptor*], [2 x %rtti.BaseClassDescriptor*]* @"\01??_R2N@@8", i32 0, i32 0) }, comdat -// CHECK-DAG: @"\01??_R2N@@8" = linkonce_odr constant [2 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@N@@8", %rtti.BaseClassDescriptor* null], comdat -// CHECK-DAG: @"\01??_R1A@?0A@EA@N@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUN@@@8" to i8*), i32 0, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3N@@8" }, comdat -// CHECK-DAG: @"\01??_R13?0A@EN@N@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUN@@@8" to i8*), i32 0, i32 4, i32 -1, i32 0, i32 77, %rtti.ClassHierarchyDescriptor* @"\01??_R3N@@8" }, comdat -// CHECK-DAG: @"\01??_R1A@A@3FN@V@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AVV@@@8" to i8*), i32 1, i32 0, i32 0, i32 4, i32 93, %rtti.ClassHierarchyDescriptor* @"\01??_R3V@@8" }, comdat -// CHECK-DAG: @"\01??_R0?AVV@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AVV@@\00" }, comdat -// CHECK-DAG: @"\01??_R3V@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 2, %rtti.BaseClassDescriptor** getelementptr inbounds ([3 x %rtti.BaseClassDescriptor*], [3 x %rtti.BaseClassDescriptor*]* @"\01??_R2V@@8", i32 0, i32 0) }, comdat -// CHECK-DAG: @"\01??_R2V@@8" = linkonce_odr constant [3 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@V@@8", %rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@X@@8", %rtti.BaseClassDescriptor* null], comdat -// CHECK-DAG: @"\01??_R1A@?0A@EA@V@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AVV@@@8" to i8*), i32 1, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3V@@8" }, comdat -// CHECK-DAG: @"\01??_R1A@?0A@EA@X@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUX@@@8" to i8*), i32 0, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"\01??_R3X@@8" }, comdat -// CHECK-DAG: @"\01??_R0?AUX@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUX@@\00" }, comdat -// CHECK-DAG: @"\01??_R3X@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, %rtti.BaseClassDescriptor** getelementptr inbounds ([2 x %rtti.BaseClassDescriptor*], [2 x %rtti.BaseClassDescriptor*]* @"\01??_R2X@@8", i32 0, i32 0) }, comdat -// CHECK-DAG: @"\01??_R2X@@8" = linkonce_odr constant [2 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@X@@8", %rtti.BaseClassDescriptor* null], comdat -// CHECK-DAG: @"\01??_R1A@A@3EJ@X@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUX@@@8" to i8*), i32 0, i32 0, i32 0, i32 4, i32 73, %rtti.ClassHierarchyDescriptor* @"\01??_R3X@@8" }, comdat -// CHECK-DAG: @"\01??_R17?0A@EN@M@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUM@@@8" to i8*), i32 1, i32 8, i32 -1, i32 0, i32 77, %rtti.ClassHierarchyDescriptor* @"\01??_R3M@@8" }, comdat -// CHECK-DAG: @"\01??_R17?0A@EN@N@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUN@@@8" to i8*), i32 0, i32 8, i32 -1, i32 0, i32 77, %rtti.ClassHierarchyDescriptor* @"\01??_R3N@@8" }, comdat -// CHECK-DAG: @"\01??_R1A@33FN@V@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AVV@@@8" to i8*), i32 1, i32 0, i32 4, i32 4, i32 93, %rtti.ClassHierarchyDescriptor* @"\01??_R3V@@8" }, comdat -// CHECK-DAG: @"\01??_R1A@33EJ@X@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUX@@@8" to i8*), i32 0, i32 0, i32 4, i32 4, i32 73, %rtti.ClassHierarchyDescriptor* @"\01??_R3X@@8" }, comdat -// CHECK-DAG: @"\01??_R4Y@@6BW@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 8, i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AVY@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"\01??_R3Y@@8" }, comdat -// CHECK-DAG: @"\01??_R4W@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 4, i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AVW@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"\01??_R3W@@8" }, comdat -// CHECK-DAG: @"\01??_R4Z@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AVZ@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"\01??_R3Z@@8" }, comdat -// CHECK-DAG: @"\01??_R4V@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AVV@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"\01??_R3V@@8" }, comdat -// CHECK-DAG: @"\01??_R4X@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUX@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"\01??_R3X@@8" }, comdat +// CHECK-DAG: @"??_R4B2@@6BZ2@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 8, i32 4, i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUB2@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"??_R3B2@@8" }, comdat +// CHECK-DAG: @"??_R0?AUB2@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"??_7type_info@@6B@", i8* null, [9 x i8] c".?AUB2@@\00" }, comdat +// CHECK-DAG: @"??_R3B2@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 3, i32 4, %rtti.BaseClassDescriptor** getelementptr inbounds ([5 x %rtti.BaseClassDescriptor*], [5 x %rtti.BaseClassDescriptor*]* @"??_R2B2@@8", i32 0, i32 0) }, comdat +// CHECK-DAG: @"??_R2B2@@8" = linkonce_odr constant [5 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@B2@@8", %rtti.BaseClassDescriptor* @"??_R1A@A@3FA@A2@@8", %rtti.BaseClassDescriptor* @"??_R1A@A@3EA@Z2@@8", %rtti.BaseClassDescriptor* @"??_R13A@3EA@Y2@@8", %rtti.BaseClassDescriptor* null], comdat +// CHECK-DAG: @"??_R1A@?0A@EA@B2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUB2@@@8" to i8*), i32 3, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3B2@@8" }, comdat +// CHECK-DAG: @"??_R1A@A@3FA@A2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUA2@@@8" to i8*), i32 2, i32 0, i32 0, i32 4, i32 80, %rtti.ClassHierarchyDescriptor* @"??_R3A2@@8" }, comdat +// CHECK-DAG: @"??_R0?AUA2@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"??_7type_info@@6B@", i8* null, [9 x i8] c".?AUA2@@\00" }, comdat +// CHECK-DAG: @"??_R3A2@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 1, i32 3, %rtti.BaseClassDescriptor** getelementptr inbounds ([4 x %rtti.BaseClassDescriptor*], [4 x %rtti.BaseClassDescriptor*]* @"??_R2A2@@8", i32 0, i32 0) }, comdat +// CHECK-DAG: @"??_R2A2@@8" = linkonce_odr constant [4 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@A2@@8", %rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@Z2@@8", %rtti.BaseClassDescriptor* @"??_R13?0A@EA@Y2@@8", %rtti.BaseClassDescriptor* null], comdat +// CHECK-DAG: @"??_R1A@?0A@EA@A2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUA2@@@8" to i8*), i32 2, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3A2@@8" }, comdat +// CHECK-DAG: @"??_R1A@?0A@EA@Z2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUZ2@@@8" to i8*), i32 0, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3Z2@@8" }, comdat +// CHECK-DAG: @"??_R0?AUZ2@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"??_7type_info@@6B@", i8* null, [9 x i8] c".?AUZ2@@\00" }, comdat +// CHECK-DAG: @"??_R3Z2@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, %rtti.BaseClassDescriptor** getelementptr inbounds ([2 x %rtti.BaseClassDescriptor*], [2 x %rtti.BaseClassDescriptor*]* @"??_R2Z2@@8", i32 0, i32 0) }, comdat +// CHECK-DAG: @"??_R2Z2@@8" = linkonce_odr constant [2 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@Z2@@8", %rtti.BaseClassDescriptor* null], comdat +// CHECK-DAG: @"??_R13?0A@EA@Y2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUY2@@@8" to i8*), i32 0, i32 4, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3Y2@@8" }, comdat +// CHECK-DAG: @"??_R0?AUY2@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"??_7type_info@@6B@", i8* null, [9 x i8] c".?AUY2@@\00" }, comdat +// CHECK-DAG: @"??_R3Y2@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, %rtti.BaseClassDescriptor** getelementptr inbounds ([2 x %rtti.BaseClassDescriptor*], [2 x %rtti.BaseClassDescriptor*]* @"??_R2Y2@@8", i32 0, i32 0) }, comdat +// CHECK-DAG: @"??_R2Y2@@8" = linkonce_odr constant [2 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@Y2@@8", %rtti.BaseClassDescriptor* null], comdat +// CHECK-DAG: @"??_R1A@?0A@EA@Y2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUY2@@@8" to i8*), i32 0, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3Y2@@8" }, comdat +// CHECK-DAG: @"??_R1A@A@3EA@Z2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUZ2@@@8" to i8*), i32 0, i32 0, i32 0, i32 4, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3Z2@@8" }, comdat +// CHECK-DAG: @"??_R13A@3EA@Y2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUY2@@@8" to i8*), i32 0, i32 4, i32 0, i32 4, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3Y2@@8" }, comdat +// CHECK-DAG: @"??_R4B2@@6BY2@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 12, i32 8, i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUB2@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"??_R3B2@@8" }, comdat +// CHECK-DAG: @"??_R4A2@@6BZ2@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUA2@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"??_R3A2@@8" }, comdat +// CHECK-DAG: @"??_R4A2@@6BY2@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 4, i32 0, i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUA2@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"??_R3A2@@8" }, comdat +// CHECK-DAG: @"??_R4Y2@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUY2@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"??_R3Y2@@8" }, comdat +// CHECK-DAG: @"??_R4Z2@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUZ2@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"??_R3Z2@@8" }, comdat +// CHECK-DAG: @"??_R4B1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 8, i32 4, i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUB1@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"??_R3B1@@8" }, comdat +// CHECK-DAG: @"??_R0?AUB1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"??_7type_info@@6B@", i8* null, [9 x i8] c".?AUB1@@\00" }, comdat +// CHECK-DAG: @"??_R3B1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 2, %rtti.BaseClassDescriptor** getelementptr inbounds ([3 x %rtti.BaseClassDescriptor*], [3 x %rtti.BaseClassDescriptor*]* @"??_R2B1@@8", i32 0, i32 0) }, comdat +// CHECK-DAG: @"??_R2B1@@8" = linkonce_odr constant [3 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@B1@@8", %rtti.BaseClassDescriptor* @"??_R1A@A@3FA@A1@@8", %rtti.BaseClassDescriptor* null], comdat +// CHECK-DAG: @"??_R1A@?0A@EA@B1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUB1@@@8" to i8*), i32 1, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3B1@@8" }, comdat +// CHECK-DAG: @"??_R1A@A@3FA@A1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUA1@@@8" to i8*), i32 0, i32 0, i32 0, i32 4, i32 80, %rtti.ClassHierarchyDescriptor* @"??_R3A1@@8" }, comdat +// CHECK-DAG: @"??_R0?AUA1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"??_7type_info@@6B@", i8* null, [9 x i8] c".?AUA1@@\00" }, comdat +// CHECK-DAG: @"??_R3A1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, %rtti.BaseClassDescriptor** getelementptr inbounds ([2 x %rtti.BaseClassDescriptor*], [2 x %rtti.BaseClassDescriptor*]* @"??_R2A1@@8", i32 0, i32 0) }, comdat +// CHECK-DAG: @"??_R2A1@@8" = linkonce_odr constant [2 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@A1@@8", %rtti.BaseClassDescriptor* null], comdat +// CHECK-DAG: @"??_R1A@?0A@EA@A1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUA1@@@8" to i8*), i32 0, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3A1@@8" }, comdat +// CHECK-DAG: @"??_R4A1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUA1@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"??_R3A1@@8" }, comdat +// CHECK-DAG: @"??_R4Y1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 4, i32 0, i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUY1@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"??_R3Y1@@8" }, comdat +// CHECK-DAG: @"??_R0?AUY1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"??_7type_info@@6B@", i8* null, [9 x i8] c".?AUY1@@\00" }, comdat +// CHECK-DAG: @"??_R3Y1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 3, i32 6, %rtti.BaseClassDescriptor** getelementptr inbounds ([7 x %rtti.BaseClassDescriptor*], [7 x %rtti.BaseClassDescriptor*]* @"??_R2Y1@@8", i32 0, i32 0) }, comdat +// CHECK-DAG: @"??_R2Y1@@8" = linkonce_odr constant [7 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@Y1@@8", %rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@W1@@8", %rtti.BaseClassDescriptor* @"??_R1A@A@3FA@V1@@8", %rtti.BaseClassDescriptor* @"??_R1A@A@3EA@X1@@8", %rtti.BaseClassDescriptor* @"??_R1A@A@3FA@V1@@8", %rtti.BaseClassDescriptor* @"??_R1A@A@3EA@X1@@8", %rtti.BaseClassDescriptor* null], comdat +// CHECK-DAG: @"??_R1A@?0A@EA@Y1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUY1@@@8" to i8*), i32 5, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3Y1@@8" }, comdat +// CHECK-DAG: @"??_R1A@?0A@EA@W1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUW1@@@8" to i8*), i32 2, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3W1@@8" }, comdat +// CHECK-DAG: @"??_R0?AUW1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"??_7type_info@@6B@", i8* null, [9 x i8] c".?AUW1@@\00" }, comdat +// CHECK-DAG: @"??_R3W1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 3, %rtti.BaseClassDescriptor** getelementptr inbounds ([4 x %rtti.BaseClassDescriptor*], [4 x %rtti.BaseClassDescriptor*]* @"??_R2W1@@8", i32 0, i32 0) }, comdat +// CHECK-DAG: @"??_R2W1@@8" = linkonce_odr constant [4 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@W1@@8", %rtti.BaseClassDescriptor* @"??_R1A@A@3FA@V1@@8", %rtti.BaseClassDescriptor* @"??_R1A@A@3EA@X1@@8", %rtti.BaseClassDescriptor* null], comdat +// CHECK-DAG: @"??_R1A@A@3FA@V1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUV1@@@8" to i8*), i32 1, i32 0, i32 0, i32 4, i32 80, %rtti.ClassHierarchyDescriptor* @"??_R3V1@@8" }, comdat +// CHECK-DAG: @"??_R0?AUV1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"??_7type_info@@6B@", i8* null, [9 x i8] c".?AUV1@@\00" }, comdat +// CHECK-DAG: @"??_R3V1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 2, %rtti.BaseClassDescriptor** getelementptr inbounds ([3 x %rtti.BaseClassDescriptor*], [3 x %rtti.BaseClassDescriptor*]* @"??_R2V1@@8", i32 0, i32 0) }, comdat +// CHECK-DAG: @"??_R2V1@@8" = linkonce_odr constant [3 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@V1@@8", %rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@X1@@8", %rtti.BaseClassDescriptor* null], comdat +// CHECK-DAG: @"??_R1A@?0A@EA@V1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUV1@@@8" to i8*), i32 1, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3V1@@8" }, comdat +// CHECK-DAG: @"??_R1A@?0A@EA@X1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUX1@@@8" to i8*), i32 0, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3X1@@8" }, comdat +// CHECK-DAG: @"??_R0?AUX1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"??_7type_info@@6B@", i8* null, [9 x i8] c".?AUX1@@\00" }, comdat +// CHECK-DAG: @"??_R3X1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, %rtti.BaseClassDescriptor** getelementptr inbounds ([2 x %rtti.BaseClassDescriptor*], [2 x %rtti.BaseClassDescriptor*]* @"??_R2X1@@8", i32 0, i32 0) }, comdat +// CHECK-DAG: @"??_R2X1@@8" = linkonce_odr constant [2 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@X1@@8", %rtti.BaseClassDescriptor* null], comdat +// CHECK-DAG: @"??_R1A@A@3EA@X1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUX1@@@8" to i8*), i32 0, i32 0, i32 0, i32 4, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3X1@@8" }, comdat +// CHECK-DAG: @"??_R4W1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 4, i32 0, i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUW1@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"??_R3W1@@8" }, comdat +// CHECK-DAG: @"??_R4V1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUV1@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"??_R3V1@@8" }, comdat +// CHECK-DAG: @"??_R4X1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor8* @"??_R0?AUX1@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"??_R3X1@@8" }, comdat +// CHECK-DAG: @"??_R4C@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUC@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"??_R3C@@8" }, comdat +// CHECK-DAG: @"??_R0?AUC@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AUC@@\00" }, comdat +// CHECK-DAG: @"??_R3C@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 3, %rtti.BaseClassDescriptor** getelementptr inbounds ([4 x %rtti.BaseClassDescriptor*], [4 x %rtti.BaseClassDescriptor*]* @"??_R2C@@8", i32 0, i32 0) }, comdat +// CHECK-DAG: @"??_R2C@@8" = linkonce_odr constant [4 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@C@@8", %rtti.BaseClassDescriptor* @"??_R13?0A@EA@B@@8", %rtti.BaseClassDescriptor* @"??_R13?0A@EA@A@@8", %rtti.BaseClassDescriptor* null], comdat +// CHECK-DAG: @"??_R1A@?0A@EA@C@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUC@@@8" to i8*), i32 2, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3C@@8" }, comdat +// CHECK-DAG: @"??_R13?0A@EA@B@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUB@@@8" to i8*), i32 1, i32 4, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3B@@8" }, comdat +// CHECK-DAG: @"??_R0?AUB@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AUB@@\00" }, comdat +// CHECK-DAG: @"??_R3B@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 2, %rtti.BaseClassDescriptor** getelementptr inbounds ([3 x %rtti.BaseClassDescriptor*], [3 x %rtti.BaseClassDescriptor*]* @"??_R2B@@8", i32 0, i32 0) }, comdat +// CHECK-DAG: @"??_R2B@@8" = linkonce_odr constant [3 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@B@@8", %rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@A@@8", %rtti.BaseClassDescriptor* null], comdat +// CHECK-DAG: @"??_R1A@?0A@EA@B@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUB@@@8" to i8*), i32 1, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3B@@8" }, comdat +// CHECK-DAG: @"??_R1A@?0A@EA@A@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUA@@@8" to i8*), i32 0, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3A@@8" }, comdat +// CHECK-DAG: @"??_R0?AUA@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AUA@@\00" }, comdat +// CHECK-DAG: @"??_R3A@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, %rtti.BaseClassDescriptor** getelementptr inbounds ([2 x %rtti.BaseClassDescriptor*], [2 x %rtti.BaseClassDescriptor*]* @"??_R2A@@8", i32 0, i32 0) }, comdat +// CHECK-DAG: @"??_R2A@@8" = linkonce_odr constant [2 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@A@@8", %rtti.BaseClassDescriptor* null], comdat +// CHECK-DAG: @"??_R13?0A@EA@A@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUA@@@8" to i8*), i32 0, i32 4, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3A@@8" }, comdat +// CHECK-DAG: @"??_R4Y@@6BZ@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AVY@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"??_R3Y@@8" }, comdat +// CHECK-DAG: @"??_R0?AVY@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AVY@@\00" }, comdat +// CHECK-DAG: @"??_R3Y@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 3, i32 9, %rtti.BaseClassDescriptor** getelementptr inbounds ([10 x %rtti.BaseClassDescriptor*], [10 x %rtti.BaseClassDescriptor*]* @"??_R2Y@@8", i32 0, i32 0) }, comdat +// CHECK-DAG: @"??_R2Y@@8" = linkonce_odr constant [10 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@Y@@8", %rtti.BaseClassDescriptor* @"??_R1A@?0A@EN@Z@@8", %rtti.BaseClassDescriptor* @"??_R13?0A@EN@W@@8", %rtti.BaseClassDescriptor* @"??_R17?0A@EN@M@@8", %rtti.BaseClassDescriptor* @"??_R17?0A@EN@N@@8", %rtti.BaseClassDescriptor* @"??_R1A@33FN@V@@8", %rtti.BaseClassDescriptor* @"??_R1A@33EJ@X@@8", %rtti.BaseClassDescriptor* @"??_R1A@33FN@V@@8", %rtti.BaseClassDescriptor* @"??_R1A@33EJ@X@@8", %rtti.BaseClassDescriptor* null], comdat +// CHECK-DAG: @"??_R1A@?0A@EA@Y@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AVY@@@8" to i8*), i32 8, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3Y@@8" }, comdat +// CHECK-DAG: @"??_R1A@?0A@EN@Z@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AVZ@@@8" to i8*), i32 0, i32 0, i32 -1, i32 0, i32 77, %rtti.ClassHierarchyDescriptor* @"??_R3Z@@8" }, comdat +// CHECK-DAG: @"??_R0?AVZ@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AVZ@@\00" }, comdat +// CHECK-DAG: @"??_R3Z@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, %rtti.BaseClassDescriptor** getelementptr inbounds ([2 x %rtti.BaseClassDescriptor*], [2 x %rtti.BaseClassDescriptor*]* @"??_R2Z@@8", i32 0, i32 0) }, comdat +// CHECK-DAG: @"??_R2Z@@8" = linkonce_odr constant [2 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@Z@@8", %rtti.BaseClassDescriptor* null], comdat +// CHECK-DAG: @"??_R1A@?0A@EA@Z@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AVZ@@@8" to i8*), i32 0, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3Z@@8" }, comdat +// CHECK-DAG: @"??_R13?0A@EN@W@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AVW@@@8" to i8*), i32 4, i32 4, i32 -1, i32 0, i32 77, %rtti.ClassHierarchyDescriptor* @"??_R3W@@8" }, comdat +// CHECK-DAG: @"??_R0?AVW@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AVW@@\00" }, comdat +// CHECK-DAG: @"??_R3W@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 3, i32 5, %rtti.BaseClassDescriptor** getelementptr inbounds ([6 x %rtti.BaseClassDescriptor*], [6 x %rtti.BaseClassDescriptor*]* @"??_R2W@@8", i32 0, i32 0) }, comdat +// CHECK-DAG: @"??_R2W@@8" = linkonce_odr constant [6 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@W@@8", %rtti.BaseClassDescriptor* @"??_R13?0A@EN@M@@8", %rtti.BaseClassDescriptor* @"??_R13?0A@EN@N@@8", %rtti.BaseClassDescriptor* @"??_R1A@A@3FN@V@@8", %rtti.BaseClassDescriptor* @"??_R1A@A@3EJ@X@@8", %rtti.BaseClassDescriptor* null], comdat +// CHECK-DAG: @"??_R1A@?0A@EA@W@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AVW@@@8" to i8*), i32 4, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3W@@8" }, comdat +// CHECK-DAG: @"??_R13?0A@EN@M@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUM@@@8" to i8*), i32 1, i32 4, i32 -1, i32 0, i32 77, %rtti.ClassHierarchyDescriptor* @"??_R3M@@8" }, comdat +// CHECK-DAG: @"??_R0?AUM@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AUM@@\00" }, comdat +// CHECK-DAG: @"??_R3M@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 2, %rtti.BaseClassDescriptor** getelementptr inbounds ([3 x %rtti.BaseClassDescriptor*], [3 x %rtti.BaseClassDescriptor*]* @"??_R2M@@8", i32 0, i32 0) }, comdat +// CHECK-DAG: @"??_R2M@@8" = linkonce_odr constant [3 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@M@@8", %rtti.BaseClassDescriptor* @"??_R1A@?0A@EN@N@@8", %rtti.BaseClassDescriptor* null], comdat +// CHECK-DAG: @"??_R1A@?0A@EA@M@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUM@@@8" to i8*), i32 1, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3M@@8" }, comdat +// CHECK-DAG: @"??_R1A@?0A@EN@N@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUN@@@8" to i8*), i32 0, i32 0, i32 -1, i32 0, i32 77, %rtti.ClassHierarchyDescriptor* @"??_R3N@@8" }, comdat +// CHECK-DAG: @"??_R0?AUN@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AUN@@\00" }, comdat +// CHECK-DAG: @"??_R3N@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, %rtti.BaseClassDescriptor** getelementptr inbounds ([2 x %rtti.BaseClassDescriptor*], [2 x %rtti.BaseClassDescriptor*]* @"??_R2N@@8", i32 0, i32 0) }, comdat +// CHECK-DAG: @"??_R2N@@8" = linkonce_odr constant [2 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@N@@8", %rtti.BaseClassDescriptor* null], comdat +// CHECK-DAG: @"??_R1A@?0A@EA@N@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUN@@@8" to i8*), i32 0, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3N@@8" }, comdat +// CHECK-DAG: @"??_R13?0A@EN@N@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUN@@@8" to i8*), i32 0, i32 4, i32 -1, i32 0, i32 77, %rtti.ClassHierarchyDescriptor* @"??_R3N@@8" }, comdat +// CHECK-DAG: @"??_R1A@A@3FN@V@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AVV@@@8" to i8*), i32 1, i32 0, i32 0, i32 4, i32 93, %rtti.ClassHierarchyDescriptor* @"??_R3V@@8" }, comdat +// CHECK-DAG: @"??_R0?AVV@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AVV@@\00" }, comdat +// CHECK-DAG: @"??_R3V@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 2, %rtti.BaseClassDescriptor** getelementptr inbounds ([3 x %rtti.BaseClassDescriptor*], [3 x %rtti.BaseClassDescriptor*]* @"??_R2V@@8", i32 0, i32 0) }, comdat +// CHECK-DAG: @"??_R2V@@8" = linkonce_odr constant [3 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@V@@8", %rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@X@@8", %rtti.BaseClassDescriptor* null], comdat +// CHECK-DAG: @"??_R1A@?0A@EA@V@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AVV@@@8" to i8*), i32 1, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3V@@8" }, comdat +// CHECK-DAG: @"??_R1A@?0A@EA@X@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUX@@@8" to i8*), i32 0, i32 0, i32 -1, i32 0, i32 64, %rtti.ClassHierarchyDescriptor* @"??_R3X@@8" }, comdat +// CHECK-DAG: @"??_R0?AUX@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AUX@@\00" }, comdat +// CHECK-DAG: @"??_R3X@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, %rtti.BaseClassDescriptor** getelementptr inbounds ([2 x %rtti.BaseClassDescriptor*], [2 x %rtti.BaseClassDescriptor*]* @"??_R2X@@8", i32 0, i32 0) }, comdat +// CHECK-DAG: @"??_R2X@@8" = linkonce_odr constant [2 x %rtti.BaseClassDescriptor*] [%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@X@@8", %rtti.BaseClassDescriptor* null], comdat +// CHECK-DAG: @"??_R1A@A@3EJ@X@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUX@@@8" to i8*), i32 0, i32 0, i32 0, i32 4, i32 73, %rtti.ClassHierarchyDescriptor* @"??_R3X@@8" }, comdat +// CHECK-DAG: @"??_R17?0A@EN@M@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUM@@@8" to i8*), i32 1, i32 8, i32 -1, i32 0, i32 77, %rtti.ClassHierarchyDescriptor* @"??_R3M@@8" }, comdat +// CHECK-DAG: @"??_R17?0A@EN@N@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUN@@@8" to i8*), i32 0, i32 8, i32 -1, i32 0, i32 77, %rtti.ClassHierarchyDescriptor* @"??_R3N@@8" }, comdat +// CHECK-DAG: @"??_R1A@33FN@V@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AVV@@@8" to i8*), i32 1, i32 0, i32 4, i32 4, i32 93, %rtti.ClassHierarchyDescriptor* @"??_R3V@@8" }, comdat +// CHECK-DAG: @"??_R1A@33EJ@X@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUX@@@8" to i8*), i32 0, i32 0, i32 4, i32 4, i32 73, %rtti.ClassHierarchyDescriptor* @"??_R3X@@8" }, comdat +// CHECK-DAG: @"??_R4Y@@6BW@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 8, i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AVY@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"??_R3Y@@8" }, comdat +// CHECK-DAG: @"??_R4W@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 4, i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AVW@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"??_R3W@@8" }, comdat +// CHECK-DAG: @"??_R4Z@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AVZ@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"??_R3Z@@8" }, comdat +// CHECK-DAG: @"??_R4V@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AVV@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"??_R3V@@8" }, comdat +// CHECK-DAG: @"??_R4X@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 0, i32 0, i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUX@@@8" to i8*), %rtti.ClassHierarchyDescriptor* @"??_R3X@@8" }, comdat -// X64-DAG: @"\01??_R4B2@@6BZ2@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 16, i32 4, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUB2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3B2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"\01??_R4B2@@6BZ2@@@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R0?AUB2@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"\01??_7type_info@@6B@", i8* null, [9 x i8] c".?AUB2@@\00" }, comdat -// X64-DAG: @"\01??_R3B2@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 3, i32 4, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([5 x i32]* @"\01??_R2B2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R2B2@@8" = linkonce_odr constant [5 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@B2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@A@3FA@A2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@A@3EA@Z2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R17A@3EA@Y2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat -// X64-DAG: @"\01??_R1A@?0A@EA@B2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUB2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 3, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3B2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R1A@A@3FA@A2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUA2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 2, i32 0, i32 0, i32 4, i32 80, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3A2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R0?AUA2@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"\01??_7type_info@@6B@", i8* null, [9 x i8] c".?AUA2@@\00" }, comdat -// X64-DAG: @"\01??_R3A2@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 1, i32 3, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([4 x i32]* @"\01??_R2A2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R2A2@@8" = linkonce_odr constant [4 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@A2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@Z2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R17?0A@EA@Y2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat -// X64-DAG: @"\01??_R1A@?0A@EA@A2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUA2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 2, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3A2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R1A@?0A@EA@Z2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUZ2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3Z2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R0?AUZ2@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"\01??_7type_info@@6B@", i8* null, [9 x i8] c".?AUZ2@@\00" }, comdat -// X64-DAG: @"\01??_R3Z2@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([2 x i32]* @"\01??_R2Z2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R2Z2@@8" = linkonce_odr constant [2 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@Z2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat -// X64-DAG: @"\01??_R17?0A@EA@Y2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUY2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 8, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3Y2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R0?AUY2@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"\01??_7type_info@@6B@", i8* null, [9 x i8] c".?AUY2@@\00" }, comdat -// X64-DAG: @"\01??_R3Y2@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([2 x i32]* @"\01??_R2Y2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R2Y2@@8" = linkonce_odr constant [2 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@Y2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat -// X64-DAG: @"\01??_R1A@?0A@EA@Y2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUY2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3Y2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R1A@A@3EA@Z2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUZ2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 0, i32 4, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3Z2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R17A@3EA@Y2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUY2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 8, i32 0, i32 4, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3Y2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R4B2@@6BY2@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 24, i32 12, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUB2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3B2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"\01??_R4B2@@6BY2@@@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R4A2@@6BZ2@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUA2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3A2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"\01??_R4A2@@6BZ2@@@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R4A2@@6BY2@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 8, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUA2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3A2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"\01??_R4A2@@6BY2@@@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R4Y2@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUY2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3Y2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"\01??_R4Y2@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R4Z2@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUZ2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3Z2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"\01??_R4Z2@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R4B1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 16, i32 4, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUB1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3B1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"\01??_R4B1@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R0?AUB1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"\01??_7type_info@@6B@", i8* null, [9 x i8] c".?AUB1@@\00" }, comdat -// X64-DAG: @"\01??_R3B1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 2, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([3 x i32]* @"\01??_R2B1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R2B1@@8" = linkonce_odr constant [3 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@B1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@A@3FA@A1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat -// X64-DAG: @"\01??_R1A@?0A@EA@B1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUB1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3B1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R1A@A@3FA@A1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUA1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 0, i32 4, i32 80, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3A1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R0?AUA1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"\01??_7type_info@@6B@", i8* null, [9 x i8] c".?AUA1@@\00" }, comdat -// X64-DAG: @"\01??_R3A1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([2 x i32]* @"\01??_R2A1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R2A1@@8" = linkonce_odr constant [2 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@A1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat -// X64-DAG: @"\01??_R1A@?0A@EA@A1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUA1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3A1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R4A1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUA1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3A1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"\01??_R4A1@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R4Y1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 8, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUY1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3Y1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"\01??_R4Y1@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R0?AUY1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"\01??_7type_info@@6B@", i8* null, [9 x i8] c".?AUY1@@\00" }, comdat -// X64-DAG: @"\01??_R3Y1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 3, i32 6, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([7 x i32]* @"\01??_R2Y1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R2Y1@@8" = linkonce_odr constant [7 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@Y1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@W1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@A@3FA@V1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@A@3EA@X1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@A@3FA@V1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@A@3EA@X1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat -// X64-DAG: @"\01??_R1A@?0A@EA@Y1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUY1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 5, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3Y1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R1A@?0A@EA@W1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUW1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 2, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3W1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R0?AUW1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"\01??_7type_info@@6B@", i8* null, [9 x i8] c".?AUW1@@\00" }, comdat -// X64-DAG: @"\01??_R3W1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 3, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([4 x i32]* @"\01??_R2W1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R2W1@@8" = linkonce_odr constant [4 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@W1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@A@3FA@V1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@A@3EA@X1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat -// X64-DAG: @"\01??_R1A@A@3FA@V1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUV1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 0, i32 0, i32 4, i32 80, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3V1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R0?AUV1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"\01??_7type_info@@6B@", i8* null, [9 x i8] c".?AUV1@@\00" }, comdat -// X64-DAG: @"\01??_R3V1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 2, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([3 x i32]* @"\01??_R2V1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R2V1@@8" = linkonce_odr constant [3 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@V1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@X1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat -// X64-DAG: @"\01??_R1A@?0A@EA@V1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUV1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3V1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R1A@?0A@EA@X1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUX1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3X1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R0?AUX1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"\01??_7type_info@@6B@", i8* null, [9 x i8] c".?AUX1@@\00" }, comdat -// X64-DAG: @"\01??_R3X1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([2 x i32]* @"\01??_R2X1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R2X1@@8" = linkonce_odr constant [2 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@X1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat -// X64-DAG: @"\01??_R1A@A@3EA@X1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUX1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 0, i32 4, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3X1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R4W1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 8, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUW1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3W1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"\01??_R4W1@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R4V1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUV1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3V1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"\01??_R4V1@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R4X1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"\01??_R0?AUX1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3X1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"\01??_R4X1@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R4C@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AUC@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3C@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"\01??_R4C@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R0?AUC@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUC@@\00" }, comdat -// X64-DAG: @"\01??_R3C@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 3, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([4 x i32]* @"\01??_R2C@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R2C@@8" = linkonce_odr constant [4 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@C@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R17?0A@EA@B@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R17?0A@EA@A@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat -// X64-DAG: @"\01??_R1A@?0A@EA@C@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AUC@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 2, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3C@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R17?0A@EA@B@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AUB@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 8, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3B@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R0?AUB@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUB@@\00" }, comdat -// X64-DAG: @"\01??_R3B@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 2, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([3 x i32]* @"\01??_R2B@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R2B@@8" = linkonce_odr constant [3 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@B@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@A@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat -// X64-DAG: @"\01??_R1A@?0A@EA@B@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AUB@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3B@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R1A@?0A@EA@A@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AUA@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3A@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R0?AUA@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUA@@\00" }, comdat -// X64-DAG: @"\01??_R3A@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([2 x i32]* @"\01??_R2A@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R2A@@8" = linkonce_odr constant [2 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@A@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat -// X64-DAG: @"\01??_R17?0A@EA@A@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AUA@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 8, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3A@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R4Y@@6BZ@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AVY@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3Y@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"\01??_R4Y@@6BZ@@@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R0?AVY@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AVY@@\00" }, comdat -// X64-DAG: @"\01??_R3Y@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 3, i32 9, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([10 x i32]* @"\01??_R2Y@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R2Y@@8" = linkonce_odr constant [10 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@Y@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EN@Z@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R17?0A@EN@W@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1BA@?0A@EN@M@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1BA@?0A@EN@N@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@73FN@V@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@73EJ@X@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@73FN@V@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@73EJ@X@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat -// X64-DAG: @"\01??_R1A@?0A@EA@Y@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AVY@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 8, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3Y@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R1A@?0A@EN@Z@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AVZ@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 77, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3Z@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R0?AVZ@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AVZ@@\00" }, comdat -// X64-DAG: @"\01??_R3Z@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([2 x i32]* @"\01??_R2Z@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R2Z@@8" = linkonce_odr constant [2 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@Z@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat -// X64-DAG: @"\01??_R1A@?0A@EA@Z@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AVZ@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3Z@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R17?0A@EN@W@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AVW@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 4, i32 8, i32 -1, i32 0, i32 77, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3W@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R0?AVW@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AVW@@\00" }, comdat -// X64-DAG: @"\01??_R3W@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 3, i32 5, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([6 x i32]* @"\01??_R2W@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R2W@@8" = linkonce_odr constant [6 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@W@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R17?0A@EN@M@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R17?0A@EN@N@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@A@3FN@V@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@A@3EJ@X@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat -// X64-DAG: @"\01??_R1A@?0A@EA@W@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AVW@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 4, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3W@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R17?0A@EN@M@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AUM@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 8, i32 -1, i32 0, i32 77, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3M@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R0?AUM@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUM@@\00" }, comdat -// X64-DAG: @"\01??_R3M@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 2, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([3 x i32]* @"\01??_R2M@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R2M@@8" = linkonce_odr constant [3 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@M@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EN@N@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat -// X64-DAG: @"\01??_R1A@?0A@EA@M@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AUM@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3M@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R1A@?0A@EN@N@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AUN@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 77, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3N@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R0?AUN@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUN@@\00" }, comdat -// X64-DAG: @"\01??_R3N@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([2 x i32]* @"\01??_R2N@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R2N@@8" = linkonce_odr constant [2 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@N@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat -// X64-DAG: @"\01??_R1A@?0A@EA@N@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AUN@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3N@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R17?0A@EN@N@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AUN@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 8, i32 -1, i32 0, i32 77, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3N@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R1A@A@3FN@V@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AVV@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 0, i32 0, i32 4, i32 93, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3V@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R0?AVV@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AVV@@\00" }, comdat -// X64-DAG: @"\01??_R3V@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 2, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([3 x i32]* @"\01??_R2V@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R2V@@8" = linkonce_odr constant [3 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@V@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@X@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat -// X64-DAG: @"\01??_R1A@?0A@EA@V@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AVV@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3V@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R1A@?0A@EA@X@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AUX@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3X@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R0?AUX@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUX@@\00" }, comdat -// X64-DAG: @"\01??_R3X@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([2 x i32]* @"\01??_R2X@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R2X@@8" = linkonce_odr constant [2 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"\01??_R1A@?0A@EA@X@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat -// X64-DAG: @"\01??_R1A@A@3EJ@X@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AUX@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 0, i32 4, i32 73, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3X@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R1BA@?0A@EN@M@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AUM@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 16, i32 -1, i32 0, i32 77, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3M@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R1BA@?0A@EN@N@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AUN@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 16, i32 -1, i32 0, i32 77, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3N@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R1A@73FN@V@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AVV@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 0, i32 8, i32 4, i32 93, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3V@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R1A@73EJ@X@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AUX@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 8, i32 4, i32 73, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3X@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R4Y@@6BW@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 16, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AVY@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3Y@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"\01??_R4Y@@6BW@@@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R4W@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 8, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AVW@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3W@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"\01??_R4W@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R4Z@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AVZ@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3Z@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"\01??_R4Z@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R4V@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AVV@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3V@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"\01??_R4V@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat -// X64-DAG: @"\01??_R4X@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AUX@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3X@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"\01??_R4X@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R4B2@@6BZ2@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 16, i32 4, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUB2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3B2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"??_R4B2@@6BZ2@@@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R0?AUB2@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"??_7type_info@@6B@", i8* null, [9 x i8] c".?AUB2@@\00" }, comdat +// X64-DAG: @"??_R3B2@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 3, i32 4, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([5 x i32]* @"??_R2B2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R2B2@@8" = linkonce_odr constant [5 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@B2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@A@3FA@A2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@A@3EA@Z2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R17A@3EA@Y2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat +// X64-DAG: @"??_R1A@?0A@EA@B2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUB2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 3, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3B2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R1A@A@3FA@A2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUA2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 2, i32 0, i32 0, i32 4, i32 80, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3A2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R0?AUA2@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"??_7type_info@@6B@", i8* null, [9 x i8] c".?AUA2@@\00" }, comdat +// X64-DAG: @"??_R3A2@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 1, i32 3, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([4 x i32]* @"??_R2A2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R2A2@@8" = linkonce_odr constant [4 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@A2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@Z2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R17?0A@EA@Y2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat +// X64-DAG: @"??_R1A@?0A@EA@A2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUA2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 2, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3A2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R1A@?0A@EA@Z2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUZ2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3Z2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R0?AUZ2@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"??_7type_info@@6B@", i8* null, [9 x i8] c".?AUZ2@@\00" }, comdat +// X64-DAG: @"??_R3Z2@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([2 x i32]* @"??_R2Z2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R2Z2@@8" = linkonce_odr constant [2 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@Z2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat +// X64-DAG: @"??_R17?0A@EA@Y2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUY2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 8, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3Y2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R0?AUY2@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"??_7type_info@@6B@", i8* null, [9 x i8] c".?AUY2@@\00" }, comdat +// X64-DAG: @"??_R3Y2@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([2 x i32]* @"??_R2Y2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R2Y2@@8" = linkonce_odr constant [2 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@Y2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat +// X64-DAG: @"??_R1A@?0A@EA@Y2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUY2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3Y2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R1A@A@3EA@Z2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUZ2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 0, i32 4, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3Z2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R17A@3EA@Y2@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUY2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 8, i32 0, i32 4, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3Y2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R4B2@@6BY2@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 24, i32 12, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUB2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3B2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"??_R4B2@@6BY2@@@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R4A2@@6BZ2@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUA2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3A2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"??_R4A2@@6BZ2@@@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R4A2@@6BY2@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 8, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUA2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3A2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"??_R4A2@@6BY2@@@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R4Y2@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUY2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3Y2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"??_R4Y2@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R4Z2@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUZ2@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3Z2@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"??_R4Z2@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R4B1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 16, i32 4, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUB1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3B1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"??_R4B1@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R0?AUB1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"??_7type_info@@6B@", i8* null, [9 x i8] c".?AUB1@@\00" }, comdat +// X64-DAG: @"??_R3B1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 2, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([3 x i32]* @"??_R2B1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R2B1@@8" = linkonce_odr constant [3 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@B1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@A@3FA@A1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat +// X64-DAG: @"??_R1A@?0A@EA@B1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUB1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3B1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R1A@A@3FA@A1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUA1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 0, i32 4, i32 80, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3A1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R0?AUA1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"??_7type_info@@6B@", i8* null, [9 x i8] c".?AUA1@@\00" }, comdat +// X64-DAG: @"??_R3A1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([2 x i32]* @"??_R2A1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R2A1@@8" = linkonce_odr constant [2 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@A1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat +// X64-DAG: @"??_R1A@?0A@EA@A1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUA1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3A1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R4A1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUA1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3A1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"??_R4A1@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R4Y1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 8, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUY1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3Y1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"??_R4Y1@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R0?AUY1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"??_7type_info@@6B@", i8* null, [9 x i8] c".?AUY1@@\00" }, comdat +// X64-DAG: @"??_R3Y1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 3, i32 6, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([7 x i32]* @"??_R2Y1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R2Y1@@8" = linkonce_odr constant [7 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@Y1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@W1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@A@3FA@V1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@A@3EA@X1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@A@3FA@V1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@A@3EA@X1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat +// X64-DAG: @"??_R1A@?0A@EA@Y1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUY1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 5, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3Y1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R1A@?0A@EA@W1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUW1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 2, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3W1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R0?AUW1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"??_7type_info@@6B@", i8* null, [9 x i8] c".?AUW1@@\00" }, comdat +// X64-DAG: @"??_R3W1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 3, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([4 x i32]* @"??_R2W1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R2W1@@8" = linkonce_odr constant [4 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@W1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@A@3FA@V1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@A@3EA@X1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat +// X64-DAG: @"??_R1A@A@3FA@V1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUV1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 0, i32 0, i32 4, i32 80, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3V1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R0?AUV1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"??_7type_info@@6B@", i8* null, [9 x i8] c".?AUV1@@\00" }, comdat +// X64-DAG: @"??_R3V1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 2, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([3 x i32]* @"??_R2V1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R2V1@@8" = linkonce_odr constant [3 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@V1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@X1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat +// X64-DAG: @"??_R1A@?0A@EA@V1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUV1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3V1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R1A@?0A@EA@X1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUX1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3X1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R0?AUX1@@@8" = linkonce_odr global %rtti.TypeDescriptor8 { i8** @"??_7type_info@@6B@", i8* null, [9 x i8] c".?AUX1@@\00" }, comdat +// X64-DAG: @"??_R3X1@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([2 x i32]* @"??_R2X1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R2X1@@8" = linkonce_odr constant [2 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@X1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat +// X64-DAG: @"??_R1A@A@3EA@X1@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUX1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 0, i32 4, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3X1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R4W1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 8, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUW1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3W1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"??_R4W1@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R4V1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUV1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3V1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"??_R4V1@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R4X1@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor8* @"??_R0?AUX1@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3X1@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"??_R4X1@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R4C@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AUC@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3C@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"??_R4C@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R0?AUC@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AUC@@\00" }, comdat +// X64-DAG: @"??_R3C@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 3, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([4 x i32]* @"??_R2C@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R2C@@8" = linkonce_odr constant [4 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@C@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R17?0A@EA@B@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R17?0A@EA@A@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat +// X64-DAG: @"??_R1A@?0A@EA@C@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AUC@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 2, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3C@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R17?0A@EA@B@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AUB@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 8, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3B@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R0?AUB@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AUB@@\00" }, comdat +// X64-DAG: @"??_R3B@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 2, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([3 x i32]* @"??_R2B@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R2B@@8" = linkonce_odr constant [3 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@B@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@A@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat +// X64-DAG: @"??_R1A@?0A@EA@B@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AUB@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3B@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R1A@?0A@EA@A@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AUA@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3A@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R0?AUA@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AUA@@\00" }, comdat +// X64-DAG: @"??_R3A@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([2 x i32]* @"??_R2A@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R2A@@8" = linkonce_odr constant [2 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@A@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat +// X64-DAG: @"??_R17?0A@EA@A@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AUA@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 8, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3A@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R4Y@@6BZ@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AVY@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3Y@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"??_R4Y@@6BZ@@@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R0?AVY@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AVY@@\00" }, comdat +// X64-DAG: @"??_R3Y@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 3, i32 9, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([10 x i32]* @"??_R2Y@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R2Y@@8" = linkonce_odr constant [10 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@Y@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EN@Z@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R17?0A@EN@W@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1BA@?0A@EN@M@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1BA@?0A@EN@N@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@73FN@V@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@73EJ@X@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@73FN@V@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@73EJ@X@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat +// X64-DAG: @"??_R1A@?0A@EA@Y@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AVY@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 8, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3Y@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R1A@?0A@EN@Z@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AVZ@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 77, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3Z@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R0?AVZ@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AVZ@@\00" }, comdat +// X64-DAG: @"??_R3Z@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([2 x i32]* @"??_R2Z@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R2Z@@8" = linkonce_odr constant [2 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@Z@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat +// X64-DAG: @"??_R1A@?0A@EA@Z@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AVZ@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3Z@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R17?0A@EN@W@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AVW@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 4, i32 8, i32 -1, i32 0, i32 77, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3W@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R0?AVW@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AVW@@\00" }, comdat +// X64-DAG: @"??_R3W@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 3, i32 5, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([6 x i32]* @"??_R2W@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R2W@@8" = linkonce_odr constant [6 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@W@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R17?0A@EN@M@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R17?0A@EN@N@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@A@3FN@V@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@A@3EJ@X@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat +// X64-DAG: @"??_R1A@?0A@EA@W@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AVW@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 4, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3W@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R17?0A@EN@M@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AUM@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 8, i32 -1, i32 0, i32 77, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3M@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R0?AUM@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AUM@@\00" }, comdat +// X64-DAG: @"??_R3M@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 2, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([3 x i32]* @"??_R2M@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R2M@@8" = linkonce_odr constant [3 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@M@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EN@N@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat +// X64-DAG: @"??_R1A@?0A@EA@M@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AUM@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3M@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R1A@?0A@EN@N@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AUN@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 77, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3N@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R0?AUN@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AUN@@\00" }, comdat +// X64-DAG: @"??_R3N@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([2 x i32]* @"??_R2N@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R2N@@8" = linkonce_odr constant [2 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@N@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat +// X64-DAG: @"??_R1A@?0A@EA@N@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AUN@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3N@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R17?0A@EN@N@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AUN@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 8, i32 -1, i32 0, i32 77, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3N@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R1A@A@3FN@V@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AVV@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 0, i32 0, i32 4, i32 93, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3V@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R0?AVV@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AVV@@\00" }, comdat +// X64-DAG: @"??_R3V@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 2, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([3 x i32]* @"??_R2V@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R2V@@8" = linkonce_odr constant [3 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@V@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@X@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat +// X64-DAG: @"??_R1A@?0A@EA@V@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AVV@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3V@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R1A@?0A@EA@X@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AUX@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3X@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R0?AUX@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AUX@@\00" }, comdat +// X64-DAG: @"??_R3X@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([2 x i32]* @"??_R2X@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R2X@@8" = linkonce_odr constant [2 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@X@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat +// X64-DAG: @"??_R1A@A@3EJ@X@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AUX@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 0, i32 4, i32 73, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3X@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R1BA@?0A@EN@M@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AUM@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 16, i32 -1, i32 0, i32 77, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3M@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R1BA@?0A@EN@N@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AUN@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 16, i32 -1, i32 0, i32 77, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3N@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R1A@73FN@V@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AVV@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 1, i32 0, i32 8, i32 4, i32 93, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3V@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R1A@73EJ@X@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AUX@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 8, i32 4, i32 73, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3X@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R4Y@@6BW@@@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 16, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AVY@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3Y@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"??_R4Y@@6BW@@@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R4W@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 8, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AVW@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3W@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"??_R4W@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R4Z@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AVZ@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3Z@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"??_R4Z@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R4V@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AVV@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3V@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"??_R4V@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat +// X64-DAG: @"??_R4X@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AUX@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3X@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"??_R4X@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat diff --git a/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp b/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp index eaae3493ccdc6..a910a2d7f736d 100644 --- a/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp +++ b/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -triple=i386-pc-win32 -mconstructor-aliases -fno-rtti | FileCheck -check-prefix WIN32 %s // RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -triple=thumb-pc-win32 -mconstructor-aliases -fno-rtti | FileCheck -check-prefix WOA %s // RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -triple=x86_64-pc-win32 -mconstructor-aliases -fno-rtti | FileCheck -check-prefix WIN64 %s +// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -triple=aarch64-windows-msvc -mconstructor-aliases -fno-rtti | FileCheck -check-prefix WOA64 %s struct Empty {}; @@ -68,7 +69,7 @@ struct BaseNoByval : Small { int bb; }; -// WIN32: declare void @"{{.*take_bools_and_chars.*}}" +// WIN32: declare dso_local void @"{{.*take_bools_and_chars.*}}" // WIN32: (<{ i8, [3 x i8], i8, [3 x i8], %struct.SmallWithDtor, // WIN32: i8, [3 x i8], i8, [3 x i8], i32, i8, [3 x i8] }>* inalloca) void take_bools_and_chars(char a, char b, SmallWithDtor c, char d, bool e, int f, bool g); @@ -79,117 +80,117 @@ void call_bools_and_chars() { // Returning structs that fit into a register. Small small_return() { return Small(); } // LINUX-LABEL: define void @_Z12small_returnv(%struct.Small* noalias sret %agg.result) -// WIN32: define i32 @"\01?small_return@@YA?AUSmall@@XZ"() -// WIN64: define i32 @"\01?small_return@@YA?AUSmall@@XZ"() +// WIN32: define dso_local i32 @"?small_return@@YA?AUSmall@@XZ"() +// WIN64: define dso_local i32 @"?small_return@@YA?AUSmall@@XZ"() Medium medium_return() { return Medium(); } // LINUX-LABEL: define void @_Z13medium_returnv(%struct.Medium* noalias sret %agg.result) -// WIN32: define i64 @"\01?medium_return@@YA?AUMedium@@XZ"() -// WIN64: define i64 @"\01?medium_return@@YA?AUMedium@@XZ"() +// WIN32: define dso_local i64 @"?medium_return@@YA?AUMedium@@XZ"() +// WIN64: define dso_local i64 @"?medium_return@@YA?AUMedium@@XZ"() // Returning structs that fit into a register but are not POD. SmallCpp11NotCpp03Pod small_non_pod_return() { return SmallCpp11NotCpp03Pod(); } // LINUX-LABEL: define void @_Z20small_non_pod_returnv(%struct.SmallCpp11NotCpp03Pod* noalias sret %agg.result) -// WIN32: define void @"\01?small_non_pod_return@@YA?AUSmallCpp11NotCpp03Pod@@XZ"(%struct.SmallCpp11NotCpp03Pod* noalias sret %agg.result) -// WIN64: define void @"\01?small_non_pod_return@@YA?AUSmallCpp11NotCpp03Pod@@XZ"(%struct.SmallCpp11NotCpp03Pod* noalias sret %agg.result) +// WIN32: define dso_local void @"?small_non_pod_return@@YA?AUSmallCpp11NotCpp03Pod@@XZ"(%struct.SmallCpp11NotCpp03Pod* noalias sret %agg.result) +// WIN64: define dso_local void @"?small_non_pod_return@@YA?AUSmallCpp11NotCpp03Pod@@XZ"(%struct.SmallCpp11NotCpp03Pod* noalias sret %agg.result) SmallWithCtor small_with_ctor_return() { return SmallWithCtor(); } // LINUX-LABEL: define void @_Z22small_with_ctor_returnv(%struct.SmallWithCtor* noalias sret %agg.result) -// WIN32: define void @"\01?small_with_ctor_return@@YA?AUSmallWithCtor@@XZ"(%struct.SmallWithCtor* noalias sret %agg.result) -// WIN64: define void @"\01?small_with_ctor_return@@YA?AUSmallWithCtor@@XZ"(%struct.SmallWithCtor* noalias sret %agg.result) +// WIN32: define dso_local void @"?small_with_ctor_return@@YA?AUSmallWithCtor@@XZ"(%struct.SmallWithCtor* noalias sret %agg.result) +// WIN64: define dso_local void @"?small_with_ctor_return@@YA?AUSmallWithCtor@@XZ"(%struct.SmallWithCtor* noalias sret %agg.result) // FIXME: The 'sret' mark here doesn't seem to be enough to convince LLVM to // preserve the hidden sret pointer in R0 across the function. -// WOA: define arm_aapcs_vfpcc void @"\01?small_with_ctor_return@@YA?AUSmallWithCtor@@XZ"(%struct.SmallWithCtor* noalias sret %agg.result) +// WOA: define dso_local arm_aapcs_vfpcc void @"?small_with_ctor_return@@YA?AUSmallWithCtor@@XZ"(%struct.SmallWithCtor* noalias sret %agg.result) SmallWithVftable small_with_vftable_return() { return SmallWithVftable(); } // LINUX-LABEL: define void @_Z25small_with_vftable_returnv(%struct.SmallWithVftable* noalias sret %agg.result) -// WIN32: define void @"\01?small_with_vftable_return@@YA?AUSmallWithVftable@@XZ"(%struct.SmallWithVftable* noalias sret %agg.result) -// WIN64: define void @"\01?small_with_vftable_return@@YA?AUSmallWithVftable@@XZ"(%struct.SmallWithVftable* noalias sret %agg.result) +// WIN32: define dso_local void @"?small_with_vftable_return@@YA?AUSmallWithVftable@@XZ"(%struct.SmallWithVftable* noalias sret %agg.result) +// WIN64: define dso_local void @"?small_with_vftable_return@@YA?AUSmallWithVftable@@XZ"(%struct.SmallWithVftable* noalias sret %agg.result) MediumWithCopyCtor medium_with_copy_ctor_return() { return MediumWithCopyCtor(); } // LINUX-LABEL: define void @_Z28medium_with_copy_ctor_returnv(%struct.MediumWithCopyCtor* noalias sret %agg.result) -// WIN32: define void @"\01?medium_with_copy_ctor_return@@YA?AUMediumWithCopyCtor@@XZ"(%struct.MediumWithCopyCtor* noalias sret %agg.result) -// WIN64: define void @"\01?medium_with_copy_ctor_return@@YA?AUMediumWithCopyCtor@@XZ"(%struct.MediumWithCopyCtor* noalias sret %agg.result) -// WOA: define arm_aapcs_vfpcc void @"\01?medium_with_copy_ctor_return@@YA?AUMediumWithCopyCtor@@XZ"(%struct.MediumWithCopyCtor* noalias sret %agg.result) +// WIN32: define dso_local void @"?medium_with_copy_ctor_return@@YA?AUMediumWithCopyCtor@@XZ"(%struct.MediumWithCopyCtor* noalias sret %agg.result) +// WIN64: define dso_local void @"?medium_with_copy_ctor_return@@YA?AUMediumWithCopyCtor@@XZ"(%struct.MediumWithCopyCtor* noalias sret %agg.result) +// WOA: define dso_local arm_aapcs_vfpcc void @"?medium_with_copy_ctor_return@@YA?AUMediumWithCopyCtor@@XZ"(%struct.MediumWithCopyCtor* noalias sret %agg.result) // Returning a large struct that doesn't fit into a register. Big big_return() { return Big(); } // LINUX-LABEL: define void @_Z10big_returnv(%struct.Big* noalias sret %agg.result) -// WIN32: define void @"\01?big_return@@YA?AUBig@@XZ"(%struct.Big* noalias sret %agg.result) -// WIN64: define void @"\01?big_return@@YA?AUBig@@XZ"(%struct.Big* noalias sret %agg.result) +// WIN32: define dso_local void @"?big_return@@YA?AUBig@@XZ"(%struct.Big* noalias sret %agg.result) +// WIN64: define dso_local void @"?big_return@@YA?AUBig@@XZ"(%struct.Big* noalias sret %agg.result) void small_arg(Small s) {} // LINUX-LABEL: define void @_Z9small_arg5Small(i32 %s.0) -// WIN32: define void @"\01?small_arg@@YAXUSmall@@@Z"(i32 %s.0) -// WIN64: define void @"\01?small_arg@@YAXUSmall@@@Z"(i32 %s.coerce) -// WOA: define arm_aapcs_vfpcc void @"\01?small_arg@@YAXUSmall@@@Z"([1 x i32] %s.coerce) +// WIN32: define dso_local void @"?small_arg@@YAXUSmall@@@Z"(i32 %s.0) +// WIN64: define dso_local void @"?small_arg@@YAXUSmall@@@Z"(i32 %s.coerce) +// WOA: define dso_local arm_aapcs_vfpcc void @"?small_arg@@YAXUSmall@@@Z"([1 x i32] %s.coerce) void medium_arg(Medium s) {} // LINUX-LABEL: define void @_Z10medium_arg6Medium(i32 %s.0, i32 %s.1) -// WIN32: define void @"\01?medium_arg@@YAXUMedium@@@Z"(i32 %s.0, i32 %s.1) -// WIN64: define void @"\01?medium_arg@@YAXUMedium@@@Z"(i64 %s.coerce) -// WOA: define arm_aapcs_vfpcc void @"\01?medium_arg@@YAXUMedium@@@Z"([2 x i32] %s.coerce) +// WIN32: define dso_local void @"?medium_arg@@YAXUMedium@@@Z"(i32 %s.0, i32 %s.1) +// WIN64: define dso_local void @"?medium_arg@@YAXUMedium@@@Z"(i64 %s.coerce) +// WOA: define dso_local arm_aapcs_vfpcc void @"?medium_arg@@YAXUMedium@@@Z"([2 x i32] %s.coerce) void base_no_byval_arg(BaseNoByval s) {} // LINUX-LABEL: define void @_Z17base_no_byval_arg11BaseNoByval(%struct.BaseNoByval* byval align 4 %s) -// WIN32: define void @"\01?base_no_byval_arg@@YAXUBaseNoByval@@@Z"(i32 %s.0, i32 %s.1) -// WIN64: define void @"\01?base_no_byval_arg@@YAXUBaseNoByval@@@Z"(i64 %s.coerce) -// WOA: define arm_aapcs_vfpcc void @"\01?base_no_byval_arg@@YAXUBaseNoByval@@@Z"([2 x i32] %s.coerce) +// WIN32: define dso_local void @"?base_no_byval_arg@@YAXUBaseNoByval@@@Z"(i32 %s.0, i32 %s.1) +// WIN64: define dso_local void @"?base_no_byval_arg@@YAXUBaseNoByval@@@Z"(i64 %s.coerce) +// WOA: define dso_local arm_aapcs_vfpcc void @"?base_no_byval_arg@@YAXUBaseNoByval@@@Z"([2 x i32] %s.coerce) void small_arg_with_ctor(SmallWithCtor s) {} // LINUX-LABEL: define void @_Z19small_arg_with_ctor13SmallWithCtor(%struct.SmallWithCtor* byval align 4 %s) -// WIN32: define void @"\01?small_arg_with_ctor@@YAXUSmallWithCtor@@@Z"(i32 %s.0) -// WIN64: define void @"\01?small_arg_with_ctor@@YAXUSmallWithCtor@@@Z"(i32 %s.coerce) -// WOA: define arm_aapcs_vfpcc void @"\01?small_arg_with_ctor@@YAXUSmallWithCtor@@@Z"([1 x i32] %s.coerce) +// WIN32: define dso_local void @"?small_arg_with_ctor@@YAXUSmallWithCtor@@@Z"(i32 %s.0) +// WIN64: define dso_local void @"?small_arg_with_ctor@@YAXUSmallWithCtor@@@Z"(i32 %s.coerce) +// WOA: define dso_local arm_aapcs_vfpcc void @"?small_arg_with_ctor@@YAXUSmallWithCtor@@@Z"([1 x i32] %s.coerce) // FIXME: We could coerce to a series of i32s here if we wanted to. void multibyte_arg(Multibyte s) {} // LINUX-LABEL: define void @_Z13multibyte_arg9Multibyte(%struct.Multibyte* byval align 4 %s) -// WIN32: define void @"\01?multibyte_arg@@YAXUMultibyte@@@Z"(%struct.Multibyte* byval align 4 %s) -// WIN64: define void @"\01?multibyte_arg@@YAXUMultibyte@@@Z"(i32 %s.coerce) -// WOA: define arm_aapcs_vfpcc void @"\01?multibyte_arg@@YAXUMultibyte@@@Z"([1 x i32] %s.coerce) +// WIN32: define dso_local void @"?multibyte_arg@@YAXUMultibyte@@@Z"(%struct.Multibyte* byval align 4 %s) +// WIN64: define dso_local void @"?multibyte_arg@@YAXUMultibyte@@@Z"(i32 %s.coerce) +// WOA: define dso_local arm_aapcs_vfpcc void @"?multibyte_arg@@YAXUMultibyte@@@Z"([1 x i32] %s.coerce) void packed_arg(Packed s) {} // LINUX-LABEL: define void @_Z10packed_arg6Packed(%struct.Packed* byval align 4 %s) -// WIN32: define void @"\01?packed_arg@@YAXUPacked@@@Z"(%struct.Packed* byval align 4 %s) -// WIN64: define void @"\01?packed_arg@@YAXUPacked@@@Z"(%struct.Packed* %s) +// WIN32: define dso_local void @"?packed_arg@@YAXUPacked@@@Z"(%struct.Packed* byval align 4 %s) +// WIN64: define dso_local void @"?packed_arg@@YAXUPacked@@@Z"(%struct.Packed* %s) // Test that dtors are invoked in the callee. void small_arg_with_dtor(SmallWithDtor s) {} -// WIN32: define void @"\01?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(<{ %struct.SmallWithDtor }>* inalloca) {{.*}} { -// WIN32: call x86_thiscallcc void @"\01??1SmallWithDtor@@QAE@XZ" +// WIN32: define dso_local void @"?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(<{ %struct.SmallWithDtor }>* inalloca) {{.*}} { +// WIN32: call x86_thiscallcc void @"??1SmallWithDtor@@QAE@XZ" // WIN32: } -// WIN64: define void @"\01?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(i32 %s.coerce) {{.*}} { -// WIN64: call void @"\01??1SmallWithDtor@@QEAA@XZ" +// WIN64: define dso_local void @"?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(i32 %s.coerce) {{.*}} { +// WIN64: call void @"??1SmallWithDtor@@QEAA@XZ" // WIN64: } +// WOA64: define dso_local void @"?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(i64 %s.coerce) {{.*}} { +// WOA64: call void @"??1SmallWithDtor@@QEAA@XZ" +// WOA64: } // FIXME: MSVC incompatible! -// WOA: define arm_aapcs_vfpcc void @"\01?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(%struct.SmallWithDtor* %s) {{.*}} { -// WOA: call arm_aapcs_vfpcc void @"\01??1SmallWithDtor@@QAA@XZ"(%struct.SmallWithDtor* %s) +// WOA: define dso_local arm_aapcs_vfpcc void @"?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(%struct.SmallWithDtor* %s) {{.*}} { +// WOA: call arm_aapcs_vfpcc void @"??1SmallWithDtor@@QAA@XZ"(%struct.SmallWithDtor* %s) // WOA: } void call_small_arg_with_dtor() { small_arg_with_dtor(SmallWithDtor()); } -// The temporary is copied, so it's destroyed in the caller as well as the -// callee. -// WIN64-LABEL: define void @"\01?call_small_arg_with_dtor@@YAXXZ"() -// WIN64: call %struct.SmallWithDtor* @"\01??0SmallWithDtor@@QEAA@XZ" -// WIN64: call void @"\01?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(i32 %{{.*}}) -// WIN64: call void @"\01??1SmallWithDtor@@QEAA@XZ" +// WIN64-LABEL: define dso_local void @"?call_small_arg_with_dtor@@YAXXZ"() +// WIN64: call %struct.SmallWithDtor* @"??0SmallWithDtor@@QEAA@XZ" +// WIN64: call void @"?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(i32 %{{.*}}) // WIN64: ret void // Test that references aren't destroyed in the callee. void ref_small_arg_with_dtor(const SmallWithDtor &s) { } -// WIN32: define void @"\01?ref_small_arg_with_dtor@@YAXABUSmallWithDtor@@@Z"(%struct.SmallWithDtor* dereferenceable({{[0-9]+}}) %s) {{.*}} { -// WIN32-NOT: call x86_thiscallcc void @"\01??1SmallWithDtor@@QAE@XZ" +// WIN32: define dso_local void @"?ref_small_arg_with_dtor@@YAXABUSmallWithDtor@@@Z"(%struct.SmallWithDtor* dereferenceable({{[0-9]+}}) %s) {{.*}} { +// WIN32-NOT: call x86_thiscallcc void @"??1SmallWithDtor@@QAE@XZ" // WIN32: } -// WIN64-LABEL: define void @"\01?ref_small_arg_with_dtor@@YAXAEBUSmallWithDtor@@@Z"(%struct.SmallWithDtor* dereferenceable({{[0-9]+}}) %s) +// WIN64-LABEL: define dso_local void @"?ref_small_arg_with_dtor@@YAXAEBUSmallWithDtor@@@Z"(%struct.SmallWithDtor* dereferenceable({{[0-9]+}}) %s) void big_arg_with_dtor(BigWithDtor s) {} -// WIN64-LABEL: define void @"\01?big_arg_with_dtor@@YAXUBigWithDtor@@@Z"(%struct.BigWithDtor* %s) -// WIN64: call void @"\01??1BigWithDtor@@QEAA@XZ" +// WIN64-LABEL: define dso_local void @"?big_arg_with_dtor@@YAXUBigWithDtor@@@Z"(%struct.BigWithDtor* %s) +// WIN64: call void @"??1BigWithDtor@@QEAA@XZ" // WIN64: } void call_big_arg_with_dtor() { @@ -197,20 +198,20 @@ void call_big_arg_with_dtor() { } // We can elide the copy of the temporary in the caller, because this object is // larger than 8 bytes and is passed indirectly. -// WIN64-LABEL: define void @"\01?call_big_arg_with_dtor@@YAXXZ"() -// WIN64: call %struct.BigWithDtor* @"\01??0BigWithDtor@@QEAA@XZ" -// WIN64: call void @"\01?big_arg_with_dtor@@YAXUBigWithDtor@@@Z"(%struct.BigWithDtor* %{{.*}}) -// WIN64-NOT: call void @"\01??1BigWithDtor@@QEAA@XZ" +// WIN64-LABEL: define dso_local void @"?call_big_arg_with_dtor@@YAXXZ"() +// WIN64: call %struct.BigWithDtor* @"??0BigWithDtor@@QEAA@XZ" +// WIN64: call void @"?big_arg_with_dtor@@YAXUBigWithDtor@@@Z"(%struct.BigWithDtor* %{{.*}}) +// WIN64-NOT: call void @"??1BigWithDtor@@QEAA@XZ" // WIN64: ret void // Test that temporaries passed by reference are destroyed in the caller. void temporary_ref_with_dtor() { ref_small_arg_with_dtor(SmallWithDtor()); } -// WIN32: define void @"\01?temporary_ref_with_dtor@@YAXXZ"() {{.*}} { -// WIN32: call x86_thiscallcc %struct.SmallWithDtor* @"\01??0SmallWithDtor@@QAE@XZ" -// WIN32: call void @"\01?ref_small_arg_with_dtor@@YAXABUSmallWithDtor@@@Z" -// WIN32: call x86_thiscallcc void @"\01??1SmallWithDtor@@QAE@XZ" +// WIN32: define dso_local void @"?temporary_ref_with_dtor@@YAXXZ"() {{.*}} { +// WIN32: call x86_thiscallcc %struct.SmallWithDtor* @"??0SmallWithDtor@@QAE@XZ" +// WIN32: call void @"?ref_small_arg_with_dtor@@YAXABUSmallWithDtor@@@Z" +// WIN32: call x86_thiscallcc void @"??1SmallWithDtor@@QAE@XZ" // WIN32: } void takes_two_by_val_with_dtor(SmallWithDtor a, SmallWithDtor b); @@ -219,28 +220,30 @@ void eh_cleanup_arg_with_dtor() { } // When exceptions are off, we don't have any cleanups. See // microsoft-abi-exceptions.cpp for these cleanups. -// WIN32: define void @"\01?eh_cleanup_arg_with_dtor@@YAXXZ"() {{.*}} { -// WIN32: call x86_thiscallcc %struct.SmallWithDtor* @"\01??0SmallWithDtor@@QAE@XZ" -// WIN32: call x86_thiscallcc %struct.SmallWithDtor* @"\01??0SmallWithDtor@@QAE@XZ" -// WIN32: call void @"\01?takes_two_by_val_with_dtor@@YAXUSmallWithDtor@@0@Z" -// WIN32-NOT: call x86_thiscallcc void @"\01??1SmallWithDtor@@QAE@XZ" +// WIN32: define dso_local void @"?eh_cleanup_arg_with_dtor@@YAXXZ"() {{.*}} { +// WIN32: call x86_thiscallcc %struct.SmallWithDtor* @"??0SmallWithDtor@@QAE@XZ" +// WIN32: call x86_thiscallcc %struct.SmallWithDtor* @"??0SmallWithDtor@@QAE@XZ" +// WIN32: call void @"?takes_two_by_val_with_dtor@@YAXUSmallWithDtor@@0@Z" +// WIN32-NOT: call x86_thiscallcc void @"??1SmallWithDtor@@QAE@XZ" // WIN32: } void small_arg_with_vftable(SmallWithVftable s) {} // LINUX-LABEL: define void @_Z22small_arg_with_vftable16SmallWithVftable(%struct.SmallWithVftable* %s) -// WIN32: define void @"\01?small_arg_with_vftable@@YAXUSmallWithVftable@@@Z"(<{ %struct.SmallWithVftable }>* inalloca) -// WIN64: define void @"\01?small_arg_with_vftable@@YAXUSmallWithVftable@@@Z"(%struct.SmallWithVftable* %s) +// WIN32: define dso_local void @"?small_arg_with_vftable@@YAXUSmallWithVftable@@@Z"(<{ %struct.SmallWithVftable }>* inalloca) +// WIN64: define dso_local void @"?small_arg_with_vftable@@YAXUSmallWithVftable@@@Z"(%struct.SmallWithVftable* %s) +// WOA64: define dso_local void @"?small_arg_with_vftable@@YAXUSmallWithVftable@@@Z"(%struct.SmallWithVftable* %s) void medium_arg_with_copy_ctor(MediumWithCopyCtor s) {} // LINUX-LABEL: define void @_Z25medium_arg_with_copy_ctor18MediumWithCopyCtor(%struct.MediumWithCopyCtor* %s) -// WIN32: define void @"\01?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(<{ %struct.MediumWithCopyCtor }>* inalloca) -// WIN64: define void @"\01?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(%struct.MediumWithCopyCtor* %s) -// WOA: define arm_aapcs_vfpcc void @"\01?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(%struct.MediumWithCopyCtor* %s) +// WIN32: define dso_local void @"?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(<{ %struct.MediumWithCopyCtor }>* inalloca) +// WIN64: define dso_local void @"?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(%struct.MediumWithCopyCtor* %s) +// WOA: define dso_local arm_aapcs_vfpcc void @"?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(%struct.MediumWithCopyCtor* %s) +// WOA64: define dso_local void @"?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(%struct.MediumWithCopyCtor* %s) void big_arg(Big s) {} // LINUX-LABEL: define void @_Z7big_arg3Big(%struct.Big* byval align 4 %s) -// WIN32: define void @"\01?big_arg@@YAXUBig@@@Z"(%struct.Big* byval align 4 %s) -// WIN64: define void @"\01?big_arg@@YAXUBig@@@Z"(%struct.Big* %s) +// WIN32: define dso_local void @"?big_arg@@YAXUBig@@@Z"(%struct.Big* byval align 4 %s) +// WIN64: define dso_local void @"?big_arg@@YAXUBig@@@Z"(%struct.Big* %s) // PR27607: We would attempt to load i32 value out of the reference instead of // just loading the pointer from the struct during argument expansion. @@ -250,8 +253,8 @@ struct RefField { }; void takes_ref_field(RefField s) {} // LINUX-LABEL: define void @_Z15takes_ref_field8RefField(%struct.RefField* byval align 4 %s) -// WIN32: define void @"\01?takes_ref_field@@YAXURefField@@@Z"(i32* %s.0) -// WIN64: define void @"\01?takes_ref_field@@YAXURefField@@@Z"(i64 %s.coerce) +// WIN32: define dso_local void @"?takes_ref_field@@YAXURefField@@@Z"(i32* %s.0) +// WIN64: define dso_local void @"?takes_ref_field@@YAXURefField@@@Z"(i64 %s.coerce) void pass_ref_field() { int x; @@ -259,57 +262,57 @@ void pass_ref_field() { } // LINUX-LABEL: define void @_Z14pass_ref_fieldv() // LINUX: call void @_Z15takes_ref_field8RefField(%struct.RefField* byval align 4 %{{.*}}) -// WIN32-LABEL: define void @"\01?pass_ref_field@@YAXXZ"() -// WIN32: call void @"\01?takes_ref_field@@YAXURefField@@@Z"(i32* %{{.*}}) -// WIN64-LABEL: define void @"\01?pass_ref_field@@YAXXZ"() -// WIN64: call void @"\01?takes_ref_field@@YAXURefField@@@Z"(i64 %{{.*}}) +// WIN32-LABEL: define dso_local void @"?pass_ref_field@@YAXXZ"() +// WIN32: call void @"?takes_ref_field@@YAXURefField@@@Z"(i32* %{{.*}}) +// WIN64-LABEL: define dso_local void @"?pass_ref_field@@YAXXZ"() +// WIN64: call void @"?takes_ref_field@@YAXURefField@@@Z"(i64 %{{.*}}) class Class { public: Small thiscall_method_small() { return Small(); } // LINUX: define {{.*}} void @_ZN5Class21thiscall_method_smallEv(%struct.Small* noalias sret %agg.result, %class.Class* %this) - // WIN32: define {{.*}} x86_thiscallcc void @"\01?thiscall_method_small@Class@@QAE?AUSmall@@XZ"(%class.Class* %this, %struct.Small* noalias sret %agg.result) - // WIN64: define linkonce_odr void @"\01?thiscall_method_small@Class@@QEAA?AUSmall@@XZ"(%class.Class* %this, %struct.Small* noalias sret %agg.result) + // WIN32: define {{.*}} x86_thiscallcc void @"?thiscall_method_small@Class@@QAE?AUSmall@@XZ"(%class.Class* %this, %struct.Small* noalias sret %agg.result) + // WIN64: define linkonce_odr dso_local void @"?thiscall_method_small@Class@@QEAA?AUSmall@@XZ"(%class.Class* %this, %struct.Small* noalias sret %agg.result) SmallWithCtor thiscall_method_small_with_ctor() { return SmallWithCtor(); } // LINUX: define {{.*}} void @_ZN5Class31thiscall_method_small_with_ctorEv(%struct.SmallWithCtor* noalias sret %agg.result, %class.Class* %this) - // WIN32: define {{.*}} x86_thiscallcc void @"\01?thiscall_method_small_with_ctor@Class@@QAE?AUSmallWithCtor@@XZ"(%class.Class* %this, %struct.SmallWithCtor* noalias sret %agg.result) - // WIN64: define linkonce_odr void @"\01?thiscall_method_small_with_ctor@Class@@QEAA?AUSmallWithCtor@@XZ"(%class.Class* %this, %struct.SmallWithCtor* noalias sret %agg.result) + // WIN32: define {{.*}} x86_thiscallcc void @"?thiscall_method_small_with_ctor@Class@@QAE?AUSmallWithCtor@@XZ"(%class.Class* %this, %struct.SmallWithCtor* noalias sret %agg.result) + // WIN64: define linkonce_odr dso_local void @"?thiscall_method_small_with_ctor@Class@@QEAA?AUSmallWithCtor@@XZ"(%class.Class* %this, %struct.SmallWithCtor* noalias sret %agg.result) Small __cdecl cdecl_method_small() { return Small(); } // LINUX: define {{.*}} void @_ZN5Class18cdecl_method_smallEv(%struct.Small* noalias sret %agg.result, %class.Class* %this) - // WIN32: define {{.*}} void @"\01?cdecl_method_small@Class@@QAA?AUSmall@@XZ"(%class.Class* %this, %struct.Small* noalias sret %agg.result) - // WIN64: define linkonce_odr void @"\01?cdecl_method_small@Class@@QEAA?AUSmall@@XZ"(%class.Class* %this, %struct.Small* noalias sret %agg.result) + // WIN32: define {{.*}} void @"?cdecl_method_small@Class@@QAA?AUSmall@@XZ"(%class.Class* %this, %struct.Small* noalias sret %agg.result) + // WIN64: define linkonce_odr dso_local void @"?cdecl_method_small@Class@@QEAA?AUSmall@@XZ"(%class.Class* %this, %struct.Small* noalias sret %agg.result) Big __cdecl cdecl_method_big() { return Big(); } // LINUX: define {{.*}} void @_ZN5Class16cdecl_method_bigEv(%struct.Big* noalias sret %agg.result, %class.Class* %this) - // WIN32: define {{.*}} void @"\01?cdecl_method_big@Class@@QAA?AUBig@@XZ"(%class.Class* %this, %struct.Big* noalias sret %agg.result) - // WIN64: define linkonce_odr void @"\01?cdecl_method_big@Class@@QEAA?AUBig@@XZ"(%class.Class* %this, %struct.Big* noalias sret %agg.result) + // WIN32: define {{.*}} void @"?cdecl_method_big@Class@@QAA?AUBig@@XZ"(%class.Class* %this, %struct.Big* noalias sret %agg.result) + // WIN64: define linkonce_odr dso_local void @"?cdecl_method_big@Class@@QEAA?AUBig@@XZ"(%class.Class* %this, %struct.Big* noalias sret %agg.result) void thiscall_method_arg(Empty s) {} // LINUX: define {{.*}} void @_ZN5Class19thiscall_method_argE5Empty(%class.Class* %this) - // WIN32: define {{.*}} void @"\01?thiscall_method_arg@Class@@QAEXUEmpty@@@Z"(%class.Class* %this, %struct.Empty* byval align 4 %s) - // WIN64: define linkonce_odr void @"\01?thiscall_method_arg@Class@@QEAAXUEmpty@@@Z"(%class.Class* %this, i8 %s.coerce) + // WIN32: define {{.*}} void @"?thiscall_method_arg@Class@@QAEXUEmpty@@@Z"(%class.Class* %this, %struct.Empty* byval align 4 %s) + // WIN64: define linkonce_odr dso_local void @"?thiscall_method_arg@Class@@QEAAXUEmpty@@@Z"(%class.Class* %this, i8 %s.coerce) void thiscall_method_arg(EmptyWithCtor s) {} // LINUX: define {{.*}} void @_ZN5Class19thiscall_method_argE13EmptyWithCtor(%class.Class* %this) - // WIN32: define {{.*}} void @"\01?thiscall_method_arg@Class@@QAEXUEmptyWithCtor@@@Z"(%class.Class* %this, %struct.EmptyWithCtor* byval align 4 %s) - // WIN64: define linkonce_odr void @"\01?thiscall_method_arg@Class@@QEAAXUEmptyWithCtor@@@Z"(%class.Class* %this, i8 %s.coerce) + // WIN32: define {{.*}} void @"?thiscall_method_arg@Class@@QAEXUEmptyWithCtor@@@Z"(%class.Class* %this, %struct.EmptyWithCtor* byval align 4 %s) + // WIN64: define linkonce_odr dso_local void @"?thiscall_method_arg@Class@@QEAAXUEmptyWithCtor@@@Z"(%class.Class* %this, i8 %s.coerce) void thiscall_method_arg(Small s) {} // LINUX: define {{.*}} void @_ZN5Class19thiscall_method_argE5Small(%class.Class* %this, i32 %s.0) - // WIN32: define {{.*}} void @"\01?thiscall_method_arg@Class@@QAEXUSmall@@@Z"(%class.Class* %this, i32 %s.0) - // WIN64: define linkonce_odr void @"\01?thiscall_method_arg@Class@@QEAAXUSmall@@@Z"(%class.Class* %this, i32 %s.coerce) + // WIN32: define {{.*}} void @"?thiscall_method_arg@Class@@QAEXUSmall@@@Z"(%class.Class* %this, i32 %s.0) + // WIN64: define linkonce_odr dso_local void @"?thiscall_method_arg@Class@@QEAAXUSmall@@@Z"(%class.Class* %this, i32 %s.coerce) void thiscall_method_arg(SmallWithCtor s) {} // LINUX: define {{.*}} void @_ZN5Class19thiscall_method_argE13SmallWithCtor(%class.Class* %this, %struct.SmallWithCtor* byval align 4 %s) - // WIN32: define {{.*}} void @"\01?thiscall_method_arg@Class@@QAEXUSmallWithCtor@@@Z"(%class.Class* %this, i32 %s.0) - // WIN64: define linkonce_odr void @"\01?thiscall_method_arg@Class@@QEAAXUSmallWithCtor@@@Z"(%class.Class* %this, i32 %s.coerce) + // WIN32: define {{.*}} void @"?thiscall_method_arg@Class@@QAEXUSmallWithCtor@@@Z"(%class.Class* %this, i32 %s.0) + // WIN64: define linkonce_odr dso_local void @"?thiscall_method_arg@Class@@QEAAXUSmallWithCtor@@@Z"(%class.Class* %this, i32 %s.coerce) void thiscall_method_arg(Big s) {} // LINUX: define {{.*}} void @_ZN5Class19thiscall_method_argE3Big(%class.Class* %this, %struct.Big* byval align 4 %s) - // WIN32: define {{.*}} void @"\01?thiscall_method_arg@Class@@QAEXUBig@@@Z"(%class.Class* %this, %struct.Big* byval align 4 %s) - // WIN64: define linkonce_odr void @"\01?thiscall_method_arg@Class@@QEAAXUBig@@@Z"(%class.Class* %this, %struct.Big* %s) + // WIN32: define {{.*}} void @"?thiscall_method_arg@Class@@QAEXUBig@@@Z"(%class.Class* %this, %struct.Big* byval align 4 %s) + // WIN64: define linkonce_odr dso_local void @"?thiscall_method_arg@Class@@QEAAXUBig@@@Z"(%class.Class* %this, %struct.Big* %s) }; void use_class() { @@ -333,14 +336,14 @@ struct X { }; void g(X) { } -// WIN32: define void @"\01?g@@YAXUX@@@Z"(<{ %struct.X, [3 x i8] }>* inalloca) {{.*}} { -// WIN32: call x86_thiscallcc void @"\01??1X@@QAE@XZ"(%struct.X* {{.*}}) +// WIN32: define dso_local void @"?g@@YAXUX@@@Z"(<{ %struct.X, [3 x i8] }>* inalloca) {{.*}} { +// WIN32: call x86_thiscallcc void @"??1X@@QAE@XZ"(%struct.X* {{.*}}) // WIN32: } void f() { g(X()); } -// WIN32: define void @"\01?f@@YAXXZ"() {{.*}} { -// WIN32-NOT: call {{.*}} @"\01??1X@@QAE@XZ" +// WIN32: define dso_local void @"?f@@YAXXZ"() {{.*}} { +// WIN32-NOT: call {{.*}} @"??1X@@QAE@XZ" // WIN32: } @@ -362,13 +365,13 @@ void bar() { b.b = 13; int c = foo(NonTrivial(), b); } -// WIN32-LABEL: define void @"\01?bar@test2@@YAXXZ"() {{.*}} { +// WIN32-LABEL: define dso_local void @"?bar@test2@@YAXXZ"() {{.*}} { // WIN32: %[[argmem:[^ ]*]] = alloca inalloca [[argmem_ty:<{ %"struct.test2::NonTrivial", %"struct.test2::POD" }>]] // WIN32: getelementptr inbounds [[argmem_ty]], [[argmem_ty]]* %[[argmem]], i32 0, i32 1 // WIN32: call void @llvm.memcpy // WIN32: getelementptr inbounds [[argmem_ty]], [[argmem_ty]]* %[[argmem]], i32 0, i32 0 -// WIN32: call x86_thiscallcc %"struct.test2::NonTrivial"* @"\01??0NonTrivial@test2@@QAE@XZ" -// WIN32: call i32 @"\01?foo@test2@@YAHUNonTrivial@1@UPOD@1@@Z"([[argmem_ty]]* inalloca %argmem) +// WIN32: call x86_thiscallcc %"struct.test2::NonTrivial"* @"??0NonTrivial@test2@@QAE@XZ" +// WIN32: call i32 @"?foo@test2@@YAHUNonTrivial@1@UPOD@1@@Z"([[argmem_ty]]* inalloca %argmem) // WIN32: ret void // WIN32: } @@ -384,7 +387,7 @@ struct NonTrivial { int a; }; void foo(NonTrivial a, bool b) { } -// WIN32-LABEL: define void @"\01?foo@test3@@YAXUNonTrivial@1@_N@Z"(<{ %"struct.test3::NonTrivial", i8, [3 x i8] }>* inalloca) +// WIN32-LABEL: define dso_local void @"?foo@test3@@YAXUNonTrivial@1@_N@Z"(<{ %"struct.test3::NonTrivial", i8, [3 x i8] }>* inalloca) } @@ -399,18 +402,18 @@ void fn1(FnPtr1 a, SmallWithDtor b) { } struct ForwardDeclare1 {}; void fn2(FnPtr1 a, SmallWithDtor b) { fn1(a, b); }; -// WIN32-LABEL: define void @"\01?fn2@@YAXP6AXUForwardDeclare1@@@ZUSmallWithDtor@@@Z" +// WIN32-LABEL: define dso_local void @"?fn2@@YAXP6AXUForwardDeclare1@@@ZUSmallWithDtor@@@Z" // WIN32: %[[a:[^ ]*]] = getelementptr inbounds [[argmem_ty:<{ {}\*, %struct.SmallWithDtor }>]], [[argmem_ty:<{ {}\*, %struct.SmallWithDtor }>]]* %{{.*}}, i32 0, i32 0 // WIN32: %[[a1:[^ ]*]] = bitcast {}** %[[a]] to void [[dst_ty:\(%struct.ForwardDeclare1\*\)\*]]* // WIN32: %[[argmem:[^ ]*]] = alloca inalloca [[argmem_ty]] // WIN32: %[[gep1:[^ ]*]] = getelementptr inbounds [[argmem_ty]], [[argmem_ty]]* %[[argmem]], i32 0, i32 1 // WIN32: %[[bc1:[^ ]*]] = bitcast %struct.SmallWithDtor* %[[gep1]] to i8* -// WIN32: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[bc1]], i8* {{.*}}, i32 4, i32 4, i1 false) +// WIN32: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %[[bc1]], i8* align 4 {{.*}}, i32 4, i1 false) // WIN32: %[[a2:[^ ]*]] = load void [[dst_ty]], void [[dst_ty]]* %[[a1]], align 4 // WIN32: %[[gep2:[^ ]*]] = getelementptr inbounds [[argmem_ty]], [[argmem_ty]]* %[[argmem]], i32 0, i32 0 // WIN32: %[[addr:[^ ]*]] = bitcast {}** %[[gep2]] to void [[dst_ty]]* // WIN32: store void [[dst_ty]] %[[a2]], void [[dst_ty]]* %[[addr]], align 4 -// WIN32: call void @"\01?fn1@@YAXP6AXUForwardDeclare1@@@ZUSmallWithDtor@@@Z"([[argmem_ty]]* inalloca %[[argmem]]) +// WIN32: call void @"?fn1@@YAXP6AXUForwardDeclare1@@@ZUSmallWithDtor@@@Z"([[argmem_ty]]* inalloca %[[argmem]]) namespace pr30293 { // Virtual methods living in a secondary vtable take i8* as their 'this' @@ -430,11 +433,11 @@ struct C final : A, B { }; void C::g() { return h(SmallWithDtor()); } -// WIN32-LABEL: define x86_thiscallcc void @"\01?g@C@pr30293@@QAEXXZ"(%"struct.pr30293::C"* %this) -// WIN32: call x86_thiscallcc %struct.SmallWithDtor* @"\01??0SmallWithDtor@@QAE@XZ" -// WIN32: call void @"\01?h@C@pr30293@@UAAXUSmallWithDtor@@@Z"(<{ i8*, %struct.SmallWithDtor }>* inalloca %{{[^,)]*}}) -// WIN32: declare void @"\01?h@C@pr30293@@UAAXUSmallWithDtor@@@Z"(<{ i8*, %struct.SmallWithDtor }>* inalloca) +// WIN32-LABEL: define dso_local x86_thiscallcc void @"?g@C@pr30293@@QAEXXZ"(%"struct.pr30293::C"* %this) +// WIN32: call x86_thiscallcc %struct.SmallWithDtor* @"??0SmallWithDtor@@QAE@XZ" +// WIN32: call void @"?h@C@pr30293@@UAAXUSmallWithDtor@@@Z"(<{ i8*, %struct.SmallWithDtor }>* inalloca %{{[^,)]*}}) +// WIN32: declare dso_local void @"?h@C@pr30293@@UAAXUSmallWithDtor@@@Z"(<{ i8*, %struct.SmallWithDtor }>* inalloca) -// WIN64-LABEL: define void @"\01?g@C@pr30293@@QEAAXXZ"(%"struct.pr30293::C"* %this) -// WIN64: declare void @"\01?h@C@pr30293@@UEAAXUSmallWithDtor@@@Z"(i8*, i32) +// WIN64-LABEL: define dso_local void @"?g@C@pr30293@@QEAAXXZ"(%"struct.pr30293::C"* %this) +// WIN64: declare dso_local void @"?h@C@pr30293@@UEAAXUSmallWithDtor@@@Z"(i8*, i32) } diff --git a/test/CodeGenCXX/microsoft-abi-static-initializers.cpp b/test/CodeGenCXX/microsoft-abi-static-initializers.cpp index 0b84f07e1154c..db9526633ff11 100644 --- a/test/CodeGenCXX/microsoft-abi-static-initializers.cpp +++ b/test/CodeGenCXX/microsoft-abi-static-initializers.cpp @@ -1,10 +1,10 @@ // RUN: %clang_cc1 -fms-extensions -fno-threadsafe-statics -emit-llvm %s -o - -mconstructor-aliases -triple=i386-pc-win32 | FileCheck %s // CHECK: @llvm.global_ctors = appending global [5 x { i32, void ()*, i8* }] [ -// CHECK: { i32, void ()*, i8* } { i32 65535, void ()* @"\01??__Eselectany1@@YAXXZ", i8* getelementptr inbounds (%struct.S, %struct.S* @"\01?selectany1@@3US@@A", i32 0, i32 0) }, -// CHECK: { i32, void ()*, i8* } { i32 65535, void ()* @"\01??__Eselectany2@@YAXXZ", i8* getelementptr inbounds (%struct.S, %struct.S* @"\01?selectany2@@3US@@A", i32 0, i32 0) }, -// CHECK: { i32, void ()*, i8* } { i32 65535, void ()* @"\01??__Es@?$ExportedTemplate@H@@2US@@A@YAXXZ", i8* getelementptr inbounds (%struct.S, %struct.S* @"\01?s@?$ExportedTemplate@H@@2US@@A", i32 0, i32 0) }, -// CHECK: { i32, void ()*, i8* } { i32 65535, void ()* @"\01??__Efoo@?$B@H@@2VA@@A@YAXXZ", i8* bitcast (%class.A* @"\01?foo@?$B@H@@2VA@@A" to i8*) }, +// CHECK: { i32, void ()*, i8* } { i32 65535, void ()* @"??__Eselectany1@@YAXXZ", i8* getelementptr inbounds (%struct.S, %struct.S* @"?selectany1@@3US@@A", i32 0, i32 0) }, +// CHECK: { i32, void ()*, i8* } { i32 65535, void ()* @"??__Eselectany2@@YAXXZ", i8* getelementptr inbounds (%struct.S, %struct.S* @"?selectany2@@3US@@A", i32 0, i32 0) }, +// CHECK: { i32, void ()*, i8* } { i32 65535, void ()* @"??__Es@?$ExportedTemplate@H@@2US@@A@YAXXZ", i8* getelementptr inbounds (%struct.S, %struct.S* @"?s@?$ExportedTemplate@H@@2US@@A", i32 0, i32 0) }, +// CHECK: { i32, void ()*, i8* } { i32 65535, void ()* @"??__Efoo@?$B@H@@2VA@@A@YAXXZ", i8* bitcast (%class.A* @"?foo@?$B@H@@2VA@@A" to i8*) }, // CHECK: { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_microsoft_abi_static_initializers.cpp, i8* null } // CHECK: ] @@ -15,26 +15,26 @@ struct S { S s; -// CHECK: define internal void @"\01??__Es@@YAXXZ"() -// CHECK: call x86_thiscallcc %struct.S* @"\01??0S@@QAE@XZ" -// CHECK: call i32 @atexit(void ()* @"\01??__Fs@@YAXXZ") +// CHECK: define internal void @"??__Es@@YAXXZ"() +// CHECK: call x86_thiscallcc %struct.S* @"??0S@@QAE@XZ" +// CHECK: call i32 @atexit(void ()* @"??__Fs@@YAXXZ") // CHECK: ret void -// CHECK: define internal void @"\01??__Fs@@YAXXZ"() -// CHECK: call x86_thiscallcc void @"\01??1S@@QAE@XZ" +// CHECK: define internal void @"??__Fs@@YAXXZ"() +// CHECK: call x86_thiscallcc void @"??1S@@QAE@XZ" // CHECK: ret void // These globals should have initializers comdat associative with the global. // See @llvm.global_ctors above. __declspec(selectany) S selectany1; __declspec(selectany) S selectany2; -// CHECK: define linkonce_odr void @"\01??__Eselectany1@@YAXXZ"() {{.*}} comdat -// CHECK-NOT: @"\01??_Bselectany1 -// CHECK: call x86_thiscallcc %struct.S* @"\01??0S@@QAE@XZ" +// CHECK: define linkonce_odr dso_local void @"??__Eselectany1@@YAXXZ"() {{.*}} comdat +// CHECK-NOT: @"??_Bselectany1 +// CHECK: call x86_thiscallcc %struct.S* @"??0S@@QAE@XZ" // CHECK: ret void -// CHECK: define linkonce_odr void @"\01??__Eselectany2@@YAXXZ"() {{.*}} comdat -// CHECK-NOT: @"\01??_Bselectany2 -// CHECK: call x86_thiscallcc %struct.S* @"\01??0S@@QAE@XZ" +// CHECK: define linkonce_odr dso_local void @"??__Eselectany2@@YAXXZ"() {{.*}} comdat +// CHECK-NOT: @"??_Bselectany2 +// CHECK: call x86_thiscallcc %struct.S* @"??0S@@QAE@XZ" // CHECK: ret void // The implicitly instantiated static data member should have initializer @@ -51,9 +51,9 @@ void StaticLocal() { static S TheS; } -// CHECK-LABEL: define void @"\01?StaticLocal@@YAXXZ"() -// CHECK: load i32, i32* @"\01?$S1@?1??StaticLocal@@YAXXZ@4IA" -// CHECK: store i32 {{.*}}, i32* @"\01?$S1@?1??StaticLocal@@YAXXZ@4IA" +// CHECK-LABEL: define dso_local void @"?StaticLocal@@YAXXZ"() +// CHECK: load i32, i32* @"?$S1@?1??StaticLocal@@YAXXZ@4IA" +// CHECK: store i32 {{.*}}, i32* @"?$S1@?1??StaticLocal@@YAXXZ@4IA" // CHECK: ret void MultipleStatics() { @@ -93,8 +93,8 @@ void MultipleStatics() { static S S34; static S S35; } -// CHECK-LABEL: define void @"\01?MultipleStatics@@YAXXZ"() -// CHECK: load i32, i32* @"\01?$S1@?1??MultipleStatics@@YAXXZ@4IA" +// CHECK-LABEL: define dso_local void @"?MultipleStatics@@YAXXZ"() +// CHECK: load i32, i32* @"?$S1@?1??MultipleStatics@@YAXXZ@4IA" // CHECK: and i32 {{.*}}, 1 // CHECK: and i32 {{.*}}, 2 // CHECK: and i32 {{.*}}, 4 @@ -102,7 +102,7 @@ void MultipleStatics() { // CHECK: and i32 {{.*}}, 16 // ... // CHECK: and i32 {{.*}}, -2147483648 -// CHECK: load i32, i32* @"\01?$S1@?1??MultipleStatics@@YAXXZ@4IA.1" +// CHECK: load i32, i32* @"?$S1@?1??MultipleStatics@@YAXXZ@4IA.1" // CHECK: and i32 {{.*}}, 1 // CHECK: and i32 {{.*}}, 2 // CHECK: and i32 {{.*}}, 4 @@ -133,7 +133,7 @@ inline S &UnreachableStatic() { return s; } -// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.S* @"\01?UnreachableStatic@@YAAAUS@@XZ"() {{.*}} comdat +// CHECK-LABEL: define linkonce_odr dso_local dereferenceable({{[0-9]+}}) %struct.S* @"?UnreachableStatic@@YAAAUS@@XZ"() {{.*}} comdat // CHECK: and i32 {{.*}}, 2 // CHECK: or i32 {{.*}}, 2 // CHECK: ret @@ -143,54 +143,54 @@ inline S &getS() { return TheS; } -// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.S* @"\01?getS@@YAAAUS@@XZ"() {{.*}} comdat -// CHECK: load i32, i32* @"\01??_B?1??getS@@YAAAUS@@XZ@51" +// CHECK-LABEL: define linkonce_odr dso_local dereferenceable({{[0-9]+}}) %struct.S* @"?getS@@YAAAUS@@XZ"() {{.*}} comdat +// CHECK: load i32, i32* @"??_B?1??getS@@YAAAUS@@XZ@51" // CHECK: and i32 {{.*}}, 1 // CHECK: icmp eq i32 {{.*}}, 0 // CHECK: br i1 // init: // CHECK: or i32 {{.*}}, 1 -// CHECK: store i32 {{.*}}, i32* @"\01??_B?1??getS@@YAAAUS@@XZ@51" -// CHECK: call x86_thiscallcc %struct.S* @"\01??0S@@QAE@XZ"(%struct.S* @"\01?TheS@?1??getS@@YAAAUS@@XZ@4U2@A") -// CHECK: call i32 @atexit(void ()* @"\01??__FTheS@?1??getS@@YAAAUS@@XZ@YAXXZ") +// CHECK: store i32 {{.*}}, i32* @"??_B?1??getS@@YAAAUS@@XZ@51" +// CHECK: call x86_thiscallcc %struct.S* @"??0S@@QAE@XZ"(%struct.S* @"?TheS@?1??getS@@YAAAUS@@XZ@4U2@A") +// CHECK: call i32 @atexit(void ()* @"??__FTheS@?1??getS@@YAAAUS@@XZ@YAXXZ") // CHECK: br label // init.end: -// CHECK: ret %struct.S* @"\01?TheS@?1??getS@@YAAAUS@@XZ@4U2@A" +// CHECK: ret %struct.S* @"?TheS@?1??getS@@YAAAUS@@XZ@4U2@A" inline int enum_in_function() { - // CHECK-LABEL: define linkonce_odr i32 @"\01?enum_in_function@@YAHXZ"() {{.*}} comdat + // CHECK-LABEL: define linkonce_odr dso_local i32 @"?enum_in_function@@YAHXZ"() {{.*}} comdat static enum e { foo, bar, baz } x; - // CHECK: @"\01?x@?1??enum_in_function@@YAHXZ@4W4e@?1??1@YAHXZ@A" + // CHECK: @"?x@?1??enum_in_function@@YAHXZ@4W4e@?1??1@YAHXZ@A" static int y; - // CHECK: @"\01?y@?1??enum_in_function@@YAHXZ@4HA" + // CHECK: @"?y@?1??enum_in_function@@YAHXZ@4HA" return x + y; }; struct T { enum e { foo, bar, baz }; int enum_in_struct() { - // CHECK-LABEL: define linkonce_odr x86_thiscallcc i32 @"\01?enum_in_struct@T@@QAEHXZ"({{.*}}) {{.*}} comdat + // CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc i32 @"?enum_in_struct@T@@QAEHXZ"({{.*}}) {{.*}} comdat static int x; - // CHECK: @"\01?x@?1??enum_in_struct@T@@QAEHXZ@4HA" + // CHECK: @"?x@?1??enum_in_struct@T@@QAEHXZ@4HA" return x++; } }; inline int switch_test(int x) { - // CHECK-LABEL: define linkonce_odr i32 @"\01?switch_test@@YAHH@Z"(i32 %x) {{.*}} comdat + // CHECK-LABEL: define linkonce_odr dso_local i32 @"?switch_test@@YAHH@Z"(i32 %x) {{.*}} comdat switch (x) { static int a; - // CHECK: @"\01?a@?3??switch_test@@YAHH@Z@4HA" + // CHECK: @"?a@?3??switch_test@@YAHH@Z@4HA" case 0: a++; return 1; case 1: static int b; - // CHECK: @"\01?b@?3??switch_test@@YAHH@Z@4HA" + // CHECK: @"?b@?3??switch_test@@YAHH@Z@4HA" return b++; case 2: { static int c; - // CHECK: @"\01?c@?4??switch_test@@YAHH@Z@4HA" + // CHECK: @"?c@?4??switch_test@@YAHH@Z@4HA" return b + c++; } }; @@ -198,8 +198,8 @@ inline int switch_test(int x) { int f(); inline void switch_test2() { - // CHECK-LABEL: define linkonce_odr void @"\01?switch_test2@@YAXXZ"() {{.*}} comdat - // CHECK: @"\01?x@?2??switch_test2@@YAXXZ@4HA" + // CHECK-LABEL: define linkonce_odr dso_local void @"?switch_test2@@YAXXZ"() {{.*}} comdat + // CHECK: @"?x@?2??switch_test2@@YAXXZ@4HA" switch (1) default: static int x = f(); } @@ -213,9 +213,9 @@ namespace DynamicDLLImportInitVSMangling { template struct __declspec(dllimport) A<int>; inline int switch_test3() { - // CHECK-LABEL: define linkonce_odr i32 @"\01?switch_test3@DynamicDLLImportInitVSMangling@@YAHXZ"() {{.*}} comdat + // CHECK-LABEL: define linkonce_odr dso_local i32 @"?switch_test3@DynamicDLLImportInitVSMangling@@YAHXZ"() {{.*}} comdat static int local; - // CHECK: @"\01?local@?1??switch_test3@DynamicDLLImportInitVSMangling@@YAHXZ@4HA" + // CHECK: @"?local@?1??switch_test3@DynamicDLLImportInitVSMangling@@YAHXZ@4HA" return local++; } } @@ -231,21 +231,21 @@ void force_usage() { DynamicDLLImportInitVSMangling::switch_test3(); } -// CHECK: define linkonce_odr void @"\01??__Efoo@?$B@H@@2VA@@A@YAXXZ"() {{.*}} comdat +// CHECK: define linkonce_odr dso_local void @"??__Efoo@?$B@H@@2VA@@A@YAXXZ"() {{.*}} comdat // CHECK-NOT: and // CHECK-NOT: ?_Bfoo@ -// CHECK: call x86_thiscallcc %class.A* @"\01??0A@@QAE@XZ" -// CHECK: call i32 @atexit(void ()* @"\01??__Ffoo@?$B@H@@2VA@@A@YAXXZ") +// CHECK: call x86_thiscallcc %class.A* @"??0A@@QAE@XZ" +// CHECK: call i32 @atexit(void ()* @"??__Ffoo@?$B@H@@2VA@@A@YAXXZ") // CHECK: ret void -// CHECK: define linkonce_odr x86_thiscallcc %class.A* @"\01??0A@@QAE@XZ"({{.*}}) {{.*}} comdat +// CHECK: define linkonce_odr dso_local x86_thiscallcc %class.A* @"??0A@@QAE@XZ"({{.*}}) {{.*}} comdat -// CHECK: define linkonce_odr x86_thiscallcc void @"\01??1A@@QAE@XZ"({{.*}}) {{.*}} comdat +// CHECK: define linkonce_odr dso_local x86_thiscallcc void @"??1A@@QAE@XZ"({{.*}}) {{.*}} comdat -// CHECK: define internal void @"\01??__Ffoo@?$B@H@@2VA@@A@YAXXZ" -// CHECK: call x86_thiscallcc void @"\01??1A@@QAE@XZ"{{.*}}foo +// CHECK: define internal void @"??__Ffoo@?$B@H@@2VA@@A@YAXXZ" +// CHECK: call x86_thiscallcc void @"??1A@@QAE@XZ"{{.*}}foo // CHECK: ret void // CHECK: define internal void @_GLOBAL__sub_I_microsoft_abi_static_initializers.cpp() -// CHECK: call void @"\01??__Es@@YAXXZ"() +// CHECK: call void @"??__Es@@YAXXZ"() // CHECK: ret void diff --git a/test/CodeGenCXX/microsoft-abi-structors-alias.cpp b/test/CodeGenCXX/microsoft-abi-structors-alias.cpp index 4eb757af3f8bf..38f7b4c8b58dd 100644 --- a/test/CodeGenCXX/microsoft-abi-structors-alias.cpp +++ b/test/CodeGenCXX/microsoft-abi-structors-alias.cpp @@ -5,7 +5,7 @@ template <typename T> class A { ~A() {} }; template class A<char>; -// CHECK-DAG: define weak_odr x86_thiscallcc void @"\01??1?$A@D@test1@@AAE@XZ" +// CHECK-DAG: define weak_odr dso_local x86_thiscallcc void @"??1?$A@D@test1@@AAE@XZ" } namespace test2 { @@ -22,14 +22,14 @@ B::~B() {} void foo() { B b; } -// CHECK-DAG: @"\01??1B@test2@@UAE@XZ" = alias void (%"struct.test2::B"*), bitcast (void (%"struct.test2::A"*)* @"\01??1A@test2@@UAE@XZ" to void (%"struct.test2::B"*)*) +// CHECK-DAG: @"??1B@test2@@UAE@XZ" = dso_local unnamed_addr alias void (%"struct.test2::B"*), bitcast (void (%"struct.test2::A"*)* @"??1A@test2@@UAE@XZ" to void (%"struct.test2::B"*)*) } namespace test3 { struct A { virtual ~A(); }; A::~A() {} } -// CHECK-DAG: define x86_thiscallcc void @"\01??1A@test3@@UAE@XZ"( +// CHECK-DAG: define dso_local x86_thiscallcc void @"??1A@test3@@UAE@XZ"( namespace test3 { template <typename T> struct B : A { @@ -39,4 +39,4 @@ template struct B<int>; } // This has to be weak, and emitting weak aliases is fragile, so we don't do the // aliasing. -// CHECK-DAG: define weak_odr x86_thiscallcc void @"\01??1?$B@H@test3@@UAE@XZ"( +// CHECK-DAG: define weak_odr dso_local x86_thiscallcc void @"??1?$B@H@test3@@UAE@XZ"( diff --git a/test/CodeGenCXX/microsoft-abi-structors-delayed-template.cpp b/test/CodeGenCXX/microsoft-abi-structors-delayed-template.cpp index f9e188033ca4d..6c4f37052d152 100644 --- a/test/CodeGenCXX/microsoft-abi-structors-delayed-template.cpp +++ b/test/CodeGenCXX/microsoft-abi-structors-delayed-template.cpp @@ -8,5 +8,5 @@ struct ImplicitCtor { }; template <class T> void foo(T t) { new ImplicitCtor; } void bar() { foo(0); } -// CHECK: store {{.*}} @"\01??_7ImplicitCtor@vtable_referenced_from_template@@6B@" +// CHECK: store {{.*}} @"??_7ImplicitCtor@vtable_referenced_from_template@@6B@" } diff --git a/test/CodeGenCXX/microsoft-abi-structors.cpp b/test/CodeGenCXX/microsoft-abi-structors.cpp index 4de6c33466118..97b90ce6b9eb1 100644 --- a/test/CodeGenCXX/microsoft-abi-structors.cpp +++ b/test/CodeGenCXX/microsoft-abi-structors.cpp @@ -20,7 +20,7 @@ class A { void no_constructor_destructor_infinite_recursion() { A a; -// CHECK: define linkonce_odr x86_thiscallcc %"class.basic::A"* @"\01??0A@basic@@QAE@XZ"(%"class.basic::A"* returned %this) {{.*}} comdat {{.*}} { +// CHECK: define linkonce_odr dso_local x86_thiscallcc %"class.basic::A"* @"??0A@basic@@QAE@XZ"(%"class.basic::A"* returned %this) {{.*}} comdat {{.*}} { // CHECK: [[THIS_ADDR:%[.0-9A-Z_a-z]+]] = alloca %"class.basic::A"*, align 4 // CHECK-NEXT: store %"class.basic::A"* %this, %"class.basic::A"** [[THIS_ADDR]], align 4 // CHECK-NEXT: [[T1:%[.0-9A-Z_a-z]+]] = load %"class.basic::A"*, %"class.basic::A"** [[THIS_ADDR]] @@ -30,8 +30,8 @@ void no_constructor_destructor_infinite_recursion() { A::~A() { // Make sure that the destructor doesn't call itself: -// CHECK: define {{.*}} @"\01??1A@basic@@QAE@XZ" -// CHECK-NOT: call void @"\01??1A@basic@@QAE@XZ" +// CHECK: define {{.*}} @"??1A@basic@@QAE@XZ" +// CHECK-NOT: call void @"??1A@basic@@QAE@XZ" // CHECK: ret } @@ -41,23 +41,23 @@ struct B { // Tests that we can define constructors outside the class (PR12784). B::B() { - // CHECK: define x86_thiscallcc %"struct.basic::B"* @"\01??0B@basic@@QAE@XZ"(%"struct.basic::B"* returned %this) + // CHECK: define dso_local x86_thiscallcc %"struct.basic::B"* @"??0B@basic@@QAE@XZ"(%"struct.basic::B"* returned %this) // CHECK: ret } struct C { virtual ~C() { -// DTORS: define linkonce_odr x86_thiscallcc i8* @"\01??_GC@basic@@UAEPAXI@Z"(%"struct.basic::C"* %this, i32 %should_call_delete) {{.*}} comdat {{.*}} { +// DTORS: define linkonce_odr dso_local x86_thiscallcc i8* @"??_GC@basic@@UAEPAXI@Z"(%"struct.basic::C"* %this, i32 %should_call_delete) {{.*}} comdat {{.*}} { // DTORS: store i32 %should_call_delete, i32* %[[SHOULD_DELETE_VAR:[0-9a-z._]+]], align 4 // DTORS: store i8* %{{.*}}, i8** %[[RETVAL:[0-9a-z._]+]] // DTORS: %[[SHOULD_DELETE_VALUE:[0-9a-z._]+]] = load i32, i32* %[[SHOULD_DELETE_VAR]] -// DTORS: call x86_thiscallcc void @"\01??1C@basic@@UAE@XZ"(%"struct.basic::C"* %[[THIS:[0-9a-z]+]]) +// DTORS: call x86_thiscallcc void @"??1C@basic@@UAE@XZ"(%"struct.basic::C"* %[[THIS:[0-9a-z]+]]) // DTORS-NEXT: %[[CONDITION:[0-9]+]] = icmp eq i32 %[[SHOULD_DELETE_VALUE]], 0 // DTORS-NEXT: br i1 %[[CONDITION]], label %[[CONTINUE_LABEL:[0-9a-z._]+]], label %[[CALL_DELETE_LABEL:[0-9a-z._]+]] // // DTORS: [[CALL_DELETE_LABEL]] // DTORS-NEXT: %[[THIS_AS_VOID:[0-9a-z]+]] = bitcast %"struct.basic::C"* %[[THIS]] to i8* -// DTORS-NEXT: call void @"\01??3@YAXPAX@Z"(i8* %[[THIS_AS_VOID]]) +// DTORS-NEXT: call void @"??3@YAXPAX@Z"(i8* %[[THIS_AS_VOID]]) // DTORS-NEXT: br label %[[CONTINUE_LABEL]] // // DTORS: [[CONTINUE_LABEL]] @@ -65,7 +65,7 @@ struct C { // DTORS-NEXT: ret i8* %[[RET]] // Check that we do the mangling correctly on x64. -// DTORS-X64: @"\01??_GC@basic@@UEAAPEAXI@Z" +// DTORS-X64: @"??_GC@basic@@UEAAPEAXI@Z" } virtual void foo(); }; @@ -77,11 +77,11 @@ void check_vftable_offset() { C c; // The vftable pointer should point at the beginning of the vftable. // CHECK: [[THIS_PTR:%[0-9]+]] = bitcast %"struct.basic::C"* {{.*}} to i32 (...)*** -// CHECK: store i32 (...)** bitcast ({ [2 x i8*] }* @"\01??_7C@basic@@6B@" to i32 (...)**), i32 (...)*** [[THIS_PTR]] +// CHECK: store i32 (...)** bitcast ({ [2 x i8*] }* @"??_7C@basic@@6B@" to i32 (...)**), i32 (...)*** [[THIS_PTR]] } void call_complete_dtor(C *obj_ptr) { -// CHECK: define void @"\01?call_complete_dtor@basic@@YAXPAUC@1@@Z"(%"struct.basic::C"* %obj_ptr) +// CHECK: define dso_local void @"?call_complete_dtor@basic@@YAXPAUC@1@@Z"(%"struct.basic::C"* %obj_ptr) obj_ptr->~C(); // CHECK: %[[OBJ_PTR_VALUE:.*]] = load %"struct.basic::C"*, %"struct.basic::C"** %{{.*}}, align 4 // CHECK-NEXT: %[[PVTABLE:.*]] = bitcast %"struct.basic::C"* %[[OBJ_PTR_VALUE]] to i8* (%"struct.basic::C"*, i32)*** @@ -93,7 +93,7 @@ void call_complete_dtor(C *obj_ptr) { } void call_deleting_dtor(C *obj_ptr) { -// CHECK: define void @"\01?call_deleting_dtor@basic@@YAXPAUC@1@@Z"(%"struct.basic::C"* %obj_ptr) +// CHECK: define dso_local void @"?call_deleting_dtor@basic@@YAXPAUC@1@@Z"(%"struct.basic::C"* %obj_ptr) delete obj_ptr; // CHECK: %[[OBJ_PTR_VALUE:.*]] = load %"struct.basic::C"*, %"struct.basic::C"** %{{.*}}, align 4 // CHECK: br i1 {{.*}}, label %[[DELETE_NULL:.*]], label %[[DELETE_NOTNULL:.*]] @@ -108,7 +108,7 @@ void call_deleting_dtor(C *obj_ptr) { } void call_deleting_dtor_and_global_delete(C *obj_ptr) { -// CHECK: define void @"\01?call_deleting_dtor_and_global_delete@basic@@YAXPAUC@1@@Z"(%"struct.basic::C"* %obj_ptr) +// CHECK: define dso_local void @"?call_deleting_dtor_and_global_delete@basic@@YAXPAUC@1@@Z"(%"struct.basic::C"* %obj_ptr) ::delete obj_ptr; // CHECK: %[[OBJ_PTR_VALUE:.*]] = load %"struct.basic::C"*, %"struct.basic::C"** %{{.*}}, align 4 // CHECK: br i1 {{.*}}, label %[[DELETE_NULL:.*]], label %[[DELETE_NOTNULL:.*]] @@ -119,7 +119,7 @@ void call_deleting_dtor_and_global_delete(C *obj_ptr) { // CHECK-NEXT: %[[PVDTOR:.*]] = getelementptr inbounds i8* (%"struct.basic::C"*, i32)*, i8* (%"struct.basic::C"*, i32)** %[[VTABLE]], i64 0 // CHECK-NEXT: %[[VDTOR:.*]] = load i8* (%"struct.basic::C"*, i32)*, i8* (%"struct.basic::C"*, i32)** %[[PVDTOR]] // CHECK-NEXT: %[[CALL:.*]] = call x86_thiscallcc i8* %[[VDTOR]](%"struct.basic::C"* %[[OBJ_PTR_VALUE]], i32 0) -// CHECK-NEXT: call void @"\01??3@YAXPAX@Z"(i8* %[[CALL]]) +// CHECK-NEXT: call void @"??3@YAXPAX@Z"(i8* %[[CALL]]) // CHECK: ret void } @@ -129,12 +129,12 @@ struct D { D() { static int ctor_static = foo(); // CHECK that the static in the ctor gets mangled correctly: - // CHECK: @"\01?ctor_static@?1???0D@basic@@QAE@XZ@4HA" + // CHECK: @"?ctor_static@?1???0D@basic@@QAE@XZ@4HA" } ~D() { static int dtor_static = foo(); // CHECK that the static in the dtor gets mangled correctly: - // CHECK: @"\01?dtor_static@?1???1D@basic@@QAE@XZ@4HA" + // CHECK: @"?dtor_static@?1???1D@basic@@QAE@XZ@4HA" } }; @@ -155,7 +155,7 @@ struct C : A, B { }; C::~C() { -// CHECK-LABEL: define x86_thiscallcc void @"\01??1C@dtor_in_second_nvbase@@UAE@XZ" +// CHECK-LABEL: define dso_local x86_thiscallcc void @"??1C@dtor_in_second_nvbase@@UAE@XZ" // CHECK: (%"struct.dtor_in_second_nvbase::C"* %this) // No this adjustment! // CHECK-NOT: getelementptr @@ -164,7 +164,7 @@ C::~C() { // CHECK: bitcast %"struct.dtor_in_second_nvbase::C"* %{{.*}} to i8* // CHECK: getelementptr inbounds i8, i8* %{{.*}}, i32 4 // CHECK: bitcast i8* %{{.*}} to %"struct.dtor_in_second_nvbase::B"* -// CHECK: call x86_thiscallcc void @"\01??1B@dtor_in_second_nvbase@@UAE@XZ" +// CHECK: call x86_thiscallcc void @"??1B@dtor_in_second_nvbase@@UAE@XZ" // CHECK: (%"struct.dtor_in_second_nvbase::B"* %{{.*}}) // CHECK: ret void } @@ -172,12 +172,12 @@ C::~C() { void foo() { C c; } -// DTORS2-LABEL: define linkonce_odr x86_thiscallcc i8* @"\01??_EC@dtor_in_second_nvbase@@W3AEPAXI@Z" +// DTORS2-LABEL: define linkonce_odr dso_local x86_thiscallcc i8* @"??_EC@dtor_in_second_nvbase@@W3AEPAXI@Z" // DTORS2: (%"struct.dtor_in_second_nvbase::C"* %this, i32 %should_call_delete) // Do an adjustment from B* to C*. // DTORS2: getelementptr i8, i8* %{{.*}}, i32 -4 // DTORS2: bitcast i8* %{{.*}} to %"struct.dtor_in_second_nvbase::C"* -// DTORS2: %[[CALL:.*]] = tail call x86_thiscallcc i8* @"\01??_GC@dtor_in_second_nvbase@@UAEPAXI@Z" +// DTORS2: %[[CALL:.*]] = tail call x86_thiscallcc i8* @"??_GC@dtor_in_second_nvbase@@UAEPAXI@Z" // DTORS2: ret i8* %[[CALL]] } @@ -196,7 +196,7 @@ struct E : virtual C { int e; }; struct F : D, E { ~F(); int f; }; F::~F() { -// CHECK-LABEL: define x86_thiscallcc void @"\01??1F@test2@@UAE@XZ"(%"struct.test2::F"*{{[^,]*}}) +// CHECK-LABEL: define dso_local x86_thiscallcc void @"??1F@test2@@UAE@XZ"(%"struct.test2::F"*{{[^,]*}}) // Do an adjustment from C vbase subobject to F as though F was the // complete type. // CHECK: getelementptr inbounds i8, i8* %{{.*}}, i32 -20 @@ -207,11 +207,11 @@ F::~F() { void foo() { F f; } -// DTORS3-LABEL: define linkonce_odr x86_thiscallcc void @"\01??_DF@test2@@QAEXXZ"({{.*}} {{.*}} comdat +// DTORS3-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"??_DF@test2@@QAEXXZ"({{.*}} {{.*}} comdat // Do an adjustment from C* to F*. // DTORS3: getelementptr i8, i8* %{{.*}}, i32 20 // DTORS3: bitcast i8* %{{.*}} to %"struct.test2::F"* -// DTORS3: call x86_thiscallcc void @"\01??1F@test2@@UAE@XZ" +// DTORS3: call x86_thiscallcc void @"??1F@test2@@UAE@XZ" // DTORS3: ret void } @@ -228,8 +228,8 @@ struct B : A { }; B::B() { - // CHECK: define x86_thiscallcc %"struct.constructors::B"* @"\01??0B@constructors@@QAE@XZ"(%"struct.constructors::B"* returned %this) - // CHECK: call x86_thiscallcc %"struct.constructors::A"* @"\01??0A@constructors@@QAE@XZ"(%"struct.constructors::A"* %{{.*}}) + // CHECK: define dso_local x86_thiscallcc %"struct.constructors::B"* @"??0B@constructors@@QAE@XZ"(%"struct.constructors::B"* returned %this) + // CHECK: call x86_thiscallcc %"struct.constructors::A"* @"??0A@constructors@@QAE@XZ"(%"struct.constructors::A"* %{{.*}}) // CHECK: ret } @@ -238,7 +238,7 @@ struct C : virtual A { }; C::C() { - // CHECK: define x86_thiscallcc %"struct.constructors::C"* @"\01??0C@constructors@@QAE@XZ"(%"struct.constructors::C"* returned %this, i32 %is_most_derived) + // CHECK: define dso_local x86_thiscallcc %"struct.constructors::C"* @"??0C@constructors@@QAE@XZ"(%"struct.constructors::C"* returned %this, i32 %is_most_derived) // TODO: make sure this works in the Release build too; // CHECK: store i32 %is_most_derived, i32* %[[IS_MOST_DERIVED_VAR:.*]], align 4 // CHECK: %[[IS_MOST_DERIVED_VAL:.*]] = load i32, i32* %[[IS_MOST_DERIVED_VAR]] @@ -249,23 +249,23 @@ C::C() { // CHECK-NEXT: %[[this_i8:.*]] = bitcast %"struct.constructors::C"* %{{.*}} to i8* // CHECK-NEXT: %[[vbptr_off:.*]] = getelementptr inbounds i8, i8* %[[this_i8]], i32 0 // CHECK-NEXT: %[[vbptr:.*]] = bitcast i8* %[[vbptr_off]] to i32** - // CHECK-NEXT: store i32* getelementptr inbounds ([2 x i32], [2 x i32]* @"\01??_8C@constructors@@7B@", i32 0, i32 0), i32** %[[vbptr]] + // CHECK-NEXT: store i32* getelementptr inbounds ([2 x i32], [2 x i32]* @"??_8C@constructors@@7B@", i32 0, i32 0), i32** %[[vbptr]] // CHECK-NEXT: bitcast %"struct.constructors::C"* %{{.*}} to i8* // CHECK-NEXT: getelementptr inbounds i8, i8* %{{.*}}, i32 4 // CHECK-NEXT: bitcast i8* %{{.*}} to %"struct.constructors::A"* - // CHECK-NEXT: call x86_thiscallcc %"struct.constructors::A"* @"\01??0A@constructors@@QAE@XZ"(%"struct.constructors::A"* %{{.*}}) + // CHECK-NEXT: call x86_thiscallcc %"struct.constructors::A"* @"??0A@constructors@@QAE@XZ"(%"struct.constructors::A"* %{{.*}}) // CHECK-NEXT: br label %[[SKIP_VBASES]] // // CHECK: [[SKIP_VBASES]] // Class C does not define or override methods, so shouldn't change the vfptr. - // CHECK-NOT: @"\01??_7C@constructors@@6B@" + // CHECK-NOT: @"??_7C@constructors@@6B@" // CHECK: ret } void create_C() { C c; - // CHECK: define void @"\01?create_C@constructors@@YAXXZ"() - // CHECK: call x86_thiscallcc %"struct.constructors::C"* @"\01??0C@constructors@@QAE@XZ"(%"struct.constructors::C"* %c, i32 1) + // CHECK: define dso_local void @"?create_C@constructors@@YAXXZ"() + // CHECK: call x86_thiscallcc %"struct.constructors::C"* @"??0C@constructors@@QAE@XZ"(%"struct.constructors::C"* %c, i32 1) // CHECK: ret } @@ -274,7 +274,7 @@ struct D : C { }; D::D() { - // CHECK: define x86_thiscallcc %"struct.constructors::D"* @"\01??0D@constructors@@QAE@XZ"(%"struct.constructors::D"* returned %this, i32 %is_most_derived) unnamed_addr + // CHECK: define dso_local x86_thiscallcc %"struct.constructors::D"* @"??0D@constructors@@QAE@XZ"(%"struct.constructors::D"* returned %this, i32 %is_most_derived) unnamed_addr // CHECK: store i32 %is_most_derived, i32* %[[IS_MOST_DERIVED_VAR:.*]], align 4 // CHECK: %[[IS_MOST_DERIVED_VAL:.*]] = load i32, i32* %[[IS_MOST_DERIVED_VAR]] // CHECK: %[[SHOULD_CALL_VBASE_CTORS:.*]] = icmp ne i32 %[[IS_MOST_DERIVED_VAL]], 0 @@ -284,15 +284,15 @@ D::D() { // CHECK-NEXT: %[[this_i8:.*]] = bitcast %"struct.constructors::D"* %{{.*}} to i8* // CHECK-NEXT: %[[vbptr_off:.*]] = getelementptr inbounds i8, i8* %[[this_i8]], i32 0 // CHECK-NEXT: %[[vbptr:.*]] = bitcast i8* %[[vbptr_off]] to i32** - // CHECK-NEXT: store i32* getelementptr inbounds ([2 x i32], [2 x i32]* @"\01??_8D@constructors@@7B@", i32 0, i32 0), i32** %[[vbptr]] + // CHECK-NEXT: store i32* getelementptr inbounds ([2 x i32], [2 x i32]* @"??_8D@constructors@@7B@", i32 0, i32 0), i32** %[[vbptr]] // CHECK-NEXT: bitcast %"struct.constructors::D"* %{{.*}} to i8* // CHECK-NEXT: getelementptr inbounds i8, i8* %{{.*}}, i32 4 // CHECK-NEXT: bitcast i8* %{{.*}} to %"struct.constructors::A"* - // CHECK-NEXT: call x86_thiscallcc %"struct.constructors::A"* @"\01??0A@constructors@@QAE@XZ"(%"struct.constructors::A"* %{{.*}}) + // CHECK-NEXT: call x86_thiscallcc %"struct.constructors::A"* @"??0A@constructors@@QAE@XZ"(%"struct.constructors::A"* %{{.*}}) // CHECK-NEXT: br label %[[SKIP_VBASES]] // // CHECK: [[SKIP_VBASES]] - // CHECK: call x86_thiscallcc %"struct.constructors::C"* @"\01??0C@constructors@@QAE@XZ"(%"struct.constructors::C"* %{{.*}}, i32 0) + // CHECK: call x86_thiscallcc %"struct.constructors::C"* @"??0C@constructors@@QAE@XZ"(%"struct.constructors::C"* %{{.*}}, i32 0) // CHECK: ret } @@ -301,7 +301,7 @@ struct E : virtual C { }; E::E() { - // CHECK: define x86_thiscallcc %"struct.constructors::E"* @"\01??0E@constructors@@QAE@XZ"(%"struct.constructors::E"* returned %this, i32 %is_most_derived) unnamed_addr + // CHECK: define dso_local x86_thiscallcc %"struct.constructors::E"* @"??0E@constructors@@QAE@XZ"(%"struct.constructors::E"* returned %this, i32 %is_most_derived) unnamed_addr // CHECK: store i32 %is_most_derived, i32* %[[IS_MOST_DERIVED_VAR:.*]], align 4 // CHECK: %[[IS_MOST_DERIVED_VAL:.*]] = load i32, i32* %[[IS_MOST_DERIVED_VAR]] // CHECK: %[[SHOULD_CALL_VBASE_CTORS:.*]] = icmp ne i32 %[[IS_MOST_DERIVED_VAL]], 0 @@ -311,15 +311,15 @@ E::E() { // CHECK-NEXT: %[[this_i8:.*]] = bitcast %"struct.constructors::E"* %{{.*}} to i8* // CHECK-NEXT: %[[offs:.*]] = getelementptr inbounds i8, i8* %[[this_i8]], i32 0 // CHECK-NEXT: %[[vbptr_E:.*]] = bitcast i8* %[[offs]] to i32** - // CHECK-NEXT: store i32* getelementptr inbounds ([3 x i32], [3 x i32]* @"\01??_8E@constructors@@7B01@@", i32 0, i32 0), i32** %[[vbptr_E]] + // CHECK-NEXT: store i32* getelementptr inbounds ([3 x i32], [3 x i32]* @"??_8E@constructors@@7B01@@", i32 0, i32 0), i32** %[[vbptr_E]] // CHECK-NEXT: %[[offs:.*]] = getelementptr inbounds i8, i8* %[[this_i8]], i32 4 // CHECK-NEXT: %[[vbptr_C:.*]] = bitcast i8* %[[offs]] to i32** - // CHECK-NEXT: store i32* getelementptr inbounds ([2 x i32], [2 x i32]* @"\01??_8E@constructors@@7BC@1@@", i32 0, i32 0), i32** %[[vbptr_C]] + // CHECK-NEXT: store i32* getelementptr inbounds ([2 x i32], [2 x i32]* @"??_8E@constructors@@7BC@1@@", i32 0, i32 0), i32** %[[vbptr_C]] // CHECK-NEXT: bitcast %"struct.constructors::E"* %{{.*}} to i8* // CHECK-NEXT: getelementptr inbounds i8, i8* %{{.*}}, i32 4 // CHECK-NEXT: bitcast i8* %{{.*}} to %"struct.constructors::A"* - // CHECK-NEXT: call x86_thiscallcc %"struct.constructors::A"* @"\01??0A@constructors@@QAE@XZ"(%"struct.constructors::A"* %{{.*}}) - // CHECK: call x86_thiscallcc %"struct.constructors::C"* @"\01??0C@constructors@@QAE@XZ"(%"struct.constructors::C"* %{{.*}}, i32 0) + // CHECK-NEXT: call x86_thiscallcc %"struct.constructors::A"* @"??0A@constructors@@QAE@XZ"(%"struct.constructors::A"* %{{.*}}) + // CHECK: call x86_thiscallcc %"struct.constructors::C"* @"??0C@constructors@@QAE@XZ"(%"struct.constructors::C"* %{{.*}}, i32 0) // CHECK-NEXT: br label %[[SKIP_VBASES]] // // CHECK: [[SKIP_VBASES]] @@ -333,7 +333,7 @@ struct F { }; F::F() {} -// CHECK: define x86_thiscallcc %"struct.constructors::F"* @"\01??0F@constructors@@QAE@XZ" +// CHECK: define dso_local x86_thiscallcc %"struct.constructors::F"* @"??0F@constructors@@QAE@XZ" } // end namespace constructors @@ -345,12 +345,12 @@ struct A { void call_nv_complete(A *a) { a->~A(); -// CHECK: define void @"\01?call_nv_complete@dtors@@YAXPAUA@1@@Z" -// CHECK: call x86_thiscallcc void @"\01??1A@dtors@@QAE@XZ" +// CHECK: define dso_local void @"?call_nv_complete@dtors@@YAXPAUA@1@@Z" +// CHECK: call x86_thiscallcc void @"??1A@dtors@@QAE@XZ" // CHECK: ret } -// CHECK: declare x86_thiscallcc void @"\01??1A@dtors@@QAE@XZ" +// CHECK: declare dso_local x86_thiscallcc void @"??1A@dtors@@QAE@XZ" // Now try some virtual bases, where we need the complete dtor. @@ -360,24 +360,24 @@ struct D : B, C { ~D(); }; void call_vbase_complete(D *d) { d->~D(); -// CHECK: define void @"\01?call_vbase_complete@dtors@@YAXPAUD@1@@Z" -// CHECK: call x86_thiscallcc void @"\01??_DD@dtors@@QAEXXZ"(%"struct.dtors::D"* %{{[^,]+}}) +// CHECK: define dso_local void @"?call_vbase_complete@dtors@@YAXPAUD@1@@Z" +// CHECK: call x86_thiscallcc void @"??_DD@dtors@@QAEXXZ"(%"struct.dtors::D"* %{{[^,]+}}) // CHECK: ret } // The complete dtor should call the base dtors for D and the vbase A (once). -// CHECK: define linkonce_odr x86_thiscallcc void @"\01??_DD@dtors@@QAEXXZ"({{.*}}) {{.*}} comdat +// CHECK: define linkonce_odr dso_local x86_thiscallcc void @"??_DD@dtors@@QAEXXZ"({{.*}}) {{.*}} comdat // CHECK-NOT: call -// CHECK: call x86_thiscallcc void @"\01??1D@dtors@@QAE@XZ" +// CHECK: call x86_thiscallcc void @"??1D@dtors@@QAE@XZ" // CHECK-NOT: call -// CHECK: call x86_thiscallcc void @"\01??1A@dtors@@QAE@XZ" +// CHECK: call x86_thiscallcc void @"??1A@dtors@@QAE@XZ" // CHECK-NOT: call // CHECK: ret void destroy_d_complete() { D d; -// CHECK: define void @"\01?destroy_d_complete@dtors@@YAXXZ" -// CHECK: call x86_thiscallcc void @"\01??_DD@dtors@@QAEXXZ"(%"struct.dtors::D"* %{{[^,]+}}) +// CHECK: define dso_local void @"?destroy_d_complete@dtors@@YAXXZ" +// CHECK: call x86_thiscallcc void @"??_DD@dtors@@QAEXXZ"(%"struct.dtors::D"* %{{[^,]+}}) // CHECK: ret } @@ -386,9 +386,9 @@ void destroy_d_complete() { // a vftable. void call_nv_deleting_dtor(D *d) { delete d; -// CHECK: define void @"\01?call_nv_deleting_dtor@dtors@@YAXPAUD@1@@Z" -// CHECK: call x86_thiscallcc void @"\01??_DD@dtors@@QAEXXZ"(%"struct.dtors::D"* %{{[^,]+}}) -// CHECK: call void @"\01??3@YAXPAX@Z" +// CHECK: define dso_local void @"?call_nv_deleting_dtor@dtors@@YAXPAUD@1@@Z" +// CHECK: call x86_thiscallcc void @"??_DD@dtors@@QAEXXZ"(%"struct.dtors::D"* %{{[^,]+}}) +// CHECK: call void @"??3@YAXPAX@Z" // CHECK: ret } @@ -404,11 +404,11 @@ struct B : virtual A { B::B(int *a) {} B::B(const char *a, ...) {} B::B(short *a) {} -// CHECK: define x86_thiscallcc %"struct.test1::B"* @"\01??0B@test1@@QAE@PAH@Z" +// CHECK: define dso_local x86_thiscallcc %"struct.test1::B"* @"??0B@test1@@QAE@PAH@Z" // CHECK: (%"struct.test1::B"* returned %this, i32* %a, i32 %is_most_derived) -// CHECK: define %"struct.test1::B"* @"\01??0B@test1@@QAA@PBDZZ" +// CHECK: define dso_local %"struct.test1::B"* @"??0B@test1@@QAA@PBDZZ" // CHECK: (%"struct.test1::B"* returned %this, i32 %is_most_derived, i8* %a, ...) -// CHECK: define x86_thiscallcc %"struct.test1::B"* @"\01??0B@test1@@QAE@PAF@Z" +// CHECK: define dso_local x86_thiscallcc %"struct.test1::B"* @"??0B@test1@@QAE@PAF@Z" // CHECK: (%"struct.test1::B"* returned %this, i16* %a, i32 %is_most_derived) void construct_b() { @@ -416,10 +416,10 @@ void construct_b() { B b1(&a); B b2("%d %d", 1, 2); } -// CHECK-LABEL: define void @"\01?construct_b@test1@@YAXXZ"() -// CHECK: call x86_thiscallcc %"struct.test1::B"* @"\01??0B@test1@@QAE@PAH@Z" +// CHECK-LABEL: define dso_local void @"?construct_b@test1@@YAXXZ"() +// CHECK: call x86_thiscallcc %"struct.test1::B"* @"??0B@test1@@QAE@PAH@Z" // CHECK: (%"struct.test1::B"* {{.*}}, i32* {{.*}}, i32 1) -// CHECK: call %"struct.test1::B"* (%"struct.test1::B"*, i32, i8*, ...) @"\01??0B@test1@@QAA@PBDZZ" +// CHECK: call %"struct.test1::B"* (%"struct.test1::B"*, i32, i8*, ...) @"??0B@test1@@QAA@PBDZZ" // CHECK: (%"struct.test1::B"* {{.*}}, i32 1, i8* {{.*}}, i32 1, i32 2) } @@ -432,7 +432,7 @@ struct ImplicitCopy { void CreateCopy(ImplicitCopy *a) { new ImplicitCopy(*a); } -// CHECK: store {{.*}} @"\01??_7ImplicitCopy@implicit_copy_vtable@@6B@" +// CHECK: store {{.*}} @"??_7ImplicitCopy@implicit_copy_vtable@@6B@" struct MoveOnly { MoveOnly(MoveOnly &&o) = default; @@ -440,7 +440,7 @@ struct MoveOnly { }; MoveOnly &&f(); void g() { new MoveOnly(f()); } -// CHECK: store {{.*}} @"\01??_7MoveOnly@implicit_copy_vtable@@6B@" +// CHECK: store {{.*}} @"??_7MoveOnly@implicit_copy_vtable@@6B@" } namespace delegating_ctor { @@ -451,11 +451,11 @@ struct X : virtual Y { }; X::X(int) : X() {} } -// CHECK: define x86_thiscallcc %"struct.delegating_ctor::X"* @"\01??0X@delegating_ctor@@QAE@H@Z"( +// CHECK: define dso_local x86_thiscallcc %"struct.delegating_ctor::X"* @"??0X@delegating_ctor@@QAE@H@Z"( // CHECK: %[[is_most_derived_addr:.*]] = alloca i32, align 4 // CHECK: store i32 %is_most_derived, i32* %[[is_most_derived_addr]] // CHECK: %[[is_most_derived:.*]] = load i32, i32* %[[is_most_derived_addr]] -// CHECK: call x86_thiscallcc {{.*}}* @"\01??0X@delegating_ctor@@QAE@XZ"({{.*}} i32 %[[is_most_derived]]) +// CHECK: call x86_thiscallcc {{.*}}* @"??0X@delegating_ctor@@QAE@XZ"({{.*}} i32 %[[is_most_derived]]) // Dtor thunks for classes in anonymous namespaces should be internal, not // linkonce_odr. @@ -467,9 +467,9 @@ struct A { void *getA() { return (void*)new A(); } -// CHECK: define internal x86_thiscallcc i8* @"\01??_GA@?A@@UAEPAXI@Z" +// CHECK: define internal x86_thiscallcc i8* @"??_GA@?A@@UAEPAXI@Z" // CHECK: (%"struct.(anonymous namespace)::A"* %this, i32 %should_call_delete) -// CHECK: define internal x86_thiscallcc void @"\01??1A@?A@@UAE@XZ" +// CHECK: define internal x86_thiscallcc void @"??1A@?A@@UAE@XZ" // CHECK: (%"struct.(anonymous namespace)::A"* %this) // Check that we correctly transform __stdcall to __thiscall for ctors and @@ -477,9 +477,9 @@ void *getA() { class G { public: __stdcall G() {}; -// DTORS4: define linkonce_odr x86_thiscallcc %class.G* @"\01??0G@@QAE@XZ" +// DTORS4: define linkonce_odr dso_local x86_thiscallcc %class.G* @"??0G@@QAE@XZ" __stdcall ~G() {}; -// DTORS4: define linkonce_odr x86_thiscallcc void @"\01??1G@@QAE@XZ" +// DTORS4: define linkonce_odr dso_local x86_thiscallcc void @"??1G@@QAE@XZ" }; extern void testG() { diff --git a/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp b/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp index 3f53e631c9646..a5bb87414d6a7 100644 --- a/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp +++ b/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp @@ -6,79 +6,79 @@ struct S { ~S(); }; -// CHECK-DAG: @"\01?s@?1??f@@YAAAUS@@XZ@4U2@A" = linkonce_odr thread_local global %struct.S zeroinitializer -// CHECK-DAG: @"\01??__J?1??f@@YAAAUS@@XZ@51" = linkonce_odr thread_local global i32 0 -// CHECK-DAG: @"\01?s@?1??g@@YAAAUS@@XZ@4U2@A" = linkonce_odr global %struct.S zeroinitializer -// CHECK-DAG: @"\01?$TSS0@?1??g@@YAAAUS@@XZ@4HA" = linkonce_odr global i32 0 +// CHECK-DAG: @"?s@?1??f@@YAAAUS@@XZ@4U2@A" = linkonce_odr dso_local thread_local global %struct.S zeroinitializer +// CHECK-DAG: @"??__J?1??f@@YAAAUS@@XZ@51" = linkonce_odr thread_local global i32 0 +// CHECK-DAG: @"?s@?1??g@@YAAAUS@@XZ@4U2@A" = linkonce_odr dso_local global %struct.S zeroinitializer +// CHECK-DAG: @"?$TSS0@?1??g@@YAAAUS@@XZ@4HA" = linkonce_odr global i32 0 // CHECK-DAG: @_Init_thread_epoch = external thread_local global i32, align 4 -// CHECK-DAG: @"\01?j@?1??h@@YAAAUS@@_N@Z@4U2@A" = linkonce_odr thread_local global %struct.S zeroinitializer -// CHECK-DAG: @"\01??__J?1??h@@YAAAUS@@_N@Z@51" = linkonce_odr thread_local global i32 0 -// CHECK-DAG: @"\01?i@?1??h@@YAAAUS@@_N@Z@4U2@A" = linkonce_odr global %struct.S zeroinitializer -// CHECK-DAG: @"\01?$TSS0@?1??h@@YAAAUS@@_N@Z@4HA" = linkonce_odr global i32 0 -// CHECK-DAG: @"\01?i@?1??g1@@YAHXZ@4HA" = internal global i32 0, align 4 -// CHECK-DAG: @"\01?$TSS0@?1??g1@@YAHXZ@4HA" = internal global i32 0, align 4 +// CHECK-DAG: @"?j@?1??h@@YAAAUS@@_N@Z@4U2@A" = linkonce_odr dso_local thread_local global %struct.S zeroinitializer +// CHECK-DAG: @"??__J?1??h@@YAAAUS@@_N@Z@51" = linkonce_odr thread_local global i32 0 +// CHECK-DAG: @"?i@?1??h@@YAAAUS@@_N@Z@4U2@A" = linkonce_odr dso_local global %struct.S zeroinitializer +// CHECK-DAG: @"?$TSS0@?1??h@@YAAAUS@@_N@Z@4HA" = linkonce_odr global i32 0 +// CHECK-DAG: @"?i@?1??g1@@YAHXZ@4HA" = internal global i32 0, align 4 +// CHECK-DAG: @"?$TSS0@?1??g1@@YAHXZ@4HA" = internal global i32 0, align 4 -// CHECK-LABEL: define {{.*}} @"\01?f@@YAAAUS@@XZ"() +// CHECK-LABEL: define {{.*}} @"?f@@YAAAUS@@XZ"() // CHECK-SAME: personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) extern inline S &f() { static thread_local S s; -// CHECK: %[[guard:.*]] = load i32, i32* @"\01??__J?1??f@@YAAAUS@@XZ@51" +// CHECK: %[[guard:.*]] = load i32, i32* @"??__J?1??f@@YAAAUS@@XZ@51" // CHECK-NEXT: %[[mask:.*]] = and i32 %[[guard]], 1 // CHECK-NEXT: %[[cmp:.*]] = icmp eq i32 %[[mask]], 0 // CHECK-NEXT: br i1 %[[cmp]], label %[[init:.*]], label %[[init_end:.*]], !prof ![[unlikely_threadlocal:.*]] // // CHECK: [[init]]: // CHECK-NEXT: %[[or:.*]] = or i32 %[[guard]], 1 -// CHECK-NEXT: store i32 %[[or]], i32* @"\01??__J?1??f@@YAAAUS@@XZ@51" -// CHECK-NEXT: invoke {{.*}} @"\01??0S@@QAE@XZ"(%struct.S* @"\01?s@?1??f@@YAAAUS@@XZ@4U2@A") +// CHECK-NEXT: store i32 %[[or]], i32* @"??__J?1??f@@YAAAUS@@XZ@51" +// CHECK-NEXT: invoke {{.*}} @"??0S@@QAE@XZ"(%struct.S* @"?s@?1??f@@YAAAUS@@XZ@4U2@A") // CHECK-NEXT: to label %[[invoke_cont:.*]] unwind label %[[lpad:.*]] // // CHECK: [[invoke_cont]]: -// CHECK-NEXT: call i32 @__tlregdtor(void ()* @"\01??__Fs@?1??f@@YAAAUS@@XZ@YAXXZ") +// CHECK-NEXT: call i32 @__tlregdtor(void ()* @"??__Fs@?1??f@@YAAAUS@@XZ@YAXXZ") // CHECK-NEXT: br label %[[init_end:.*]] // CHECK: [[init_end]]: -// CHECK-NEXT: ret %struct.S* @"\01?s@?1??f@@YAAAUS@@XZ@4U2@A" +// CHECK-NEXT: ret %struct.S* @"?s@?1??f@@YAAAUS@@XZ@4U2@A" // CHECK: [[lpad:.*]]: // CHECK-NEXT: cleanuppad within none [] -// CHECK: %[[guard:.*]] = load i32, i32* @"\01??__J?1??f@@YAAAUS@@XZ@51" +// CHECK: %[[guard:.*]] = load i32, i32* @"??__J?1??f@@YAAAUS@@XZ@51" // CHECK-NEXT: %[[mask:.*]] = and i32 %[[guard]], -2 -// CHECK-NEXT: store i32 %[[mask]], i32* @"\01??__J?1??f@@YAAAUS@@XZ@51" +// CHECK-NEXT: store i32 %[[mask]], i32* @"??__J?1??f@@YAAAUS@@XZ@51" // CHECK-NEXT: cleanupret {{.*}} unwind to caller return s; } -// CHECK-LABEL: define {{.*}} @"\01?g@@YAAAUS@@XZ"() +// CHECK-LABEL: define {{.*}} @"?g@@YAAAUS@@XZ"() extern inline S &g() { static S s; -// CHECK: %[[guard:.*]] = load atomic i32, i32* @"\01?$TSS0@?1??g@@YAAAUS@@XZ@4HA" unordered, align 4 +// CHECK: %[[guard:.*]] = load atomic i32, i32* @"?$TSS0@?1??g@@YAAAUS@@XZ@4HA" unordered, align 4 // CHECK-NEXT: %[[epoch:.*]] = load i32, i32* @_Init_thread_epoch // CHECK-NEXT: %[[cmp:.*]] = icmp sgt i32 %[[guard]], %[[epoch]] // CHECK-NEXT: br i1 %[[cmp]], label %[[init_attempt:.*]], label %[[init_end:.*]], !prof ![[unlikely_staticlocal:.*]] // // CHECK: [[init_attempt]]: -// CHECK-NEXT: call void @_Init_thread_header(i32* @"\01?$TSS0@?1??g@@YAAAUS@@XZ@4HA") -// CHECK-NEXT: %[[guard2:.*]] = load atomic i32, i32* @"\01?$TSS0@?1??g@@YAAAUS@@XZ@4HA" unordered, align 4 +// CHECK-NEXT: call void @_Init_thread_header(i32* @"?$TSS0@?1??g@@YAAAUS@@XZ@4HA") +// CHECK-NEXT: %[[guard2:.*]] = load atomic i32, i32* @"?$TSS0@?1??g@@YAAAUS@@XZ@4HA" unordered, align 4 // CHECK-NEXT: %[[cmp2:.*]] = icmp eq i32 %[[guard2]], -1 // CHECK-NEXT: br i1 %[[cmp2]], label %[[init:.*]], label %[[init_end:.*]] // // CHECK: [[init]]: -// CHECK-NEXT: invoke {{.*}} @"\01??0S@@QAE@XZ"(%struct.S* @"\01?s@?1??g@@YAAAUS@@XZ@4U2@A") +// CHECK-NEXT: invoke {{.*}} @"??0S@@QAE@XZ"(%struct.S* @"?s@?1??g@@YAAAUS@@XZ@4U2@A") // CHECK-NEXT: to label %[[invoke_cont:.*]] unwind label %[[lpad:.*]] // // CHECK: [[invoke_cont]]: -// CHECK-NEXT: call i32 @atexit(void ()* @"\01??__Fs@?1??g@@YAAAUS@@XZ@YAXXZ") -// CHECK-NEXT: call void @_Init_thread_footer(i32* @"\01?$TSS0@?1??g@@YAAAUS@@XZ@4HA") +// CHECK-NEXT: call i32 @atexit(void ()* @"??__Fs@?1??g@@YAAAUS@@XZ@YAXXZ") +// CHECK-NEXT: call void @_Init_thread_footer(i32* @"?$TSS0@?1??g@@YAAAUS@@XZ@4HA") // CHECK-NEXT: br label %init.end // // CHECK: [[init_end]]: -// CHECK-NEXT: ret %struct.S* @"\01?s@?1??g@@YAAAUS@@XZ@4U2@A" +// CHECK-NEXT: ret %struct.S* @"?s@?1??g@@YAAAUS@@XZ@4U2@A" // // CHECK: [[lpad]]: // CHECK-NEXT: cleanuppad within none [] -// CHECK: call void @_Init_thread_abort(i32* @"\01?$TSS0@?1??g@@YAAAUS@@XZ@4HA") +// CHECK: call void @_Init_thread_abort(i32* @"?$TSS0@?1??g@@YAAAUS@@XZ@4HA") // CHECK-NEXT: cleanupret {{.*}} unwind to caller return s; } @@ -89,7 +89,7 @@ extern inline S&h(bool b) { return b ? j : i; } -// CHECK-LABEL: define i32 @"\01?g1@@YAHXZ"() +// CHECK-LABEL: define dso_local i32 @"?g1@@YAHXZ"() int f1(); int g1() { static int i = f1(); diff --git a/test/CodeGenCXX/microsoft-abi-throw.cpp b/test/CodeGenCXX/microsoft-abi-throw.cpp index 51076f841611e..cbbce2daaad86 100644 --- a/test/CodeGenCXX/microsoft-abi-throw.cpp +++ b/test/CodeGenCXX/microsoft-abi-throw.cpp @@ -1,27 +1,28 @@ // RUN: %clang_cc1 -emit-llvm -o - -triple=i386-pc-win32 -std=c++11 %s -fcxx-exceptions -fms-extensions | FileCheck %s // RUN: %clang_cc1 -emit-llvm -o - -triple=i386-pc-win32 -std=c++11 %s -fcxx-exceptions -fms-extensions -DSTD | FileCheck %s -// CHECK-DAG: @"\01??_R0?AUY@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUY@@\00" }, comdat -// CHECK-DAG: @"_CT??_R0?AUY@@@8??0Y@@QAE@ABU0@@Z8" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 4, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUY@@@8" to i8*), i32 0, i32 -1, i32 0, i32 8, i8* bitcast (%struct.Y* (%struct.Y*, %struct.Y*, i32)* @"\01??0Y@@QAE@ABU0@@Z" to i8*) }, section ".xdata", comdat -// CHECK-DAG: @"\01??_R0?AUZ@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUZ@@\00" }, comdat -// CHECK-DAG: @"_CT??_R0?AUZ@@@81" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUZ@@@8" to i8*), i32 0, i32 -1, i32 0, i32 1, i8* null }, section ".xdata", comdat -// CHECK-DAG: @"\01??_R0?AUW@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUW@@\00" }, comdat -// CHECK-DAG: @"_CT??_R0?AUW@@@8??0W@@QAE@ABU0@@Z44" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 4, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUW@@@8" to i8*), i32 4, i32 -1, i32 0, i32 4, i8* bitcast (%struct.W* (%struct.W*, %struct.W*, i32)* @"\01??0W@@QAE@ABU0@@Z" to i8*) }, section ".xdata", comdat -// CHECK-DAG: @"\01??_R0?AUM@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUM@@\00" }, comdat -// CHECK-DAG: @"_CT??_R0?AUM@@@818" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUM@@@8" to i8*), i32 8, i32 -1, i32 0, i32 1, i8* null }, section ".xdata", comdat -// CHECK-DAG: @"\01??_R0?AUV@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUV@@\00" }, comdat -// CHECK-DAG: @"_CT??_R0?AUV@@@81044" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUV@@@8" to i8*), i32 0, i32 4, i32 4, i32 1, i8* null }, section ".xdata", comdat +// CHECK-DAG: @"??_R0?AUY@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AUY@@\00" }, comdat +// CHECK-DAG: @"_CT??_R0?AUY@@@8??0Y@@QAE@ABU0@@Z8" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 4, i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUY@@@8" to i8*), i32 0, i32 -1, i32 0, i32 8, i8* bitcast (%struct.Y* (%struct.Y*, %struct.Y*, i32)* @"??0Y@@QAE@ABU0@@Z" to i8*) }, section ".xdata", comdat +// CHECK-DAG: @"??_R0?AUZ@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AUZ@@\00" }, comdat +// CHECK-DAG: @"_CT??_R0?AUZ@@@81" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUZ@@@8" to i8*), i32 0, i32 -1, i32 0, i32 1, i8* null }, section ".xdata", comdat +// CHECK-DAG: @"??_R0?AUW@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AUW@@\00" }, comdat +// CHECK-DAG: @"_CT??_R0?AUW@@@8??0W@@QAE@ABU0@@Z44" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 4, i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUW@@@8" to i8*), i32 4, i32 -1, i32 0, i32 4, i8* bitcast (%struct.W* (%struct.W*, %struct.W*, i32)* @"??0W@@QAE@ABU0@@Z" to i8*) }, section ".xdata", comdat +// CHECK-DAG: @"??_R0?AUM@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AUM@@\00" }, comdat +// CHECK-DAG: @"_CT??_R0?AUM@@@818" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUM@@@8" to i8*), i32 8, i32 -1, i32 0, i32 1, i8* null }, section ".xdata", comdat +// CHECK-DAG: @"??_R0?AUV@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AUV@@\00" }, comdat +// CHECK-DAG: @"_CT??_R0?AUV@@@81044" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUV@@@8" to i8*), i32 0, i32 4, i32 4, i32 1, i8* null }, section ".xdata", comdat // CHECK-DAG: @"_CTA5?AUY@@" = linkonce_odr unnamed_addr constant %eh.CatchableTypeArray.5 { i32 5, [5 x %eh.CatchableType*] [%eh.CatchableType* @"_CT??_R0?AUY@@@8??0Y@@QAE@ABU0@@Z8", %eh.CatchableType* @"_CT??_R0?AUZ@@@81", %eh.CatchableType* @"_CT??_R0?AUW@@@8??0W@@QAE@ABU0@@Z44", %eh.CatchableType* @"_CT??_R0?AUM@@@818", %eh.CatchableType* @"_CT??_R0?AUV@@@81044"] }, section ".xdata", comdat -// CHECK-DAG: @"_TI5?AUY@@" = linkonce_odr unnamed_addr constant %eh.ThrowInfo { i32 0, i8* bitcast (void (%struct.Y*)* @"\01??_DY@@QAEXXZ" to i8*), i8* null, i8* bitcast (%eh.CatchableTypeArray.5* @"_CTA5?AUY@@" to i8*) }, section ".xdata", comdat -// CHECK-DAG: @"_CT??_R0?AUDefault@@@8??_ODefault@@QAEXAAU0@@Z1" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor13* @"\01??_R0?AUDefault@@@8" to i8*), i32 0, i32 -1, i32 0, i32 1, i8* bitcast (void (%struct.Default*, %struct.Default*)* @"\01??_ODefault@@QAEXAAU0@@Z" to i8*) }, section ".xdata", comdat -// CHECK-DAG: @"_CT??_R0?AUVariadic@@@8??_OVariadic@@QAEXAAU0@@Z1" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor14* @"\01??_R0?AUVariadic@@@8" to i8*), i32 0, i32 -1, i32 0, i32 1, i8* bitcast (void (%struct.Variadic*, %struct.Variadic*)* @"\01??_OVariadic@@QAEXAAU0@@Z" to i8*) }, section ".xdata", comdat -// CHECK-DAG: @"_CT??_R0?AUTemplateWithDefault@@@8??$?_OH@TemplateWithDefault@@QAEXAAU0@@Z1" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor25* @"\01??_R0?AUTemplateWithDefault@@@8" to i8*), i32 0, i32 -1, i32 0, i32 1, i8* bitcast (void (%struct.TemplateWithDefault*, %struct.TemplateWithDefault*)* @"\01??$?_OH@TemplateWithDefault@@QAEXAAU0@@Z" to i8*) }, section ".xdata", comdat +// CHECK-DAG: @"_TI5?AUY@@" = linkonce_odr unnamed_addr constant %eh.ThrowInfo { i32 0, i8* bitcast (void (%struct.Y*)* @"??_DY@@QAEXXZ" to i8*), i8* null, i8* bitcast (%eh.CatchableTypeArray.5* @"_CTA5?AUY@@" to i8*) }, section ".xdata", comdat +// CHECK-DAG: @"_CT??_R0?AUDefault@@@8??_ODefault@@QAEXAAU0@@Z1" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor13* @"??_R0?AUDefault@@@8" to i8*), i32 0, i32 -1, i32 0, i32 1, i8* bitcast (void (%struct.Default*, %struct.Default*)* @"??_ODefault@@QAEXAAU0@@Z" to i8*) }, section ".xdata", comdat +// CHECK-DAG: @"_CT??_R0?AUVariadic@@@8??_OVariadic@@QAEXAAU0@@Z1" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor14* @"??_R0?AUVariadic@@@8" to i8*), i32 0, i32 -1, i32 0, i32 1, i8* bitcast (void (%struct.Variadic*, %struct.Variadic*)* @"??_OVariadic@@QAEXAAU0@@Z" to i8*) }, section ".xdata", comdat +// CHECK-DAG: @"_CT??_R0?AUTemplateWithDefault@@@8??$?_OH@TemplateWithDefault@@QAEXAAU0@@Z1" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor25* @"??_R0?AUTemplateWithDefault@@@8" to i8*), i32 0, i32 -1, i32 0, i32 1, i8* bitcast (void (%struct.TemplateWithDefault*, %struct.TemplateWithDefault*)* @"??$?_OH@TemplateWithDefault@@QAEXAAU0@@Z" to i8*) }, section ".xdata", comdat // CHECK-DAG: @"_CTA2$$T" = linkonce_odr unnamed_addr constant %eh.CatchableTypeArray.2 { i32 2, [2 x %eh.CatchableType*] [%eh.CatchableType* @"_CT??_R0$$T@84", %eh.CatchableType* @"_CT??_R0PAX@84"] }, section ".xdata", comdat -// CHECK-DAG: @"_CT??_R0P6AXXZ@84" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 1, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0P6AXXZ@8" to i8*), i32 0, i32 -1, i32 0, i32 4, i8* null }, section ".xdata", comdat +// CHECK-DAG: @"_CT??_R0P6AXXZ@84" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 1, i8* bitcast (%rtti.TypeDescriptor7* @"??_R0P6AXXZ@8" to i8*), i32 0, i32 -1, i32 0, i32 4, i8* null }, section ".xdata", comdat // CHECK-DAG: @_CTA1P6AXXZ = linkonce_odr unnamed_addr constant %eh.CatchableTypeArray.1 { i32 1, [1 x %eh.CatchableType*] [%eh.CatchableType* @"_CT??_R0P6AXXZ@84"] }, section ".xdata", comdat // CHECK-DAG: @_TI1P6AXXZ = linkonce_odr unnamed_addr constant %eh.ThrowInfo { i32 0, i8* null, i8* null, i8* bitcast (%eh.CatchableTypeArray.1* @_CTA1P6AXXZ to i8*) }, section ".xdata", comdat // CHECK-DAG: @_TIU2PAPFAH = linkonce_odr unnamed_addr constant %eh.ThrowInfo { i32 4, i8* null, i8* null, i8* bitcast (%eh.CatchableTypeArray.2* @_CTA2PAPFAH to i8*) }, section ".xdata", comdat // CHECK-DAG: @_CTA2PAPFAH = linkonce_odr unnamed_addr constant %eh.CatchableTypeArray.2 { i32 2, [2 x %eh.CatchableType*] [%eh.CatchableType* @"_CT??_R0PAPFAH@84", %eh.CatchableType* @"_CT??_R0PAX@84"] }, section ".xdata", comdat +// CHECK-DAG: @"_TI1?AUFoo@?A@@" = internal unnamed_addr constant %eh.ThrowInfo { i32 0, i8* null, i8* null, i8* bitcast (%eh.CatchableTypeArray.1* @"_CTA1?AUFoo@?A@@" to i8*) }, section ".xdata" struct N { ~N(); }; @@ -33,21 +34,21 @@ struct W : M, virtual V {}; struct Y : Z, W, virtual V {}; void f(const Y &y) { - // CHECK-LABEL: @"\01?f@@YAXABUY@@@Z" - // CHECK: call x86_thiscallcc %struct.Y* @"\01??0Y@@QAE@ABU0@@Z"(%struct.Y* %[[mem:.*]], %struct.Y* + // CHECK-LABEL: @"?f@@YAXABUY@@@Z" + // CHECK: call x86_thiscallcc %struct.Y* @"??0Y@@QAE@ABU0@@Z"(%struct.Y* %[[mem:.*]], %struct.Y* // CHECK: %[[cast:.*]] = bitcast %struct.Y* %[[mem]] to i8* // CHECK: call void @_CxxThrowException(i8* %[[cast]], %eh.ThrowInfo* @"_TI5?AUY@@") throw y; } void g(const int *const *y) { - // CHECK-LABEL: @"\01?g@@YAXPBQBH@Z" + // CHECK-LABEL: @"?g@@YAXPBQBH@Z" // CHECK: call void @_CxxThrowException(i8* %{{.*}}, %eh.ThrowInfo* @_TIC2PAPBH) throw y; } void h(__unaligned int * __unaligned *y) { - // CHECK-LABEL: @"\01?h@@YAXPFAPFAH@Z" + // CHECK-LABEL: @"?h@@YAXPFAPFAH@Z" // CHECK: call void @_CxxThrowException(i8* %{{.*}}, %eh.ThrowInfo* @_TIU2PAPFAH) throw y; } @@ -56,14 +57,14 @@ struct Default { Default(Default &, int = 42); }; -// CHECK-LABEL: @"\01??_ODefault@@QAEXAAU0@@Z" +// CHECK-LABEL: @"??_ODefault@@QAEXAAU0@@Z" // CHECK: %[[src_addr:.*]] = alloca // CHECK: %[[this_addr:.*]] = alloca // CHECK: store {{.*}} %src, {{.*}} %[[src_addr]], align 4 // CHECK: store {{.*}} %this, {{.*}} %[[this_addr]], align 4 // CHECK: %[[this:.*]] = load {{.*}} %[[this_addr]] // CHECK: %[[src:.*]] = load {{.*}} %[[src_addr]] -// CHECK: call x86_thiscallcc {{.*}} @"\01??0Default@@QAE@AAU0@H@Z"({{.*}} %[[this]], {{.*}} %[[src]], i32 42) +// CHECK: call x86_thiscallcc {{.*}} @"??0Default@@QAE@AAU0@H@Z"({{.*}} %[[this]], {{.*}} %[[src]], i32 42) // CHECK: ret void void h(Default &d) { @@ -78,14 +79,14 @@ void i(Variadic &v) { throw v; } -// CHECK-LABEL: @"\01??_OVariadic@@QAEXAAU0@@Z" +// CHECK-LABEL: @"??_OVariadic@@QAEXAAU0@@Z" // CHECK: %[[src_addr:.*]] = alloca // CHECK: %[[this_addr:.*]] = alloca // CHECK: store {{.*}} %src, {{.*}} %[[src_addr:.*]], align // CHECK: store {{.*}} %this, {{.*}} %[[this_addr:.*]], align // CHECK: %[[this:.*]] = load {{.*}} %[[this_addr]] // CHECK: %[[src:.*]] = load {{.*}} %[[src_addr]] -// CHECK: call {{.*}} @"\01??0Variadic@@QAA@AAU0@ZZ"({{.*}} %[[this]], {{.*}} %[[src]]) +// CHECK: call {{.*}} @"??0Variadic@@QAA@AAU0@ZZ"({{.*}} %[[this]], {{.*}} %[[src]]) // CHECK: ret void struct TemplateWithDefault { @@ -118,13 +119,22 @@ void *__GetExceptionInfo(T); using namespace std; void *GetExceptionInfo_test0() { -// CHECK-LABEL: @"\01?GetExceptionInfo_test0@@YAPAXXZ" +// CHECK-LABEL: @"?GetExceptionInfo_test0@@YAPAXXZ" // CHECK: ret i8* bitcast (%eh.ThrowInfo* @_TI1H to i8*) return __GetExceptionInfo(0); } void *GetExceptionInfo_test1() { -// CHECK-LABEL: @"\01?GetExceptionInfo_test1@@YAPAXXZ" +// CHECK-LABEL: @"?GetExceptionInfo_test1@@YAPAXXZ" // CHECK: ret i8* bitcast (%eh.ThrowInfo* @_TI1P6AXXZ to i8*) return __GetExceptionInfo<void (*)()>(&h); } + +// PR36327: Try an exception type with no linkage. +namespace { struct Foo { } foo_exc; } + +void *GetExceptionInfo_test2() { +// CHECK-LABEL: @"?GetExceptionInfo_test2@@YAPAXXZ" +// CHECK: ret i8* bitcast (%eh.ThrowInfo* @"_TI1?AUFoo@?A@@" to i8*) + return __GetExceptionInfo(foo_exc); +} diff --git a/test/CodeGenCXX/microsoft-abi-thunks.cpp b/test/CodeGenCXX/microsoft-abi-thunks.cpp index 823033461612a..c2f64f38417c0 100644 --- a/test/CodeGenCXX/microsoft-abi-thunks.cpp +++ b/test/CodeGenCXX/microsoft-abi-thunks.cpp @@ -10,7 +10,7 @@ struct A { virtual ~A(); virtual void public_f(); // Make sure we don't emit unneeded thunks: - // XMANGLING-NOT: @"\01?public_f@A@@QAEXXZ" + // XMANGLING-NOT: @"?public_f@A@@QAEXXZ" protected: virtual void protected_f(); private: @@ -31,45 +31,45 @@ struct C : A, B { C(); virtual ~C(); - // MANGLING-DAG: declare {{.*}} @"\01??1C@@UAE@XZ"({{.*}}) - // MANGLING-DAG: define {{.*}} @"\01??_GC@@UAEPAXI@Z"({{.*}}) - // MANGLING-DAG: define {{.*}} @"\01??_EC@@W3AEPAXI@Z"({{.*}}) {{.*}} comdat - // MANGLING-X64-DAG: declare {{.*}} @"\01??1C@@UEAA@XZ"({{.*}}) - // MANGLING-X64-DAG: define {{.*}} @"\01??_GC@@UEAAPEAXI@Z"({{.*}}) - // MANGLING-X64-DAG: define {{.*}} @"\01??_EC@@W7EAAPEAXI@Z"({{.*}}) {{.*}} comdat + // MANGLING-DAG: declare {{.*}} @"??1C@@UAE@XZ"({{.*}}) + // MANGLING-DAG: define {{.*}} @"??_GC@@UAEPAXI@Z"({{.*}}) + // MANGLING-DAG: define {{.*}} @"??_EC@@W3AEPAXI@Z"({{.*}}) {{.*}} comdat + // MANGLING-X64-DAG: declare {{.*}} @"??1C@@UEAA@XZ"({{.*}}) + // MANGLING-X64-DAG: define {{.*}} @"??_GC@@UEAAPEAXI@Z"({{.*}}) + // MANGLING-X64-DAG: define {{.*}} @"??_EC@@W7EAAPEAXI@Z"({{.*}}) {{.*}} comdat // Overrides public_f() of two subobjects with distinct vfptrs, thus needs a thunk. virtual void public_f(); - // MANGLING-DAG: @"\01?public_f@C@@UAEXXZ" - // MANGLING-DAG: @"\01?public_f@C@@W3AEXXZ" - // MANGLING-X64-DAG: @"\01?public_f@C@@UEAAXXZ" - // MANGLING-X64-DAG: @"\01?public_f@C@@W7EAAXXZ" + // MANGLING-DAG: @"?public_f@C@@UAEXXZ" + // MANGLING-DAG: @"?public_f@C@@W3AEXXZ" + // MANGLING-X64-DAG: @"?public_f@C@@UEAAXXZ" + // MANGLING-X64-DAG: @"?public_f@C@@W7EAAXXZ" protected: virtual void protected_f(); - // MANGLING-DAG: @"\01?protected_f@C@@MAEXXZ" - // MANGLING-DAG: @"\01?protected_f@C@@O3AEXXZ" - // MANGLING-X64-DAG: @"\01?protected_f@C@@MEAAXXZ" - // MANGLING-X64-DAG: @"\01?protected_f@C@@O7EAAXXZ" + // MANGLING-DAG: @"?protected_f@C@@MAEXXZ" + // MANGLING-DAG: @"?protected_f@C@@O3AEXXZ" + // MANGLING-X64-DAG: @"?protected_f@C@@MEAAXXZ" + // MANGLING-X64-DAG: @"?protected_f@C@@O7EAAXXZ" private: virtual void private_f(); - // MANGLING-DAG: @"\01?private_f@C@@EAEXXZ" - // MANGLING-DAG: @"\01?private_f@C@@G3AEXXZ" - // MANGLING-X64-DAG: @"\01?private_f@C@@EEAAXXZ" - // MANGLING-X64-DAG: @"\01?private_f@C@@G7EAAXXZ" + // MANGLING-DAG: @"?private_f@C@@EAEXXZ" + // MANGLING-DAG: @"?private_f@C@@G3AEXXZ" + // MANGLING-X64-DAG: @"?private_f@C@@EEAAXXZ" + // MANGLING-X64-DAG: @"?private_f@C@@G7EAAXXZ" }; C::C() {} // Emits vftable and forces thunk generation. -// CODEGEN-LABEL: define linkonce_odr x86_thiscallcc i8* @"\01??_EC@@W3AEPAXI@Z"(%struct.C* %this, i32 %should_call_delete) {{.*}} comdat +// CODEGEN-LABEL: define linkonce_odr dso_local x86_thiscallcc i8* @"??_EC@@W3AEPAXI@Z"(%struct.C* %this, i32 %should_call_delete) {{.*}} comdat // CODEGEN: getelementptr i8, i8* {{.*}}, i32 -4 // FIXME: should actually call _EC, not _GC. -// CODEGEN: call x86_thiscallcc i8* @"\01??_GC@@UAEPAXI@Z" +// CODEGEN: call x86_thiscallcc i8* @"??_GC@@UAEPAXI@Z" // CODEGEN: ret -// CODEGEN-LABEL: define linkonce_odr x86_thiscallcc void @"\01?public_f@C@@W3AEXXZ"(%struct.C* +// CODEGEN-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"?public_f@C@@W3AEXXZ"(%struct.C* // CODEGEN: getelementptr i8, i8* {{.*}}, i32 -4 -// CODEGEN: call x86_thiscallcc void @"\01?public_f@C@@UAEXXZ"(%struct.C* +// CODEGEN: call x86_thiscallcc void @"?public_f@C@@UAEXXZ"(%struct.C* // CODEGEN: ret void zoo(C* obj) { @@ -83,16 +83,16 @@ struct D { struct E : D { E(); virtual C* goo(); - // MANGLING-DAG: @"\01?goo@E@@UAEPAUC@@XZ" - // MANGLING-DAG: @"\01?goo@E@@QAEPAUB@@XZ" - // MANGLING-X64-DAG: @"\01?goo@E@@UEAAPEAUC@@XZ" - // MANGLING-X64-DAG: @"\01?goo@E@@QEAAPEAUB@@XZ" + // MANGLING-DAG: @"?goo@E@@UAEPAUC@@XZ" + // MANGLING-DAG: @"?goo@E@@QAEPAUB@@XZ" + // MANGLING-X64-DAG: @"?goo@E@@UEAAPEAUC@@XZ" + // MANGLING-X64-DAG: @"?goo@E@@QEAAPEAUB@@XZ" }; E::E() {} // Emits vftable and forces thunk generation. -// CODEGEN-LABEL: define weak_odr x86_thiscallcc %struct.C* @"\01?goo@E@@QAEPAUB@@XZ"{{.*}} comdat -// CODEGEN: call x86_thiscallcc %struct.C* @"\01?goo@E@@UAEPAUC@@XZ" +// CODEGEN-LABEL: define weak_odr dso_local x86_thiscallcc %struct.C* @"?goo@E@@QAEPAUB@@XZ"{{.*}} comdat +// CODEGEN: call x86_thiscallcc %struct.C* @"?goo@E@@UAEPAUC@@XZ" // CODEGEN: getelementptr inbounds i8, i8* {{.*}}, i32 4 // CODEGEN: ret @@ -107,12 +107,12 @@ struct G : C { }; struct H : E { virtual G* goo(); - // MANGLING-DAG: @"\01?goo@H@@UAEPAUG@@XZ" - // MANGLING-DAG: @"\01?goo@H@@QAEPAUB@@XZ" - // MANGLING-DAG: @"\01?goo@H@@QAEPAUC@@XZ" - // MANGLING-X64-DAG: @"\01?goo@H@@UEAAPEAUG@@XZ" - // MANGLING-X64-DAG: @"\01?goo@H@@QEAAPEAUB@@XZ" - // MANGLING-X64-DAG: @"\01?goo@H@@QEAAPEAUC@@XZ" + // MANGLING-DAG: @"?goo@H@@UAEPAUG@@XZ" + // MANGLING-DAG: @"?goo@H@@QAEPAUB@@XZ" + // MANGLING-DAG: @"?goo@H@@QAEPAUC@@XZ" + // MANGLING-X64-DAG: @"?goo@H@@UEAAPEAUG@@XZ" + // MANGLING-X64-DAG: @"?goo@H@@QEAAPEAUB@@XZ" + // MANGLING-X64-DAG: @"?goo@H@@QEAAPEAUC@@XZ" }; H h; @@ -124,8 +124,8 @@ struct I : D { I::I() {} // Emits vftable and forces thunk generation. -// CODEGEN-LABEL: define weak_odr x86_thiscallcc %struct.{{[BF]}}* @"\01?goo@I@@QAEPAUB@@XZ"{{.*}} comdat -// CODEGEN: %[[ORIG_RET:.*]] = call x86_thiscallcc %struct.F* @"\01?goo@I@@UAEPAUF@@XZ" +// CODEGEN-LABEL: define weak_odr dso_local x86_thiscallcc %struct.{{[BF]}}* @"?goo@I@@QAEPAUB@@XZ"{{.*}} comdat +// CODEGEN: %[[ORIG_RET:.*]] = call x86_thiscallcc %struct.F* @"?goo@I@@UAEPAUF@@XZ" // CODEGEN: %[[ORIG_RET_i8:.*]] = bitcast %struct.F* %[[ORIG_RET]] to i8* // CODEGEN: %[[VBPTR_i8:.*]] = getelementptr inbounds i8, i8* %[[ORIG_RET_i8]], i32 4 // CODEGEN: %[[VBPTR:.*]] = bitcast i8* %[[VBPTR_i8]] to i32** @@ -160,5 +160,5 @@ struct E : D { E::E() {} E e; // Class with internal linkage has internal linkage thunks. -// CODEGEN: define internal x86_thiscallcc %struct.C* @"\01?goo@E@?A@@QAEPAUB@@XZ" +// CODEGEN: define internal x86_thiscallcc %struct.C* @"?goo@E@?A@@QAEPAUB@@XZ" } diff --git a/test/CodeGenCXX/microsoft-abi-try-throw.cpp b/test/CodeGenCXX/microsoft-abi-try-throw.cpp index bf1834e8594ee..1a1e941ebf88f 100644 --- a/test/CodeGenCXX/microsoft-abi-try-throw.cpp +++ b/test/CodeGenCXX/microsoft-abi-try-throw.cpp @@ -1,8 +1,8 @@ // RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -mconstructor-aliases -fcxx-exceptions -fexceptions -fno-rtti -DTRY | FileCheck %s -check-prefix=TRY // RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -mconstructor-aliases -fcxx-exceptions -fexceptions -fno-rtti -DTHROW | FileCheck %s -check-prefix=THROW -// THROW-DAG: @"\01??_R0H@8" = linkonce_odr global %rtti.TypeDescriptor2 { i8** @"\01??_7type_info@@6B@", i8* null, [3 x i8] c".H\00" }, comdat -// THROW-DAG: @"_CT??_R0H@84" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 0, i32 -1, i32 0, i32 4, i8* null }, section ".xdata", comdat +// THROW-DAG: @"??_R0H@8" = linkonce_odr global %rtti.TypeDescriptor2 { i8** @"??_7type_info@@6B@", i8* null, [3 x i8] c".H\00" }, comdat +// THROW-DAG: @"_CT??_R0H@84" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"??_R0H@8" to i8*), i32 0, i32 -1, i32 0, i32 4, i8* null }, section ".xdata", comdat // THROW-DAG: @_CTA1H = linkonce_odr unnamed_addr constant %eh.CatchableTypeArray.1 { i32 1, [1 x %eh.CatchableType*] [%eh.CatchableType* @"_CT??_R0H@84"] }, section ".xdata", comdat // THROW-DAG: @_TI1H = linkonce_odr unnamed_addr constant %eh.ThrowInfo { i32 0, i8* null, i8* null, i8* bitcast (%eh.CatchableTypeArray.1* @_CTA1H to i8*) }, section ".xdata", comdat @@ -16,10 +16,10 @@ int main() { int rv = 0; #ifdef TRY try { - external(); // TRY: invoke void @"\01?external@@YAXXZ" + external(); // TRY: invoke void @"?external@@YAXXZ" } catch (int) { rv = 1; - // TRY: catchpad within {{.*}} [%rtti.TypeDescriptor2* @"\01??_R0H@8", i32 0, i8* null] + // TRY: catchpad within {{.*}} [%rtti.TypeDescriptor2* @"??_R0H@8", i32 0, i8* null] // TRY: catchret } #endif @@ -33,13 +33,13 @@ int main() { } #ifdef TRY -// TRY-LABEL: define void @"\01?qual_catch@@YAXXZ" +// TRY-LABEL: define dso_local void @"?qual_catch@@YAXXZ" void qual_catch() { try { external(); } catch (const int *) { } - // TRY: catchpad within {{.*}} [%rtti.TypeDescriptor4* @"\01??_R0PAH@8", i32 1, i8* null] + // TRY: catchpad within {{.*}} [%rtti.TypeDescriptor4* @"??_R0PAH@8", i32 1, i8* null] // TRY: catchret } #endif diff --git a/test/CodeGenCXX/microsoft-abi-typeid.cpp b/test/CodeGenCXX/microsoft-abi-typeid.cpp index d73f8483a7139..a571654ef062f 100644 --- a/test/CodeGenCXX/microsoft-abi-typeid.cpp +++ b/test/CodeGenCXX/microsoft-abi-typeid.cpp @@ -12,20 +12,20 @@ extern int b; A* fn(); const std::type_info* test0_typeid() { return &typeid(int); } -// CHECK-LABEL: define %struct.type_info* @"\01?test0_typeid@@YAPBUtype_info@@XZ"() -// CHECK: ret %struct.type_info* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to %struct.type_info*) +// CHECK-LABEL: define dso_local %struct.type_info* @"?test0_typeid@@YAPBUtype_info@@XZ"() +// CHECK: ret %struct.type_info* bitcast (%rtti.TypeDescriptor2* @"??_R0H@8" to %struct.type_info*) const std::type_info* test1_typeid() { return &typeid(A); } -// CHECK-LABEL: define %struct.type_info* @"\01?test1_typeid@@YAPBUtype_info@@XZ"() -// CHECK: ret %struct.type_info* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUA@@@8" to %struct.type_info*) +// CHECK-LABEL: define dso_local %struct.type_info* @"?test1_typeid@@YAPBUtype_info@@XZ"() +// CHECK: ret %struct.type_info* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUA@@@8" to %struct.type_info*) const std::type_info* test2_typeid() { return &typeid(&a); } -// CHECK-LABEL: define %struct.type_info* @"\01?test2_typeid@@YAPBUtype_info@@XZ"() -// CHECK: ret %struct.type_info* bitcast (%rtti.TypeDescriptor7* @"\01??_R0PAUA@@@8" to %struct.type_info*) +// CHECK-LABEL: define dso_local %struct.type_info* @"?test2_typeid@@YAPBUtype_info@@XZ"() +// CHECK: ret %struct.type_info* bitcast (%rtti.TypeDescriptor7* @"??_R0PAUA@@@8" to %struct.type_info*) const std::type_info* test3_typeid() { return &typeid(*fn()); } -// CHECK-LABEL: define %struct.type_info* @"\01?test3_typeid@@YAPBUtype_info@@XZ"() -// CHECK: [[CALL:%.*]] = tail call %struct.A* @"\01?fn@@YAPAUA@@XZ"() +// CHECK-LABEL: define dso_local %struct.type_info* @"?test3_typeid@@YAPBUtype_info@@XZ"() +// CHECK: [[CALL:%.*]] = tail call %struct.A* @"?fn@@YAPAUA@@XZ"() // CHECK-NEXT: [[CMP:%.*]] = icmp eq %struct.A* [[CALL]], null // CHECK-NEXT: br i1 [[CMP]] // CHECK: tail call i8* @__RTtypeid(i8* null) @@ -41,12 +41,12 @@ const std::type_info* test3_typeid() { return &typeid(*fn()); } // CHECK-NEXT: ret %struct.type_info* [[RET]] const std::type_info* test4_typeid() { return &typeid(b); } -// CHECK: define %struct.type_info* @"\01?test4_typeid@@YAPBUtype_info@@XZ"() -// CHECK: ret %struct.type_info* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to %struct.type_info*) +// CHECK: define dso_local %struct.type_info* @"?test4_typeid@@YAPBUtype_info@@XZ"() +// CHECK: ret %struct.type_info* bitcast (%rtti.TypeDescriptor2* @"??_R0H@8" to %struct.type_info*) const std::type_info* test5_typeid() { return &typeid(v); } -// CHECK: define %struct.type_info* @"\01?test5_typeid@@YAPBUtype_info@@XZ"() -// CHECK: [[RT:%.*]] = tail call i8* @__RTtypeid(i8* bitcast (%struct.V* @"\01?v@@3UV@@A" to i8*)) +// CHECK: define dso_local %struct.type_info* @"?test5_typeid@@YAPBUtype_info@@XZ"() +// CHECK: [[RT:%.*]] = tail call i8* @__RTtypeid(i8* bitcast (%struct.V* @"?v@@3UV@@A" to i8*)) // CHECK-NEXT: [[RET:%.*]] = bitcast i8* [[RT]] to %struct.type_info* // CHECK-NEXT: ret %struct.type_info* [[RET]] @@ -63,7 +63,7 @@ void f(const Polymorphic &poly) { typeid(poly); } } -// CHECK-LABEL: define void @"\01?f@PR26329@@YAXABUPolymorphic@1@@Z"( +// CHECK-LABEL: define dso_local void @"?f@PR26329@@YAXABUPolymorphic@1@@Z"( // CHECK: %[[cs:.*]] = catchswitch within none [label %{{.*}}] unwind to caller // CHECK: %[[cp:.*]] = catchpad within %[[cs]] [i8* null, i32 64, i8* null] // CHECK: invoke i8* @__RTtypeid(i8* {{.*}}) [ "funclet"(token %[[cp]]) ] diff --git a/test/CodeGenCXX/microsoft-abi-vbtables.cpp b/test/CodeGenCXX/microsoft-abi-vbtables.cpp index df0689423872c..46e159c628f09 100644 --- a/test/CodeGenCXX/microsoft-abi-vbtables.cpp +++ b/test/CodeGenCXX/microsoft-abi-vbtables.cpp @@ -19,11 +19,11 @@ D d; // Force vbtable emission. // C: vbptr C // int c -// CHECK-DAG: @"\01??_8D@Test1@@7B01@@" = linkonce_odr unnamed_addr constant [4 x i32] [i32 0, i32 8, i32 12, i32 20] -// CHECK-DAG: @"\01??_8D@Test1@@7BB@1@@" = {{.*}} [2 x i32] [i32 0, i32 -4] -// CHECK-DAG: @"\01??_8D@Test1@@7BC@1@@" = {{.*}} [2 x i32] [i32 0, i32 -12] -// CHECK-DAG: @"\01??_8C@Test1@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8] -// CHECK-DAG: @"\01??_8B@Test1@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8] +// CHECK-DAG: @"??_8D@Test1@@7B01@@" = linkonce_odr unnamed_addr constant [4 x i32] [i32 0, i32 8, i32 12, i32 20] +// CHECK-DAG: @"??_8D@Test1@@7BB@1@@" = {{.*}} [2 x i32] [i32 0, i32 -4] +// CHECK-DAG: @"??_8D@Test1@@7BC@1@@" = {{.*}} [2 x i32] [i32 0, i32 -12] +// CHECK-DAG: @"??_8C@Test1@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8] +// CHECK-DAG: @"??_8B@Test1@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8] } namespace Test2 { @@ -42,10 +42,10 @@ D d; // Force vbtable emission. // D: int d // A: int a -// CHECK-DAG: @"\01??_8D@Test2@@7BB@1@@" = {{.*}} [2 x i32] [i32 0, i32 20] -// CHECK-DAG: @"\01??_8D@Test2@@7BC@1@@" = {{.*}} [2 x i32] [i32 0, i32 12] -// CHECK-DAG: @"\01??_8C@Test2@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8] -// CHECK-DAG: @"\01??_8B@Test2@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8] +// CHECK-DAG: @"??_8D@Test2@@7BB@1@@" = {{.*}} [2 x i32] [i32 0, i32 20] +// CHECK-DAG: @"??_8D@Test2@@7BC@1@@" = {{.*}} [2 x i32] [i32 0, i32 12] +// CHECK-DAG: @"??_8C@Test2@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8] +// CHECK-DAG: @"??_8B@Test2@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8] } namespace Test3 { @@ -54,7 +54,7 @@ struct B { int b; }; struct C : virtual A, virtual B { int c; }; C c; -// CHECK-DAG: @"\01??_8C@Test3@@7B@" = {{.*}} [3 x i32] [i32 0, i32 8, i32 12] +// CHECK-DAG: @"??_8C@Test3@@7B@" = {{.*}} [3 x i32] [i32 0, i32 8, i32 12] } namespace Test4 { @@ -64,8 +64,8 @@ struct B : virtual A { int b; }; struct C : B, virtual A { int c; }; C c; // Force vbtable emission. -// CHECK-DAG: @"\01??_8C@Test4@@7B@" = {{.*}} [2 x i32] [i32 0, i32 12] -// CHECK-DAG: @"\01??_8B@Test4@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8] +// CHECK-DAG: @"??_8C@Test4@@7B@" = {{.*}} [2 x i32] [i32 0, i32 12] +// CHECK-DAG: @"??_8B@Test4@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8] } namespace Test5 { @@ -77,10 +77,10 @@ struct C : B { int c; }; struct D : B, C { int d; }; D d; // Force vbtable emission. -// CHECK-DAG: @"\01??_8D@Test5@@7BB@1@@" -// CHECK-DAG: @"\01??_8D@Test5@@7BC@1@@" -// CHECK-DAG: @"\01??_8C@Test5@@7B@" -// CHECK-DAG: @"\01??_8B@Test5@@7B@" +// CHECK-DAG: @"??_8D@Test5@@7BB@1@@" +// CHECK-DAG: @"??_8D@Test5@@7BC@1@@" +// CHECK-DAG: @"??_8C@Test5@@7B@" +// CHECK-DAG: @"??_8B@Test5@@7B@" } namespace Test6 { @@ -94,22 +94,22 @@ struct F : E, B, C { int f; }; struct G : F, virtual E { int g; }; G g; -// CHECK-DAG: @"\01??_8G@Test6@@7BB@1@E@1@F@1@@" = -// CHECK-DAG: @"\01??_8G@Test6@@7BC@1@E@1@F@1@@" = -// CHECK-DAG: @"\01??_8G@Test6@@7BB@1@F@1@@" = -// CHECK-DAG: @"\01??_8G@Test6@@7BC@1@F@1@@" = -// CHECK-DAG: @"\01??_8G@Test6@@7BB@1@E@1@@" = -// CHECK-DAG: @"\01??_8G@Test6@@7BC@1@E@1@@" = -// CHECK-DAG: @"\01??_8F@Test6@@7BB@1@E@1@@" = {{.*}} [2 x i32] [i32 0, i32 52] -// CHECK-DAG: @"\01??_8F@Test6@@7BC@1@E@1@@" = {{.*}} [2 x i32] [i32 0, i32 44] -// CHECK-DAG: @"\01??_8F@Test6@@7BB@1@@" = {{.*}} [2 x i32] [i32 0, i32 24] -// CHECK-DAG: @"\01??_8F@Test6@@7BC@1@@" = {{.*}} [2 x i32] [i32 0, i32 16] -// CHECK-DAG: @"\01??_8C@Test6@@7B@" = {{.*}} [2 x i32] [i32 0, i32 12] -// CHECK-DAG: @"\01??_8B@Test6@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8] -// CHECK-DAG: @"\01??_8E@Test6@@7BB@1@@" = {{.*}} [2 x i32] [i32 0, i32 28] -// CHECK-DAG: @"\01??_8E@Test6@@7BC@1@@" = {{.*}} [2 x i32] [i32 0, i32 20] -// CHECK-DAG: @"\01??_8D@Test6@@7BB@1@@" = {{.*}} [2 x i32] [i32 0, i32 24] -// CHECK-DAG: @"\01??_8D@Test6@@7BC@1@@" = {{.*}} [2 x i32] [i32 0, i32 16] +// CHECK-DAG: @"??_8G@Test6@@7BB@1@E@1@F@1@@" = +// CHECK-DAG: @"??_8G@Test6@@7BC@1@E@1@F@1@@" = +// CHECK-DAG: @"??_8G@Test6@@7BB@1@F@1@@" = +// CHECK-DAG: @"??_8G@Test6@@7BC@1@F@1@@" = +// CHECK-DAG: @"??_8G@Test6@@7BB@1@E@1@@" = +// CHECK-DAG: @"??_8G@Test6@@7BC@1@E@1@@" = +// CHECK-DAG: @"??_8F@Test6@@7BB@1@E@1@@" = {{.*}} [2 x i32] [i32 0, i32 52] +// CHECK-DAG: @"??_8F@Test6@@7BC@1@E@1@@" = {{.*}} [2 x i32] [i32 0, i32 44] +// CHECK-DAG: @"??_8F@Test6@@7BB@1@@" = {{.*}} [2 x i32] [i32 0, i32 24] +// CHECK-DAG: @"??_8F@Test6@@7BC@1@@" = {{.*}} [2 x i32] [i32 0, i32 16] +// CHECK-DAG: @"??_8C@Test6@@7B@" = {{.*}} [2 x i32] [i32 0, i32 12] +// CHECK-DAG: @"??_8B@Test6@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8] +// CHECK-DAG: @"??_8E@Test6@@7BB@1@@" = {{.*}} [2 x i32] [i32 0, i32 28] +// CHECK-DAG: @"??_8E@Test6@@7BC@1@@" = {{.*}} [2 x i32] [i32 0, i32 20] +// CHECK-DAG: @"??_8D@Test6@@7BB@1@@" = {{.*}} [2 x i32] [i32 0, i32 24] +// CHECK-DAG: @"??_8D@Test6@@7BC@1@@" = {{.*}} [2 x i32] [i32 0, i32 16] } namespace Test7 { @@ -121,8 +121,8 @@ struct D : virtual A { int d; }; struct E : B, D, virtual A, virtual C { int e; }; E o; -// CHECK-DAG: @"\01??_8E@Test7@@7B@" = {{.*}} [3 x i32] [i32 0, i32 12, i32 16] -// CHECK-DAG: @"\01??_8D@Test7@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8] +// CHECK-DAG: @"??_8E@Test7@@7B@" = {{.*}} [3 x i32] [i32 0, i32 12, i32 16] +// CHECK-DAG: @"??_8D@Test7@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8] } namespace Test8 { @@ -133,10 +133,10 @@ struct C : B { int c; }; struct D : virtual C { int d; }; D o; -// CHECK-DAG: @"\01??_8D@Test8@@7B01@@" = {{.*}} [3 x i32] [i32 0, i32 8, i32 12] -// CHECK-DAG: @"\01??_8D@Test8@@7BC@1@@" = {{.*}} [2 x i32] [i32 0, i32 -4] -// CHECK-DAG: @"\01??_8C@Test8@@7B@" = {{.*}} [2 x i32] [i32 0, i32 12] -// CHECK-DAG: @"\01??_8B@Test8@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8] +// CHECK-DAG: @"??_8D@Test8@@7B01@@" = {{.*}} [3 x i32] [i32 0, i32 8, i32 12] +// CHECK-DAG: @"??_8D@Test8@@7BC@1@@" = {{.*}} [2 x i32] [i32 0, i32 -4] +// CHECK-DAG: @"??_8C@Test8@@7B@" = {{.*}} [2 x i32] [i32 0, i32 12] +// CHECK-DAG: @"??_8B@Test8@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8] } namespace Test9 { @@ -150,17 +150,17 @@ struct D : BB, C { int d; }; struct E : virtual D { }; E e; -// CHECK-DAG: @"\01??_8E@Test9@@7B01@@" = -// CHECK-DAG: @"\01??_8E@Test9@@7BD@1@@" = -// CHECK-DAG: @"\01??_8E@Test9@@7BC@1@@" = -// CHECK-DAG: @"\01??_8E@Test9@@7BB@1@@" = -// CHECK-DAG: @"\01??_8D@Test9@@7B@" = -// CHECK-DAG: @"\01??_8D@Test9@@7BC@1@@" = -// CHECK-DAG: @"\01??_8D@Test9@@7BB@1@@" = -// CHECK-DAG: @"\01??_8C@Test9@@7B01@@" = -// CHECK-DAG: @"\01??_8C@Test9@@7BB@1@@" = -// CHECK-DAG: @"\01??_8BB@Test9@@7B@" = -// CHECK-DAG: @"\01??_8B@Test9@@7B@" = +// CHECK-DAG: @"??_8E@Test9@@7B01@@" = +// CHECK-DAG: @"??_8E@Test9@@7BD@1@@" = +// CHECK-DAG: @"??_8E@Test9@@7BC@1@@" = +// CHECK-DAG: @"??_8E@Test9@@7BB@1@@" = +// CHECK-DAG: @"??_8D@Test9@@7B@" = +// CHECK-DAG: @"??_8D@Test9@@7BC@1@@" = +// CHECK-DAG: @"??_8D@Test9@@7BB@1@@" = +// CHECK-DAG: @"??_8C@Test9@@7B01@@" = +// CHECK-DAG: @"??_8C@Test9@@7BB@1@@" = +// CHECK-DAG: @"??_8BB@Test9@@7B@" = +// CHECK-DAG: @"??_8B@Test9@@7B@" = } namespace Test10 { @@ -170,8 +170,8 @@ struct C : virtual A { int c; }; struct D : B, C { int d; }; D d; -// CHECK-DAG: @"\01??_8D@Test10@@7B@" = -// CHECK-DAG: @"\01??_8C@Test10@@7B@" = +// CHECK-DAG: @"??_8D@Test10@@7B@" = +// CHECK-DAG: @"??_8C@Test10@@7B@" = } @@ -185,12 +185,12 @@ struct E : C { int e; }; struct F : D, E { int f; }; F f; -// CHECK-DAG: @"\01??_8F@Test11@@7BD@1@@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 28] -// CHECK-DAG: @"\01??_8F@Test11@@7BE@1@@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 16] -// CHECK-DAG: @"\01??_8E@Test11@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 12] -// CHECK-DAG: @"\01??_8C@Test11@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 8] -// CHECK-DAG: @"\01??_8D@Test11@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 12] -// CHECK-DAG: @"\01??_8B@Test11@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 8] +// CHECK-DAG: @"??_8F@Test11@@7BD@1@@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 28] +// CHECK-DAG: @"??_8F@Test11@@7BE@1@@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 16] +// CHECK-DAG: @"??_8E@Test11@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 12] +// CHECK-DAG: @"??_8C@Test11@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 8] +// CHECK-DAG: @"??_8D@Test11@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 12] +// CHECK-DAG: @"??_8B@Test11@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 8] } @@ -203,17 +203,17 @@ struct D : C, B { int d; }; struct E : D, C, B { int e; }; E e; -// CHECK-DAG: @"\01??_8E@Test12@@7BC@1@D@1@@" = -// CHECK-DAG: @"\01??_8E@Test12@@7BB@1@D@1@@" = -// CHECK-DAG: @"\01??_8E@Test12@@7BD@1@@" = -// CHECK-DAG: @"\01??_8E@Test12@@7BC@1@@" = -// CHECK-DAG: @"\01??_8E@Test12@@7BB@1@@" = -// CHECK-DAG: @"\01??_8C@Test12@@7B01@@" = -// CHECK-DAG: @"\01??_8C@Test12@@7BB@1@@" = -// CHECK-DAG: @"\01??_8D@Test12@@7BC@1@@" = -// CHECK-DAG: @"\01??_8D@Test12@@7BB@1@@" = -// CHECK-DAG: @"\01??_8D@Test12@@7B@" = -// CHECK-DAG: @"\01??_8B@Test12@@7B@" = +// CHECK-DAG: @"??_8E@Test12@@7BC@1@D@1@@" = +// CHECK-DAG: @"??_8E@Test12@@7BB@1@D@1@@" = +// CHECK-DAG: @"??_8E@Test12@@7BD@1@@" = +// CHECK-DAG: @"??_8E@Test12@@7BC@1@@" = +// CHECK-DAG: @"??_8E@Test12@@7BB@1@@" = +// CHECK-DAG: @"??_8C@Test12@@7B01@@" = +// CHECK-DAG: @"??_8C@Test12@@7BB@1@@" = +// CHECK-DAG: @"??_8D@Test12@@7BC@1@@" = +// CHECK-DAG: @"??_8D@Test12@@7BB@1@@" = +// CHECK-DAG: @"??_8D@Test12@@7B@" = +// CHECK-DAG: @"??_8B@Test12@@7B@" = } namespace Test13 { @@ -224,17 +224,17 @@ struct D : virtual C { int d; }; struct E : D, C, B { int e; }; E e; -// CHECK-DAG: @"\01??_8E@Test13@@7BD@1@@" = -// CHECK-DAG: @"\01??_8E@Test13@@7BC@1@D@1@@" = -// CHECK-DAG: @"\01??_8E@Test13@@7BB@1@D@1@@" = -// CHECK-DAG: @"\01??_8E@Test13@@7BC@1@@" = -// CHECK-DAG: @"\01??_8E@Test13@@7BB@1@@" = -// CHECK-DAG: @"\01??_8D@Test13@@7B@" = -// CHECK-DAG: @"\01??_8D@Test13@@7BC@1@@" = -// CHECK-DAG: @"\01??_8D@Test13@@7BB@1@@" = -// CHECK-DAG: @"\01??_8C@Test13@@7B01@@" = -// CHECK-DAG: @"\01??_8C@Test13@@7BB@1@@" = -// CHECK-DAG: @"\01??_8B@Test13@@7B@" = +// CHECK-DAG: @"??_8E@Test13@@7BD@1@@" = +// CHECK-DAG: @"??_8E@Test13@@7BC@1@D@1@@" = +// CHECK-DAG: @"??_8E@Test13@@7BB@1@D@1@@" = +// CHECK-DAG: @"??_8E@Test13@@7BC@1@@" = +// CHECK-DAG: @"??_8E@Test13@@7BB@1@@" = +// CHECK-DAG: @"??_8D@Test13@@7B@" = +// CHECK-DAG: @"??_8D@Test13@@7BC@1@@" = +// CHECK-DAG: @"??_8D@Test13@@7BB@1@@" = +// CHECK-DAG: @"??_8C@Test13@@7B01@@" = +// CHECK-DAG: @"??_8C@Test13@@7BB@1@@" = +// CHECK-DAG: @"??_8B@Test13@@7B@" = } namespace Test14 { @@ -245,15 +245,15 @@ struct D : virtual C { int d; }; struct E : D, virtual C, virtual B { int e; }; E e; -// CHECK-DAG: @"\01??_8E@Test14@@7B@" = -// CHECK-DAG: @"\01??_8E@Test14@@7BC@1@@" = -// CHECK-DAG: @"\01??_8E@Test14@@7BB@1@@" = -// CHECK-DAG: @"\01??_8D@Test14@@7B@" = -// CHECK-DAG: @"\01??_8D@Test14@@7BC@1@@" = -// CHECK-DAG: @"\01??_8D@Test14@@7BB@1@@" = -// CHECK-DAG: @"\01??_8C@Test14@@7B01@@" = -// CHECK-DAG: @"\01??_8C@Test14@@7BB@1@@" = -// CHECK-DAG: @"\01??_8B@Test14@@7B@" = +// CHECK-DAG: @"??_8E@Test14@@7B@" = +// CHECK-DAG: @"??_8E@Test14@@7BC@1@@" = +// CHECK-DAG: @"??_8E@Test14@@7BB@1@@" = +// CHECK-DAG: @"??_8D@Test14@@7B@" = +// CHECK-DAG: @"??_8D@Test14@@7BC@1@@" = +// CHECK-DAG: @"??_8D@Test14@@7BB@1@@" = +// CHECK-DAG: @"??_8C@Test14@@7B01@@" = +// CHECK-DAG: @"??_8C@Test14@@7BB@1@@" = +// CHECK-DAG: @"??_8B@Test14@@7B@" = } namespace Test15 { @@ -264,14 +264,14 @@ struct D : virtual B { int d; }; struct E : D, C, B { int e; }; E e; -// CHECK-DAG: @"\01??_8E@Test15@@7BD@1@@" = -// CHECK-DAG: @"\01??_8E@Test15@@7BB@1@D@1@@" = -// CHECK-DAG: @"\01??_8E@Test15@@7BC@1@@" = -// CHECK-DAG: @"\01??_8E@Test15@@7BB@1@@" = -// CHECK-DAG: @"\01??_8C@Test15@@7B@" = -// CHECK-DAG: @"\01??_8D@Test15@@7B01@@" = -// CHECK-DAG: @"\01??_8D@Test15@@7BB@1@@" = -// CHECK-DAG: @"\01??_8B@Test15@@7B@" = +// CHECK-DAG: @"??_8E@Test15@@7BD@1@@" = +// CHECK-DAG: @"??_8E@Test15@@7BB@1@D@1@@" = +// CHECK-DAG: @"??_8E@Test15@@7BC@1@@" = +// CHECK-DAG: @"??_8E@Test15@@7BB@1@@" = +// CHECK-DAG: @"??_8C@Test15@@7B@" = +// CHECK-DAG: @"??_8D@Test15@@7B01@@" = +// CHECK-DAG: @"??_8D@Test15@@7BB@1@@" = +// CHECK-DAG: @"??_8B@Test15@@7B@" = } namespace Test16 { @@ -283,23 +283,23 @@ struct E : virtual D { int e; }; // ambig struct F : E, D, C, B { int f; }; // ambig F f; -// CHECK-DAG: @"\01??_8F@Test16@@7BE@1@@" = -// CHECK-DAG: @"\01??_8F@Test16@@7BD@1@E@1@@" = -// CHECK-DAG: @"\01??_8F@Test16@@7BC@1@E@1@@" = -// CHECK-DAG: @"\01??_8F@Test16@@7BB@1@E@1@@" = -// CHECK-DAG: @"\01??_8F@Test16@@7BD@1@@" = -// CHECK-DAG: @"\01??_8F@Test16@@7BC@1@@" = -// CHECK-DAG: @"\01??_8F@Test16@@7BB@1@@" = -// CHECK-DAG: @"\01??_8E@Test16@@7B01@@" = -// CHECK-DAG: @"\01??_8E@Test16@@7BD@1@@" = -// CHECK-DAG: @"\01??_8E@Test16@@7BC@1@@" = -// CHECK-DAG: @"\01??_8E@Test16@@7BB@1@@" = -// CHECK-DAG: @"\01??_8D@Test16@@7B@" = -// CHECK-DAG: @"\01??_8D@Test16@@7BC@1@@" = -// CHECK-DAG: @"\01??_8D@Test16@@7BB@1@@" = -// CHECK-DAG: @"\01??_8C@Test16@@7B01@@" = -// CHECK-DAG: @"\01??_8C@Test16@@7BB@1@@" = -// CHECK-DAG: @"\01??_8B@Test16@@7B@" = +// CHECK-DAG: @"??_8F@Test16@@7BE@1@@" = +// CHECK-DAG: @"??_8F@Test16@@7BD@1@E@1@@" = +// CHECK-DAG: @"??_8F@Test16@@7BC@1@E@1@@" = +// CHECK-DAG: @"??_8F@Test16@@7BB@1@E@1@@" = +// CHECK-DAG: @"??_8F@Test16@@7BD@1@@" = +// CHECK-DAG: @"??_8F@Test16@@7BC@1@@" = +// CHECK-DAG: @"??_8F@Test16@@7BB@1@@" = +// CHECK-DAG: @"??_8E@Test16@@7B01@@" = +// CHECK-DAG: @"??_8E@Test16@@7BD@1@@" = +// CHECK-DAG: @"??_8E@Test16@@7BC@1@@" = +// CHECK-DAG: @"??_8E@Test16@@7BB@1@@" = +// CHECK-DAG: @"??_8D@Test16@@7B@" = +// CHECK-DAG: @"??_8D@Test16@@7BC@1@@" = +// CHECK-DAG: @"??_8D@Test16@@7BB@1@@" = +// CHECK-DAG: @"??_8C@Test16@@7B01@@" = +// CHECK-DAG: @"??_8C@Test16@@7BB@1@@" = +// CHECK-DAG: @"??_8B@Test16@@7B@" = } namespace Test17 { @@ -318,16 +318,16 @@ struct J : virtual I { int j; }; struct K : virtual J { int k; }; // ambig K k; -// CHECK-DAG: @"\01??_8K@Test17@@7B01@@" = -// CHECK-DAG: @"\01??_8J@Test17@@7B@" = -// CHECK-DAG: @"\01??_8I@Test17@@7B01@@" = -// CHECK-DAG: @"\01??_8H@Test17@@7B@" = -// CHECK-DAG: @"\01??_8G@Test17@@7B01@@" = -// CHECK-DAG: @"\01??_8F@Test17@@7B@" = -// CHECK-DAG: @"\01??_8E@Test17@@7B01@@" = -// CHECK-DAG: @"\01??_8D@Test17@@7B@" = -// CHECK-DAG: @"\01??_8C@Test17@@7B01@@" = -// CHECK-DAG: @"\01??_8B@Test17@@7B@" = +// CHECK-DAG: @"??_8K@Test17@@7B01@@" = +// CHECK-DAG: @"??_8J@Test17@@7B@" = +// CHECK-DAG: @"??_8I@Test17@@7B01@@" = +// CHECK-DAG: @"??_8H@Test17@@7B@" = +// CHECK-DAG: @"??_8G@Test17@@7B01@@" = +// CHECK-DAG: @"??_8F@Test17@@7B@" = +// CHECK-DAG: @"??_8E@Test17@@7B01@@" = +// CHECK-DAG: @"??_8D@Test17@@7B@" = +// CHECK-DAG: @"??_8C@Test17@@7B01@@" = +// CHECK-DAG: @"??_8B@Test17@@7B@" = } namespace Test18 { @@ -338,14 +338,14 @@ struct D : C, B { int d; }; struct E : D, C, B { int e; }; E e; -// CHECK-DAG: @"\01??_8E@Test18@@7BC@1@D@1@@" = -// CHECK-DAG: @"\01??_8E@Test18@@7BB@1@D@1@@" = -// CHECK-DAG: @"\01??_8E@Test18@@7BC@1@@" = -// CHECK-DAG: @"\01??_8E@Test18@@7BB@1@@" = -// CHECK-DAG: @"\01??_8B@Test18@@7B@" = -// CHECK-DAG: @"\01??_8C@Test18@@7B@" = -// CHECK-DAG: @"\01??_8D@Test18@@7BC@1@@" = -// CHECK-DAG: @"\01??_8D@Test18@@7BB@1@@" = +// CHECK-DAG: @"??_8E@Test18@@7BC@1@D@1@@" = +// CHECK-DAG: @"??_8E@Test18@@7BB@1@D@1@@" = +// CHECK-DAG: @"??_8E@Test18@@7BC@1@@" = +// CHECK-DAG: @"??_8E@Test18@@7BB@1@@" = +// CHECK-DAG: @"??_8B@Test18@@7B@" = +// CHECK-DAG: @"??_8C@Test18@@7B@" = +// CHECK-DAG: @"??_8D@Test18@@7BC@1@@" = +// CHECK-DAG: @"??_8D@Test18@@7BB@1@@" = } namespace Test19 { @@ -356,16 +356,16 @@ struct D : virtual C, virtual B { int d; }; struct E : virtual D, virtual C, virtual B { int e; }; E e; -// CHECK-DAG: @"\01??_8E@Test19@@7B01@@" = -// CHECK-DAG: @"\01??_8E@Test19@@7BD@1@@" = -// CHECK-DAG: @"\01??_8E@Test19@@7BC@1@@" = -// CHECK-DAG: @"\01??_8E@Test19@@7BB@1@@" = -// CHECK-DAG: @"\01??_8D@Test19@@7B@" = -// CHECK-DAG: @"\01??_8D@Test19@@7BC@1@@" = -// CHECK-DAG: @"\01??_8D@Test19@@7BB@1@@" = -// CHECK-DAG: @"\01??_8C@Test19@@7B01@@" = -// CHECK-DAG: @"\01??_8C@Test19@@7BB@1@@" = -// CHECK-DAG: @"\01??_8B@Test19@@7B@" = +// CHECK-DAG: @"??_8E@Test19@@7B01@@" = +// CHECK-DAG: @"??_8E@Test19@@7BD@1@@" = +// CHECK-DAG: @"??_8E@Test19@@7BC@1@@" = +// CHECK-DAG: @"??_8E@Test19@@7BB@1@@" = +// CHECK-DAG: @"??_8D@Test19@@7B@" = +// CHECK-DAG: @"??_8D@Test19@@7BC@1@@" = +// CHECK-DAG: @"??_8D@Test19@@7BB@1@@" = +// CHECK-DAG: @"??_8C@Test19@@7B01@@" = +// CHECK-DAG: @"??_8C@Test19@@7BB@1@@" = +// CHECK-DAG: @"??_8B@Test19@@7B@" = } namespace Test20 { @@ -377,10 +377,10 @@ struct D : virtual B { int d; }; struct E : C, D { int e; }; E f; -// CHECK-DAG: @"\01??_8E@Test20@@7BC@1@@" = linkonce_odr unnamed_addr constant [3 x i32] [i32 0, i32 20, i32 24] -// CHECK-DAG: @"\01??_8E@Test20@@7BD@1@@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 16] -// CHECK-DAG: @"\01??_8D@Test20@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 8] -// CHECK-DAG: @"\01??_8C@Test20@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 8] +// CHECK-DAG: @"??_8E@Test20@@7BC@1@@" = linkonce_odr unnamed_addr constant [3 x i32] [i32 0, i32 20, i32 24] +// CHECK-DAG: @"??_8E@Test20@@7BD@1@@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 16] +// CHECK-DAG: @"??_8D@Test20@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 8] +// CHECK-DAG: @"??_8C@Test20@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 8] } namespace Test21 { @@ -394,21 +394,21 @@ struct G : E { int g; }; struct H : F, G { int h; }; H h; -// CHECK-DAG: @"\01??_8H@Test21@@7B@" = -// CHECK-DAG: @"\01??_8H@Test21@@7BC@1@F@1@@" = -// CHECK-DAG: @"\01??_8H@Test21@@7BD@1@F@1@@" = -// CHECK-DAG: @"\01??_8H@Test21@@7BC@1@G@1@@" = -// CHECK-DAG: @"\01??_8H@Test21@@7BD@1@G@1@@" = -// CHECK-DAG: @"\01??_8G@Test21@@7BC@1@@" = -// CHECK-DAG: @"\01??_8G@Test21@@7BD@1@@" = -// CHECK-DAG: @"\01??_8F@Test21@@7B@" = -// CHECK-DAG: @"\01??_8F@Test21@@7BC@1@@" = -// CHECK-DAG: @"\01??_8F@Test21@@7BD@1@@" = -// CHECK-DAG: @"\01??_8E@Test21@@7BC@1@@" = -// CHECK-DAG: @"\01??_8E@Test21@@7BD@1@@" = -// CHECK-DAG: @"\01??_8D@Test21@@7B@" = -// CHECK-DAG: @"\01??_8B@Test21@@7B@" = -// CHECK-DAG: @"\01??_8C@Test21@@7B@" = +// CHECK-DAG: @"??_8H@Test21@@7B@" = +// CHECK-DAG: @"??_8H@Test21@@7BC@1@F@1@@" = +// CHECK-DAG: @"??_8H@Test21@@7BD@1@F@1@@" = +// CHECK-DAG: @"??_8H@Test21@@7BC@1@G@1@@" = +// CHECK-DAG: @"??_8H@Test21@@7BD@1@G@1@@" = +// CHECK-DAG: @"??_8G@Test21@@7BC@1@@" = +// CHECK-DAG: @"??_8G@Test21@@7BD@1@@" = +// CHECK-DAG: @"??_8F@Test21@@7B@" = +// CHECK-DAG: @"??_8F@Test21@@7BC@1@@" = +// CHECK-DAG: @"??_8F@Test21@@7BD@1@@" = +// CHECK-DAG: @"??_8E@Test21@@7BC@1@@" = +// CHECK-DAG: @"??_8E@Test21@@7BD@1@@" = +// CHECK-DAG: @"??_8D@Test21@@7B@" = +// CHECK-DAG: @"??_8B@Test21@@7B@" = +// CHECK-DAG: @"??_8C@Test21@@7B@" = } namespace Test22 { @@ -418,8 +418,8 @@ struct C { int c; }; struct D : B, virtual C { int d; }; D d; -// CHECK-DAG: @"\01??_8D@Test22@@7B@" = linkonce_odr unnamed_addr constant [3 x i32] [i32 0, i32 12, i32 16] -// CHECK-DAG: @"\01??_8B@Test22@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 8] +// CHECK-DAG: @"??_8D@Test22@@7B@" = linkonce_odr unnamed_addr constant [3 x i32] [i32 0, i32 12, i32 16] +// CHECK-DAG: @"??_8B@Test22@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 8] } namespace Test23 { @@ -430,8 +430,8 @@ struct C { int c; }; struct D : virtual C, B { int d; }; D d; -// CHECK-DAG: @"\01??_8D@Test23@@7B@" = linkonce_odr unnamed_addr constant [3 x i32] [i32 0, i32 16, i32 12] -// CHECK-DAG: @"\01??_8B@Test23@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 8] +// CHECK-DAG: @"??_8D@Test23@@7B@" = linkonce_odr unnamed_addr constant [3 x i32] [i32 0, i32 16, i32 12] +// CHECK-DAG: @"??_8B@Test23@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 8] } namespace Test24 { @@ -444,8 +444,8 @@ struct D : virtual C, B { }; D d; -// CHECK-DAG: @"\01??_8D@Test24@@7B@" = linkonce_odr unnamed_addr constant [3 x i32] [i32 0, i32 16, i32 12] -// CHECK-DAG: @"\01??_8B@Test24@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 8] +// CHECK-DAG: @"??_8D@Test24@@7B@" = linkonce_odr unnamed_addr constant [3 x i32] [i32 0, i32 16, i32 12] +// CHECK-DAG: @"??_8B@Test24@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 8] } namespace Test25 { @@ -458,8 +458,8 @@ struct C { int c; }; struct D : virtual C, B { int d; }; D d; -// CHECK-DAG: @"\01??_8D@Test25@@7B@" = linkonce_odr unnamed_addr constant [3 x i32] [i32 -4, i32 16, i32 12] -// CHECK-DAG: @"\01??_8B@Test25@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 -4, i32 8] +// CHECK-DAG: @"??_8D@Test25@@7B@" = linkonce_odr unnamed_addr constant [3 x i32] [i32 -4, i32 16, i32 12] +// CHECK-DAG: @"??_8B@Test25@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 -4, i32 8] } namespace Test26 { @@ -474,8 +474,8 @@ struct E : virtual B { struct F: virtual C, D, E { int f; }; F f; // F reuses the D's vbptr, even though D is laid out after E. -// CHECK-DAG: @"\01??_8F@Test26@@7BD@1@@" = linkonce_odr unnamed_addr constant [4 x i32] [i32 0, i32 16, i32 12, i32 20] -// CHECK-DAG: @"\01??_8F@Test26@@7BE@1@@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 -4, i32 28] +// CHECK-DAG: @"??_8F@Test26@@7BD@1@@" = linkonce_odr unnamed_addr constant [4 x i32] [i32 0, i32 16, i32 12, i32 20] +// CHECK-DAG: @"??_8F@Test26@@7BE@1@@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 -4, i32 28] } namespace Test27 { @@ -489,14 +489,14 @@ struct F : C, E {}; struct G : F, D, C, B {}; G x; -// CHECK-DAG: @"\01??_8G@Test27@@7BB@1@@" = -// CHECK-DAG: @"\01??_8G@Test27@@7BB@1@F@1@@" = -// CHECK-DAG: @"\01??_8G@Test27@@7BC@1@@" = -// CHECK-DAG: @"\01??_8G@Test27@@7BC@1@D@1@@" = -// CHECK-DAG: @"\01??_8G@Test27@@7BC@1@E@1@@" = -// CHECK-DAG: @"\01??_8G@Test27@@7BC@1@F@1@@" = -// CHECK-DAG: @"\01??_8G@Test27@@7BD@1@@" = -// CHECK-DAG: @"\01??_8G@Test27@@7BF@1@@" = +// CHECK-DAG: @"??_8G@Test27@@7BB@1@@" = +// CHECK-DAG: @"??_8G@Test27@@7BB@1@F@1@@" = +// CHECK-DAG: @"??_8G@Test27@@7BC@1@@" = +// CHECK-DAG: @"??_8G@Test27@@7BC@1@D@1@@" = +// CHECK-DAG: @"??_8G@Test27@@7BC@1@E@1@@" = +// CHECK-DAG: @"??_8G@Test27@@7BC@1@F@1@@" = +// CHECK-DAG: @"??_8G@Test27@@7BD@1@@" = +// CHECK-DAG: @"??_8G@Test27@@7BF@1@@" = } namespace Test28 { @@ -509,14 +509,14 @@ struct E : C, D {}; struct F : virtual E, virtual D, virtual C {}; F x; -// CHECK-DAG: @"\01??_8F@Test28@@7B01@@" = -// CHECK-DAG: @"\01??_8F@Test28@@7BB@1@@" = -// CHECK-DAG: @"\01??_8F@Test28@@7BC@1@@" = -// CHECK-DAG: @"\01??_8F@Test28@@7BC@1@D@1@@" = -// CHECK-DAG: @"\01??_8F@Test28@@7BC@1@D@1@E@1@@" = -// CHECK-DAG: @"\01??_8F@Test28@@7BC@1@E@1@@" = -// CHECK-DAG: @"\01??_8F@Test28@@7BD@1@@" = -// CHECK-DAG: @"\01??_8F@Test28@@7BE@1@@" = +// CHECK-DAG: @"??_8F@Test28@@7B01@@" = +// CHECK-DAG: @"??_8F@Test28@@7BB@1@@" = +// CHECK-DAG: @"??_8F@Test28@@7BC@1@@" = +// CHECK-DAG: @"??_8F@Test28@@7BC@1@D@1@@" = +// CHECK-DAG: @"??_8F@Test28@@7BC@1@D@1@E@1@@" = +// CHECK-DAG: @"??_8F@Test28@@7BC@1@E@1@@" = +// CHECK-DAG: @"??_8F@Test28@@7BD@1@@" = +// CHECK-DAG: @"??_8F@Test28@@7BE@1@@" = } namespace Test29 { @@ -526,7 +526,7 @@ struct C : virtual B {}; struct D : C {}; D d; -// CHECK-DAG: @"\01??_8D@Test29@@7BB@1@@" = linkonce_odr unnamed_addr constant [2 x i32] zeroinitializer +// CHECK-DAG: @"??_8D@Test29@@7BB@1@@" = linkonce_odr unnamed_addr constant [2 x i32] zeroinitializer } namespace Test30 { @@ -537,5 +537,5 @@ template <class> struct B : virtual A { extern template class B<int>; template B<int>::B(); -// CHECK-DAG: @"\01??_8?$B@H@Test30@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 4], comdat +// CHECK-DAG: @"??_8?$B@H@Test30@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 4], comdat } diff --git a/test/CodeGenCXX/microsoft-abi-vftables.cpp b/test/CodeGenCXX/microsoft-abi-vftables.cpp index 968955f4ee1b3..65370ab1ece5a 100644 --- a/test/CodeGenCXX/microsoft-abi-vftables.cpp +++ b/test/CodeGenCXX/microsoft-abi-vftables.cpp @@ -1,45 +1,45 @@ // RUN: %clang_cc1 %s -fno-rtti -triple=i386-pc-win32 -fms-extensions -emit-llvm -o - -O1 -disable-llvm-passes | FileCheck %s -check-prefix=NO-RTTI // RUN: %clang_cc1 %s -triple=i386-pc-win32 -fms-extensions -emit-llvm -o - -O1 -disable-llvm-passes | FileCheck %s -check-prefix=RTTI -// RTTI-DAG: $"\01??_7S@@6B@" = comdat largest -// RTTI-DAG: $"\01??_7V@@6B@" = comdat largest +// RTTI-DAG: $"??_7S@@6B@" = comdat largest +// RTTI-DAG: $"??_7V@@6B@" = comdat largest struct S { virtual ~S(); } s; -// RTTI-DAG: [[VTABLE_S:@.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast ({{.*}} @"\01??_R4S@@6B@" to i8*), i8* bitcast ({{.*}} @"\01??_GS@@UAEPAXI@Z" to i8*)] }, comdat($"\01??_7S@@6B@") -// RTTI-DAG: @"\01??_7S@@6B@" = unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* [[VTABLE_S]], i32 0, i32 0, i32 1) +// RTTI-DAG: [[VTABLE_S:@.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast ({{.*}} @"??_R4S@@6B@" to i8*), i8* bitcast ({{.*}} @"??_GS@@UAEPAXI@Z" to i8*)] }, comdat($"??_7S@@6B@") +// RTTI-DAG: @"??_7S@@6B@" = unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* [[VTABLE_S]], i32 0, i32 0, i32 1) -// NO-RTTI-DAG: @"\01??_7S@@6B@" = linkonce_odr unnamed_addr constant { [1 x i8*] } { [1 x i8*] [i8* bitcast ({{.*}} @"\01??_GS@@UAEPAXI@Z" to i8*)] } +// NO-RTTI-DAG: @"??_7S@@6B@" = linkonce_odr unnamed_addr constant { [1 x i8*] } { [1 x i8*] [i8* bitcast ({{.*}} @"??_GS@@UAEPAXI@Z" to i8*)] } struct __declspec(dllimport) U { virtual ~U(); } u; -// RTTI-DAG: [[VTABLE_U:@.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast ({{.*}} @"\01??_R4U@@6B@" to i8*), i8* bitcast ({{.*}} @"\01??_GU@@UAEPAXI@Z" to i8*)] } -// RTTI-DAG: @"\01??_SU@@6B@" = unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* [[VTABLE_U]], i32 0, i32 0, i32 1) +// RTTI-DAG: [[VTABLE_U:@.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast ({{.*}} @"??_R4U@@6B@" to i8*), i8* bitcast ({{.*}} @"??_GU@@UAEPAXI@Z" to i8*)] } +// RTTI-DAG: @"??_SU@@6B@" = unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* [[VTABLE_U]], i32 0, i32 0, i32 1) -// NO-RTTI-DAG: @"\01??_SU@@6B@" = linkonce_odr unnamed_addr constant { [1 x i8*] } { [1 x i8*] [i8* bitcast ({{.*}} @"\01??_GU@@UAEPAXI@Z" to i8*)] } +// NO-RTTI-DAG: @"??_SU@@6B@" = linkonce_odr unnamed_addr constant { [1 x i8*] } { [1 x i8*] [i8* bitcast ({{.*}} @"??_GU@@UAEPAXI@Z" to i8*)] } struct __declspec(dllexport) V { virtual ~V(); } v; -// RTTI-DAG: [[VTABLE_V:@.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast ({{.*}} @"\01??_R4V@@6B@" to i8*), i8* bitcast ({{.*}} @"\01??_GV@@UAEPAXI@Z" to i8*)] }, comdat($"\01??_7V@@6B@") -// RTTI-DAG: @"\01??_7V@@6B@" = dllexport unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* [[VTABLE_V]], i32 0, i32 0, i32 1) +// RTTI-DAG: [[VTABLE_V:@.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast ({{.*}} @"??_R4V@@6B@" to i8*), i8* bitcast ({{.*}} @"??_GV@@UAEPAXI@Z" to i8*)] }, comdat($"??_7V@@6B@") +// RTTI-DAG: @"??_7V@@6B@" = dllexport unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* [[VTABLE_V]], i32 0, i32 0, i32 1) -// NO-RTTI-DAG: @"\01??_7V@@6B@" = weak_odr dllexport unnamed_addr constant { [1 x i8*] } { [1 x i8*] [i8* bitcast ({{.*}} @"\01??_GV@@UAEPAXI@Z" to i8*)] } +// NO-RTTI-DAG: @"??_7V@@6B@" = weak_odr dllexport unnamed_addr constant { [1 x i8*] } { [1 x i8*] [i8* bitcast ({{.*}} @"??_GV@@UAEPAXI@Z" to i8*)] } namespace { struct W { virtual ~W() {} } w; } -// RTTI-DAG: [[VTABLE_W:@.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast ({{.*}} @"\01??_R4W@?A@@6B@" to i8*), i8* bitcast ({{.*}} @"\01??_GW@?A@@UAEPAXI@Z" to i8*)] } -// RTTI-DAG: @"\01??_7W@?A@@6B@" = internal unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* [[VTABLE_W]], i32 0, i32 0, i32 1) +// RTTI-DAG: [[VTABLE_W:@.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast ({{.*}} @"??_R4W@?A@@6B@" to i8*), i8* bitcast ({{.*}} @"??_GW@?A@@UAEPAXI@Z" to i8*)] } +// RTTI-DAG: @"??_7W@?A@@6B@" = internal unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* [[VTABLE_W]], i32 0, i32 0, i32 1) -// NO-RTTI-DAG: @"\01??_7W@?A@@6B@" = internal unnamed_addr constant { [1 x i8*] } { [1 x i8*] [i8* bitcast ({{.*}} @"\01??_GW@?A@@UAEPAXI@Z" to i8*)] } +// NO-RTTI-DAG: @"??_7W@?A@@6B@" = internal unnamed_addr constant { [1 x i8*] } { [1 x i8*] [i8* bitcast ({{.*}} @"??_GW@?A@@UAEPAXI@Z" to i8*)] } struct X {}; template <class> struct Y : virtual X { @@ -49,7 +49,7 @@ template <class> struct Y : virtual X { extern template class Y<int>; template Y<int>::Y(); -// RTTI-DAG: [[VTABLE_Y:@.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (%rtti.CompleteObjectLocator* @"\01??_R4?$Y@H@@6B@" to i8*), i8* bitcast (i8* (%struct.Y*, i32)* @"\01??_G?$Y@H@@UAEPAXI@Z" to i8*)] }, comdat($"\01??_7?$Y@H@@6B@") -// RTTI-DAG: @"\01??_7?$Y@H@@6B@" = unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* [[VTABLE_Y]], i32 0, i32 0, i32 1) +// RTTI-DAG: [[VTABLE_Y:@.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (%rtti.CompleteObjectLocator* @"??_R4?$Y@H@@6B@" to i8*), i8* bitcast (i8* (%struct.Y*, i32)* @"??_G?$Y@H@@UAEPAXI@Z" to i8*)] }, comdat($"??_7?$Y@H@@6B@") +// RTTI-DAG: @"??_7?$Y@H@@6B@" = unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* [[VTABLE_Y]], i32 0, i32 0, i32 1) -// NO-RTTI-DAG: @"\01??_7?$Y@H@@6B@" = linkonce_odr unnamed_addr constant { [1 x i8*] } { [1 x i8*] [i8* bitcast (i8* (%struct.Y*, i32)* @"\01??_G?$Y@H@@UAEPAXI@Z" to i8*)] }, comdat +// NO-RTTI-DAG: @"??_7?$Y@H@@6B@" = linkonce_odr unnamed_addr constant { [1 x i8*] } { [1 x i8*] [i8* bitcast (i8* (%struct.Y*, i32)* @"??_G?$Y@H@@UAEPAXI@Z" to i8*)] }, comdat diff --git a/test/CodeGenCXX/microsoft-abi-virtual-inheritance-vtordisps.cpp b/test/CodeGenCXX/microsoft-abi-virtual-inheritance-vtordisps.cpp index 2f141b2a66ec8..0120299a7da44 100644 --- a/test/CodeGenCXX/microsoft-abi-virtual-inheritance-vtordisps.cpp +++ b/test/CodeGenCXX/microsoft-abi-virtual-inheritance-vtordisps.cpp @@ -23,8 +23,9 @@ struct D : virtual C { D::D() {} // Forces vftable emission. -// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @"\01?f@D@@$4PPPPPPPM@A@AEXXZ" +// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"?f@D@@$4PPPPPPPM@A@AEXXZ" // Note that the vtordisp is applied before really adjusting to D*. +// CHECK: %[[COERCE_LOAD:.*]] = load %struct.D*, %struct.D** %{{.*}} // CHECK: %[[ECX:.*]] = load %struct.D*, %struct.D** %{{.*}} // CHECK: %[[ECX_i8:.*]] = bitcast %struct.D* %[[ECX]] to i8* // CHECK: %[[VTORDISP_PTR_i8:.*]] = getelementptr inbounds i8, i8* %[[ECX_i8]], i32 -4 @@ -32,10 +33,11 @@ D::D() {} // Forces vftable emission. // CHECK: %[[VTORDISP:.*]] = load i32, i32* %[[VTORDISP_PTR]] // CHECK: %[[VTORDISP_NEG:.*]] = sub i32 0, %[[VTORDISP]] // CHECK: %[[ADJUSTED_i8:.*]] = getelementptr i8, i8* %[[ECX_i8]], i32 %[[VTORDISP_NEG]] -// CHECK: call x86_thiscallcc void @"\01?f@D@@UAEXXZ"(i8* %[[ADJUSTED_i8]]) +// CHECK: call x86_thiscallcc void @"?f@D@@UAEXXZ"(i8* %[[ADJUSTED_i8]]) // CHECK: ret void -// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @"\01?f@D@@$4PPPPPPPI@3AEXXZ" +// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"?f@D@@$4PPPPPPPI@3AEXXZ" +// CHECK: %[[COERCE_LOAD:.*]] = load %struct.D*, %struct.D** %{{.*}} // CHECK: %[[ECX:.*]] = load %struct.D*, %struct.D** %{{.*}} // CHECK: %[[ECX_i8:.*]] = bitcast %struct.D* %[[ECX]] to i8* // CHECK: %[[VTORDISP_PTR_i8:.*]] = getelementptr inbounds i8, i8* %[[ECX_i8]], i32 -8 @@ -44,7 +46,7 @@ D::D() {} // Forces vftable emission. // CHECK: %[[VTORDISP_NEG:.*]] = sub i32 0, %[[VTORDISP]] // CHECK: %[[VTORDISP_ADJUSTED_i8:.*]] = getelementptr i8, i8* %[[ECX_i8]], i32 %[[VTORDISP_NEG]] // CHECK: %[[ADJUSTED_i8:.*]] = getelementptr i8, i8* %[[VTORDISP_ADJUSTED_i8]], i32 -4 -// CHECK: call x86_thiscallcc void @"\01?f@D@@UAEXXZ"(i8* %[[ADJUSTED_i8]]) +// CHECK: call x86_thiscallcc void @"?f@D@@UAEXXZ"(i8* %[[ADJUSTED_i8]]) // CHECK: ret void struct E : virtual A { @@ -64,7 +66,8 @@ struct G : virtual F, virtual E { G::G() {} // Forces vftable emission. -// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @"\01?f@E@@$R4BA@M@PPPPPPPM@7AEXXZ"(i8*) +// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"?f@E@@$R4BA@M@PPPPPPPM@7AEXXZ"(i8* +// CHECK: %[[COERCE_LOAD:.*]] = load %struct.E*, %struct.E** %{{.*}} // CHECK: %[[ECX:.*]] = load %struct.E*, %struct.E** %{{.*}} // CHECK: %[[ECX_i8:.*]] = bitcast %struct.E* %[[ECX]] to i8* // CHECK: %[[VTORDISP_PTR_i8:.*]] = getelementptr inbounds i8, i8* %[[ECX_i8]], i32 -4 @@ -79,5 +82,5 @@ G::G() {} // Forces vftable emission. // CHECK: %[[VBASE_OFFSET:.*]] = load i32, i32* %[[VBOFFSET_PTR]] // CHECK: %[[VBASE:.*]] = getelementptr inbounds i8, i8* %[[VBPTR_i8]], i32 %[[VBASE_OFFSET]] // CHECK: %[[ARG_i8:.*]] = getelementptr i8, i8* %[[VBASE]], i32 8 -// CHECK: call x86_thiscallcc void @"\01?f@E@@UAEXXZ"(i8* %[[ARG_i8]]) +// CHECK: call x86_thiscallcc void @"?f@E@@UAEXXZ"(i8* %[[ARG_i8]]) // CHECK: ret void diff --git a/test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp b/test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp index c9dd1dd7d8e2f..212c8dc84ae3e 100644 --- a/test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp +++ b/test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp @@ -20,7 +20,7 @@ struct B : virtual VBase { }; B::B() { - // CHECK-LABEL: define x86_thiscallcc %struct.B* @"\01??0B@@QAE@XZ" + // CHECK-LABEL: define dso_local x86_thiscallcc %struct.B* @"??0B@@QAE@XZ" // CHECK: %[[THIS:.*]] = load %struct.B*, %struct.B** // CHECK: br i1 %{{.*}}, label %[[INIT_VBASES:.*]], label %[[SKIP_VBASES:.*]] @@ -33,7 +33,7 @@ B::B() { // CHECK: %[[THIS_i8:.*]] = bitcast %struct.B* %[[THIS]] to i8* // CHECK: %[[VFPTR_i8:.*]] = getelementptr inbounds i8, i8* %[[THIS_i8]], i32 %{{.*}} // CHECK: %[[VFPTR:.*]] = bitcast i8* %[[VFPTR_i8]] to i32 (...)*** - // CHECK: store i32 (...)** bitcast ({ [3 x i8*] }* @"\01??_7B@@6B@" to i32 (...)**), i32 (...)*** %[[VFPTR]] + // CHECK: store i32 (...)** bitcast ({ [3 x i8*] }* @"??_7B@@6B@" to i32 (...)**), i32 (...)*** %[[VFPTR]] // Initialize vtorDisp: // CHECK: %[[THIS_i8:.*]] = bitcast %struct.B* %[[THIS]] to i8* @@ -51,7 +51,7 @@ B::B() { } B::~B() { - // CHECK-LABEL: define x86_thiscallcc void @"\01??1B@@UAE@XZ" + // CHECK-LABEL: define dso_local x86_thiscallcc void @"??1B@@UAE@XZ" // Store initial this: // CHECK: %[[THIS_ADDR:.*]] = alloca %struct.B* // CHECK: store %struct.B* %{{.*}}, %struct.B** %[[THIS_ADDR]], align 4 @@ -68,7 +68,7 @@ B::~B() { // CHECK: %[[THIS_i8:.*]] = bitcast %struct.B* %[[THIS]] to i8* // CHECK: %[[VFPTR_i8:.*]] = getelementptr inbounds i8, i8* %[[THIS_i8]], i32 %{{.*}} // CHECK: %[[VFPTR:.*]] = bitcast i8* %[[VFPTR_i8]] to i32 (...)*** - // CHECK: store i32 (...)** bitcast ({ [3 x i8*] }* @"\01??_7B@@6B@" to i32 (...)**), i32 (...)*** %[[VFPTR]] + // CHECK: store i32 (...)** bitcast ({ [3 x i8*] }* @"??_7B@@6B@" to i32 (...)**), i32 (...)*** %[[VFPTR]] // Initialize vtorDisp: // CHECK: %[[THIS_i8:.*]] = bitcast %struct.B* %[[THIS]] to i8* @@ -86,38 +86,44 @@ B::~B() { // CHECK: ret - // CHECK2-LABEL: define linkonce_odr x86_thiscallcc void @"\01??_DB@@QAEXXZ"(%struct.B* + // CHECK2-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"??_DB@@QAEXXZ"(%struct.B* // CHECK2: %[[THIS:.*]] = load %struct.B*, %struct.B** {{.*}} // CHECK2: %[[THIS_i8:.*]] = bitcast %struct.B* %[[THIS]] to i8* // CHECK2: %[[B_i8:.*]] = getelementptr i8, i8* %[[THIS_i8]], i32 8 // CHECK2: %[[B:.*]] = bitcast i8* %[[B_i8]] to %struct.B* - // CHECK2: call x86_thiscallcc void @"\01??1B@@UAE@XZ"(%struct.B* %[[B]]) + // CHECK2: call x86_thiscallcc void @"??1B@@UAE@XZ"(%struct.B* %[[B]]) // CHECK2: %[[THIS_i8:.*]] = bitcast %struct.B* %[[THIS]] to i8* // CHECK2: %[[VBASE_i8:.*]] = getelementptr inbounds i8, i8* %[[THIS_i8]], i32 8 // CHECK2: %[[VBASE:.*]] = bitcast i8* %[[VBASE_i8]] to %struct.VBase* - // CHECK2: call x86_thiscallcc void @"\01??1VBase@@UAE@XZ"(%struct.VBase* %[[VBASE]]) + // CHECK2: call x86_thiscallcc void @"??1VBase@@UAE@XZ"(%struct.VBase* %[[VBASE]]) // CHECK2: ret - // CHECK2-LABEL: define linkonce_odr x86_thiscallcc i8* @"\01??_GB@@UAEPAXI@Z" + // CHECK2-LABEL: define linkonce_odr dso_local x86_thiscallcc i8* @"??_GB@@UAEPAXI@Z" // CHECK2: store %struct.B* %{{.*}}, %struct.B** %[[THIS_ADDR:.*]], align 4 // CHECK2: %[[THIS:.*]] = load %struct.B*, %struct.B** %[[THIS_ADDR]] // CHECK2: %[[THIS_PARAM_i8:.*]] = bitcast %struct.B* %[[THIS]] to i8* // CHECK2: %[[THIS_i8:.*]] = getelementptr inbounds i8, i8* %[[THIS_PARAM_i8:.*]], i32 -8 // CHECK2: %[[THIS:.*]] = bitcast i8* %[[THIS_i8]] to %struct.B* - // CHECK2: call x86_thiscallcc void @"\01??_DB@@QAEXXZ"(%struct.B* %[[THIS]]) + // CHECK2: call x86_thiscallcc void @"??_DB@@QAEXXZ"(%struct.B* %[[THIS]]) // ... // CHECK2: ret } void B::foo() { -// CHECK-LABEL: define x86_thiscallcc void @"\01?foo@B@@UAEXXZ"(i8* +// CHECK-LABEL: define dso_local x86_thiscallcc void @"?foo@B@@UAEXXZ"(i8* // // B::foo gets 'this' cast to VBase* in ECX (i.e. this+8) so we // need to adjust 'this' before use. // -// Store initial this: +// Coerce this to correct type: +// CHECK: %[[THIS_STORE:.*]] = alloca %struct.B* // CHECK: %[[THIS_ADDR:.*]] = alloca %struct.B* -// CHECK: store %struct.B* %{{.*}}, %struct.B** %[[THIS_ADDR]], align 4 +// CHECK: %[[COERCE_VAL:.*]] = bitcast i8* %{{.*}} to %struct.B* +// CHECK: store %struct.B* %[[COERCE_VAL]], %struct.B** %[[THIS_STORE]], align 4 +// +// Store initial this: +// CHECK: %[[THIS_INIT:.*]] = load %struct.B*, %struct.B** %[[THIS_STORE]] +// CHECK: store %struct.B* %[[THIS_INIT]], %struct.B** %[[THIS_ADDR]], align 4 // // Reload and adjust the this parameter: // CHECK: %[[THIS_RELOAD:.*]] = load %struct.B*, %struct.B** %[[THIS_ADDR]] @@ -143,7 +149,7 @@ void B::foo() { } void call_vbase_bar(B *obj) { -// CHECK-LABEL: define void @"\01?call_vbase_bar@@YAXPAUB@@@Z"(%struct.B* %obj) +// CHECK-LABEL: define dso_local void @"?call_vbase_bar@@YAXPAUB@@@Z"(%struct.B* %obj) // CHECK: %[[OBJ:.*]] = load %struct.B obj->bar(); @@ -157,11 +163,7 @@ void call_vbase_bar(B *obj) { // CHECK: %[[VBENTRY:.*]] = getelementptr inbounds i32, i32* %[[VBTABLE]], i32 1 // CHECK: %[[VBOFFSET32:.*]] = load i32, i32* %[[VBENTRY]] // CHECK: %[[VBOFFSET:.*]] = add nsw i32 0, %[[VBOFFSET32]] -// CHECK: %[[VBASE_i8:.*]] = getelementptr inbounds i8, i8* %[[OBJ_i8]], i32 %[[VBOFFSET]] -// CHECK: %[[VFPTR:.*]] = bitcast i8* %[[VBASE_i8]] to void (i8*)*** -// CHECK: %[[VFTABLE:.*]] = load void (i8*)**, void (i8*)*** %[[VFPTR]] -// CHECK: %[[VFUN:.*]] = getelementptr inbounds void (i8*)*, void (i8*)** %[[VFTABLE]], i64 2 -// CHECK: %[[VFUN_VALUE:.*]] = load void (i8*)*, void (i8*)** %[[VFUN]] +// CHECK: %[[VBASE:.*]] = getelementptr inbounds i8, i8* %[[OBJ_i8]], i32 %[[VBOFFSET]] // // CHECK: %[[OBJ_i8:.*]] = bitcast %struct.B* %[[OBJ]] to i8* // CHECK: %[[VBPTR:.*]] = getelementptr inbounds i8, i8* %[[OBJ_i8]], i32 0 @@ -170,7 +172,11 @@ void call_vbase_bar(B *obj) { // CHECK: %[[VBENTRY:.*]] = getelementptr inbounds i32, i32* %[[VBTABLE]], i32 1 // CHECK: %[[VBOFFSET32:.*]] = load i32, i32* %[[VBENTRY]] // CHECK: %[[VBOFFSET:.*]] = add nsw i32 0, %[[VBOFFSET32]] -// CHECK: %[[VBASE:.*]] = getelementptr inbounds i8, i8* %[[OBJ_i8]], i32 %[[VBOFFSET]] +// CHECK: %[[VBASE_i8:.*]] = getelementptr inbounds i8, i8* %[[OBJ_i8]], i32 %[[VBOFFSET]] +// CHECK: %[[VFPTR:.*]] = bitcast i8* %[[VBASE_i8]] to void (i8*)*** +// CHECK: %[[VFTABLE:.*]] = load void (i8*)**, void (i8*)*** %[[VFPTR]] +// CHECK: %[[VFUN:.*]] = getelementptr inbounds void (i8*)*, void (i8*)** %[[VFTABLE]], i64 2 +// CHECK: %[[VFUN_VALUE:.*]] = load void (i8*)*, void (i8*)** %[[VFUN]] // // CHECK: call x86_thiscallcc void %[[VFUN_VALUE]](i8* %[[VBASE]]) // @@ -178,7 +184,7 @@ void call_vbase_bar(B *obj) { } void delete_B(B *obj) { -// CHECK-LABEL: define void @"\01?delete_B@@YAXPAUB@@@Z"(%struct.B* %obj) +// CHECK-LABEL: define dso_local void @"?delete_B@@YAXPAUB@@@Z"(%struct.B* %obj) // CHECK: %[[OBJ:.*]] = load %struct.B delete obj; @@ -190,10 +196,7 @@ void delete_B(B *obj) { // CHECK: %[[VBOFFSET32:.*]] = load i32, i32* %[[VBENTRY]] // CHECK: %[[VBOFFSET:.*]] = add nsw i32 0, %[[VBOFFSET32]] // CHECK: %[[VBASE_i8:.*]] = getelementptr inbounds i8, i8* %[[OBJ_i8]], i32 %[[VBOFFSET]] -// CHECK: %[[VFPTR:.*]] = bitcast i8* %[[VBASE_i8]] to i8* (%struct.B*, i32)*** -// CHECK: %[[VFTABLE:.*]] = load i8* (%struct.B*, i32)**, i8* (%struct.B*, i32)*** %[[VFPTR]] -// CHECK: %[[VFUN:.*]] = getelementptr inbounds i8* (%struct.B*, i32)*, i8* (%struct.B*, i32)** %[[VFTABLE]], i64 0 -// CHECK: %[[VFUN_VALUE:.*]] = load i8* (%struct.B*, i32)*, i8* (%struct.B*, i32)** %[[VFUN]] +// CHECK: %[[VBASE:.*]] = bitcast i8* %[[VBASE_i8]] to %struct.B* // // CHECK: %[[OBJ_i8:.*]] = bitcast %struct.B* %[[OBJ]] to i8* // CHECK: %[[VBPTR:.*]] = getelementptr inbounds i8, i8* %[[OBJ_i8]], i32 0 @@ -203,18 +206,21 @@ void delete_B(B *obj) { // CHECK: %[[VBOFFSET32:.*]] = load i32, i32* %[[VBENTRY]] // CHECK: %[[VBOFFSET:.*]] = add nsw i32 0, %[[VBOFFSET32]] // CHECK: %[[VBASE_i8:.*]] = getelementptr inbounds i8, i8* %[[OBJ_i8]], i32 %[[VBOFFSET]] -// CHECK: %[[VBASE:.*]] = bitcast i8* %[[VBASE_i8]] to %struct.B* +// CHECK: %[[VFPTR:.*]] = bitcast i8* %[[VBASE_i8]] to i8* (%struct.B*, i32)*** +// CHECK: %[[VFTABLE:.*]] = load i8* (%struct.B*, i32)**, i8* (%struct.B*, i32)*** %[[VFPTR]] +// CHECK: %[[VFUN:.*]] = getelementptr inbounds i8* (%struct.B*, i32)*, i8* (%struct.B*, i32)** %[[VFTABLE]], i64 0 +// CHECK: %[[VFUN_VALUE:.*]] = load i8* (%struct.B*, i32)*, i8* (%struct.B*, i32)** %[[VFUN]] // // CHECK: call x86_thiscallcc i8* %[[VFUN_VALUE]](%struct.B* %[[VBASE]], i32 1) // CHECK: ret void } void call_complete_dtor() { - // CHECK-LABEL: define void @"\01?call_complete_dtor@@YAXXZ" + // CHECK-LABEL: define dso_local void @"?call_complete_dtor@@YAXXZ" B b; - // CHECK: call x86_thiscallcc %struct.B* @"\01??0B@@QAE@XZ"(%struct.B* %[[B:.*]], i32 1) + // CHECK: call x86_thiscallcc %struct.B* @"??0B@@QAE@XZ"(%struct.B* %[[B:.*]], i32 1) // CHECK-NOT: getelementptr - // CHECK: call x86_thiscallcc void @"\01??_DB@@QAEXXZ"(%struct.B* %[[B]]) + // CHECK: call x86_thiscallcc void @"??_DB@@QAEXXZ"(%struct.B* %[[B]]) // CHECK: ret } @@ -225,7 +231,7 @@ struct C : B { // Used to crash on an assertion. C::C() { -// CHECK-LABEL: define x86_thiscallcc %struct.C* @"\01??0C@@QAE@XZ" +// CHECK-LABEL: define dso_local x86_thiscallcc %struct.C* @"??0C@@QAE@XZ" } namespace multiple_vbases { @@ -249,11 +255,11 @@ struct D : virtual A, virtual B, virtual C { }; D::D() { - // CHECK-LABEL: define x86_thiscallcc %"struct.multiple_vbases::D"* @"\01??0D@multiple_vbases@@QAE@XZ" + // CHECK-LABEL: define dso_local x86_thiscallcc %"struct.multiple_vbases::D"* @"??0D@multiple_vbases@@QAE@XZ" // Just make sure we emit 3 vtordisps after initializing vfptrs. - // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"\01??_7D@multiple_vbases@@6BA@1@@" to i32 (...)**), i32 (...)*** %{{.*}} - // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"\01??_7D@multiple_vbases@@6BB@1@@" to i32 (...)**), i32 (...)*** %{{.*}} - // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"\01??_7D@multiple_vbases@@6BC@1@@" to i32 (...)**), i32 (...)*** %{{.*}} + // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"??_7D@multiple_vbases@@6BA@1@@" to i32 (...)**), i32 (...)*** %{{.*}} + // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"??_7D@multiple_vbases@@6BB@1@@" to i32 (...)**), i32 (...)*** %{{.*}} + // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"??_7D@multiple_vbases@@6BC@1@@" to i32 (...)**), i32 (...)*** %{{.*}} // ... // CHECK: store i32 %{{.*}}, i32* %{{.*}} // CHECK: store i32 %{{.*}}, i32* %{{.*}} @@ -289,7 +295,7 @@ struct D : virtual Z, B, C { } d; D::~D() { - // CHECK-LABEL: define x86_thiscallcc void @"\01??1D@diamond@@UAE@XZ"(%"struct.diamond::D"*{{.*}}) + // CHECK-LABEL: define dso_local x86_thiscallcc void @"??1D@diamond@@UAE@XZ"(%"struct.diamond::D"*{{.*}}) // Store initial this: // CHECK: %[[THIS_ADDR:.*]] = alloca %"struct.diamond::D"* // CHECK: store %"struct.diamond::D"* %{{.*}}, %"struct.diamond::D"** %[[THIS_ADDR]], align 4 @@ -307,13 +313,13 @@ D::~D() { // CHECK: %[[ARG_i8:.*]] = getelementptr i8, i8* %{{.*}}, i32 16 // FIXME: We might consider changing the dtor this parameter type to i8*. // CHECK: %[[ARG:.*]] = bitcast i8* %[[ARG_i8]] to %"struct.diamond::C"* - // CHECK: call x86_thiscallcc void @"\01??1C@diamond@@UAE@XZ"(%"struct.diamond::C"* %[[ARG]]) + // CHECK: call x86_thiscallcc void @"??1C@diamond@@UAE@XZ"(%"struct.diamond::C"* %[[ARG]]) // CHECK: %[[B:.*]] = bitcast %"struct.diamond::D"* %[[THIS]] to %"struct.diamond::B"* // CHECK: %[[B_i8:.*]] = bitcast %"struct.diamond::B"* %[[B]] to i8* // CHECK: %[[ARG_i8:.*]] = getelementptr i8, i8* %[[B_i8]], i32 4 // CHECK: %[[ARG:.*]] = bitcast i8* %[[ARG_i8]] to %"struct.diamond::B"* - // CHECK: call x86_thiscallcc void @"\01??1B@diamond@@UAE@XZ"(%"struct.diamond::B"* %[[ARG]]) + // CHECK: call x86_thiscallcc void @"??1B@diamond@@UAE@XZ"(%"struct.diamond::B"* %[[ARG]]) // CHECK: ret void } @@ -328,20 +334,20 @@ struct C : B, A { C() {} }; // call to B() from C(). void callC() { C x; } -// CHECK-LABEL: define linkonce_odr x86_thiscallcc %"struct.test2::C"* @"\01??0C@test2@@QAE@XZ" +// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc %"struct.test2::C"* @"??0C@test2@@QAE@XZ" // CHECK: (%"struct.test2::C"* returned %this, i32 %is_most_derived) // CHECK: br i1 // Virtual bases -// CHECK: call x86_thiscallcc %"struct.test2::A"* @"\01??0A@test2@@QAE@XZ"(%"struct.test2::A"* %{{.*}}) +// CHECK: call x86_thiscallcc %"struct.test2::A"* @"??0A@test2@@QAE@XZ"(%"struct.test2::A"* %{{.*}}) // CHECK: br label // Non-virtual bases -// CHECK: call x86_thiscallcc %"struct.test2::B"* @"\01??0B@test2@@QAE@XZ"(%"struct.test2::B"* %{{.*}}, i32 0) -// CHECK: call x86_thiscallcc %"struct.test2::A"* @"\01??0A@test2@@QAE@XZ"(%"struct.test2::A"* %{{.*}}) +// CHECK: call x86_thiscallcc %"struct.test2::B"* @"??0B@test2@@QAE@XZ"(%"struct.test2::B"* %{{.*}}, i32 0) +// CHECK: call x86_thiscallcc %"struct.test2::A"* @"??0A@test2@@QAE@XZ"(%"struct.test2::A"* %{{.*}}) // CHECK: ret -// CHECK2-LABEL: define linkonce_odr x86_thiscallcc %"struct.test2::B"* @"\01??0B@test2@@QAE@XZ" +// CHECK2-LABEL: define linkonce_odr dso_local x86_thiscallcc %"struct.test2::B"* @"??0B@test2@@QAE@XZ" // CHECK2: (%"struct.test2::B"* returned %this, i32 %is_most_derived) -// CHECK2: call x86_thiscallcc %"struct.test2::A"* @"\01??0A@test2@@QAE@XZ"(%"struct.test2::A"* %{{.*}}) +// CHECK2: call x86_thiscallcc %"struct.test2::A"* @"??0A@test2@@QAE@XZ"(%"struct.test2::A"* %{{.*}}) // CHECK2: ret } @@ -368,7 +374,7 @@ struct D : B, C { }; void D::bar() { - // CHECK-LABEL: define x86_thiscallcc void @"\01?bar@D@test3@@UAEXXZ"(%"struct.test3::D"* %this) + // CHECK-LABEL: define dso_local x86_thiscallcc void @"?bar@D@test3@@UAEXXZ"(%"struct.test3::D"* %this) C::foo(); // Shouldn't need any vbtable lookups. All we have to do is adjust to C*, @@ -379,7 +385,7 @@ void D::bar() { // CHECK: %[[C:.*]] = bitcast i8* %[[C_i8]] to %"struct.test3::C"* // CHECK: %[[C_i8:.*]] = bitcast %"struct.test3::C"* %[[C]] to i8* // CHECK: %[[ARG:.*]] = getelementptr i8, i8* %[[C_i8]], i32 4 - // CHECK: call x86_thiscallcc void @"\01?foo@C@test3@@UAEXXZ"(i8* %[[ARG]]) + // CHECK: call x86_thiscallcc void @"?foo@C@test3@@UAEXXZ"(i8* %[[ARG]]) // CHECK: ret } } @@ -402,20 +408,20 @@ struct C : virtual A, B { void foo(void*); C::~C() { - // CHECK-LABEL: define x86_thiscallcc void @"\01??1C@test4@@UAE@XZ"(%"struct.test4::C"* %this) + // CHECK-LABEL: define dso_local x86_thiscallcc void @"??1C@test4@@UAE@XZ"(%"struct.test4::C"* %this) // In this case "this" points to the most derived class, so no GEPs needed. // CHECK-NOT: getelementptr // CHECK-NOT: bitcast // CHECK: %[[VFPTR_i8:.*]] = bitcast %"struct.test4::C"* %{{.*}} to i32 (...)*** - // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"\01??_7C@test4@@6BB@1@@" to i32 (...)**), i32 (...)*** %[[VFPTR_i8]] + // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"??_7C@test4@@6BB@1@@" to i32 (...)**), i32 (...)*** %[[VFPTR_i8]] foo(this); // CHECK: ret } void destroy(C *obj) { - // CHECK-LABEL: define void @"\01?destroy@test4@@YAXPAUC@1@@Z"(%"struct.test4::C"* %obj) + // CHECK-LABEL: define dso_local void @"?destroy@test4@@YAXPAUC@1@@Z"(%"struct.test4::C"* %obj) delete obj; // CHECK: %[[VPTR:.*]] = bitcast %"struct.test4::C"* %[[OBJ:.*]] to i8* (%"struct.test4::C"*, i32)*** @@ -437,30 +443,30 @@ struct E : D, B, virtual A { }; E::~E() { - // CHECK-LABEL: define x86_thiscallcc void @"\01??1E@test4@@UAE@XZ"(%"struct.test4::E"* %this) + // CHECK-LABEL: define dso_local x86_thiscallcc void @"??1E@test4@@UAE@XZ"(%"struct.test4::E"* %this) // In this case "this" points to the most derived class, so no GEPs needed. // CHECK-NOT: getelementptr // CHECK-NOT: bitcast // CHECK: %[[VFPTR_i8:.*]] = bitcast %"struct.test4::E"* %{{.*}} to i32 (...)*** - // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"\01??_7E@test4@@6BD@1@@" to i32 (...)**), i32 (...)*** %[[VFPTR_i8]] + // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"??_7E@test4@@6BD@1@@" to i32 (...)**), i32 (...)*** %[[VFPTR_i8]] foo(this); } void destroy(E *obj) { - // CHECK-LABEL: define void @"\01?destroy@test4@@YAXPAUE@1@@Z"(%"struct.test4::E"* %obj) + // CHECK-LABEL: define dso_local void @"?destroy@test4@@YAXPAUE@1@@Z"(%"struct.test4::E"* %obj) // CHECK-NOT: getelementptr + // CHECK: %[[OBJ_i8:.*]] = bitcast %"struct.test4::E"* %[[OBJ]] to i8* + // CHECK: %[[B_i8:.*]] = getelementptr inbounds i8, i8* %[[OBJ_i8]], i32 4 + // FIXME: in fact, the call should take i8* and the bitcast is redundant. + // CHECK: %[[B_as_E:.*]] = bitcast i8* %[[B_i8]] to %"struct.test4::E"* // CHECK: %[[OBJ_i8:.*]] = bitcast %"struct.test4::E"* %[[OBJ:.*]] to i8* // CHECK: %[[B_i8:.*]] = getelementptr inbounds i8, i8* %[[OBJ_i8]], i32 4 // CHECK: %[[VPTR:.*]] = bitcast i8* %[[B_i8]] to i8* (%"struct.test4::E"*, i32)*** // CHECK: %[[VFTABLE:.*]] = load i8* (%"struct.test4::E"*, i32)**, i8* (%"struct.test4::E"*, i32)*** %[[VPTR]] // CHECK: %[[VFTENTRY:.*]] = getelementptr inbounds i8* (%"struct.test4::E"*, i32)*, i8* (%"struct.test4::E"*, i32)** %[[VFTABLE]], i64 0 // CHECK: %[[VFUN:.*]] = load i8* (%"struct.test4::E"*, i32)*, i8* (%"struct.test4::E"*, i32)** %[[VFTENTRY]] - // CHECK: %[[OBJ_i8:.*]] = bitcast %"struct.test4::E"* %[[OBJ]] to i8* - // CHECK: %[[B_i8:.*]] = getelementptr inbounds i8, i8* %[[OBJ_i8]], i32 4 - // FIXME: in fact, the call should take i8* and the bitcast is redundant. - // CHECK: %[[B_as_E:.*]] = bitcast i8* %[[B_i8]] to %"struct.test4::E"* // CHECK: call x86_thiscallcc i8* %[[VFUN]](%"struct.test4::E"* %[[B_as_E]], i32 1) delete obj; } @@ -482,7 +488,7 @@ struct C : B { }; C::C() : B() {} -// CHECK-LABEL: define x86_thiscallcc %"struct.test5::C"* @"\01??0C@test5@@QAE@XZ"( +// CHECK-LABEL: define dso_local x86_thiscallcc %"struct.test5::C"* @"??0C@test5@@QAE@XZ"( // CHECK: %[[THIS:.*]] = load %"struct.test5::C"*, %"struct.test5::C"** // CHECK: br i1 %{{.*}}, label %[[INIT_VBASES:.*]], label %[[SKIP_VBASES:.*]] @@ -490,7 +496,7 @@ C::C() : B() {} // CHECK: %[[B:.*]] = bitcast %"struct.test5::C"* %[[THIS]] to %"struct.test5::B"* // CHECK: %[[B_i8:.*]] = bitcast %"struct.test5::B"* %[[B]] to i8* // CHECK: %[[FIELD:.*]] = getelementptr inbounds i8, i8* %[[B_i8]], i32 4 -// CHECK: call void @llvm.memset.p0i8.i32(i8* %[[FIELD]], i8 0, i32 4, i32 4, i1 false) +// CHECK: call void @llvm.memset.p0i8.i32(i8* align 4 %[[FIELD]], i8 0, i32 4, i1 false) } namespace pr27621 { @@ -506,9 +512,9 @@ struct C final : A, B { void callit(C *p) { static_cast<B*>(p)->g(); } -// CHECK-LABEL: define void @"\01?callit@pr27621@@YAXPAUC@1@@Z"(%"struct.pr27621::C"* %{{.*}}) +// CHECK-LABEL: define dso_local void @"?callit@pr27621@@YAXPAUC@1@@Z"(%"struct.pr27621::C"* %{{.*}}) // CHECK: %[[B_i8:.*]] = getelementptr i8, i8* %{{.*}}, i32 4 -// CHECK: call x86_thiscallcc void @"\01?g@C@pr27621@@UAEXXZ"(i8* %[[B_i8]]) +// CHECK: call x86_thiscallcc void @"?g@C@pr27621@@UAEXXZ"(i8* %[[B_i8]]) } namespace test6 { @@ -522,7 +528,7 @@ class D : C { D(); }; D::D() : C() {} -// CHECK-LABEL: define x86_thiscallcc %"class.test6::D"* @"\01??0D@test6@@AAE@XZ"( +// CHECK-LABEL: define dso_local x86_thiscallcc %"class.test6::D"* @"??0D@test6@@AAE@XZ"( // CHECK: %[[THIS:.*]] = load %"class.test6::D"*, %"class.test6::D"** // CHECK: br i1 %{{.*}}, label %[[INIT_VBASES:.*]], label %[[SKIP_VBASES:.*]] @@ -530,5 +536,22 @@ D::D() : C() {} // CHECK: %[[C:.*]] = bitcast %"class.test6::D"* %[[THIS]] to %"class.test6::C"* // CHECK: %[[C_i8:.*]] = bitcast %"class.test6::C"* %[[C]] to i8* // CHECK: %[[FIELD:.*]] = getelementptr inbounds i8, i8* %[[C_i8]], i32 8 -// CHECK: call void @llvm.memset.p0i8.i32(i8* %[[FIELD]], i8 0, i32 4, i32 4, i1 false) +// CHECK: call void @llvm.memset.p0i8.i32(i8* align 4 %[[FIELD]], i8 0, i32 4, i1 false) +} + +namespace pr36921 { +struct A { + virtual ~A() {} +}; +struct B { + virtual ~B() {} +}; +struct C : virtual B {}; +struct D : virtual A, C {}; +D d; +// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc i8* @"??_GD@pr36921@@UAEPAXI@Z"( +// CHECK: %[[THIS:.*]] = load %"struct.pr36921::D"*, %"struct.pr36921::D"** +// CHECK: %[[THIS_UNADJ_i8:.*]] = bitcast %"struct.pr36921::D"* %[[THIS_RELOAD]] to i8* +// CHECK: %[[THIS_ADJ_i8:.*]] = getelementptr inbounds i8, i8* %[[THIS_UNADJ_i8]], i32 -4 +// CHECK: %[[THIS:.*]] = bitcast i8* %[[THIS_ADJ_i8]] to %"struct.pr36921::D"* } diff --git a/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp b/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp index af930c84720bc..ef8a5e4868250 100644 --- a/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp +++ b/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp @@ -53,24 +53,24 @@ void f() { auto ptr7 = &C::plugh; -// CHECK32-LABEL: define void @"\01?f@@YAXXZ"() -// CHECK32: store i8* bitcast (void (%struct.C*, ...)* @"\01??_9C@@$BA@AE" to i8*), i8** %ptr -// CHECK32: store i8* bitcast (void (%struct.C*, ...)* @"\01??_9C@@$B3AE" to i8*), i8** %ptr2 -// CHECK32: store i8* bitcast (void (%struct.C*, ...)* @"\01??_9C@@$B7AE" to i8*), i8** %ptr3 -// CHECK32: store i8* bitcast (void (%"struct.(anonymous namespace)::D"*, ...)* @"\01??_9D@?A@@$BA@AE" to i8*), i8** %ptr4 +// CHECK32-LABEL: define dso_local void @"?f@@YAXXZ"() +// CHECK32: store i8* bitcast (void (%struct.C*, ...)* @"??_9C@@$BA@AE" to i8*), i8** %ptr +// CHECK32: store i8* bitcast (void (%struct.C*, ...)* @"??_9C@@$B3AE" to i8*), i8** %ptr2 +// CHECK32: store i8* bitcast (void (%struct.C*, ...)* @"??_9C@@$B7AE" to i8*), i8** %ptr3 +// CHECK32: store i8* bitcast (void (%"struct.(anonymous namespace)::D"*, ...)* @"??_9D@?A@@$BA@AE" to i8*), i8** %ptr4 // CHECK32: } // -// CHECK64-LABEL: define void @"\01?f@@YAXXZ"() -// CHECK64: store i8* bitcast (void (%struct.C*, ...)* @"\01??_9C@@$BA@AA" to i8*), i8** %ptr -// CHECK64: store i8* bitcast (void (%struct.C*, ...)* @"\01??_9C@@$B7AA" to i8*), i8** %ptr2 -// CHECK64: store i8* bitcast (void (%struct.C*, ...)* @"\01??_9C@@$BBA@AA" to i8*), i8** %ptr3 -// CHECK64: store i8* bitcast (void (%"struct.(anonymous namespace)::D"*, ...)* @"\01??_9D@?A@@$BA@AA" to i8*), i8** %ptr +// CHECK64-LABEL: define dso_local void @"?f@@YAXXZ"() +// CHECK64: store i8* bitcast (void (%struct.C*, ...)* @"??_9C@@$BA@AA" to i8*), i8** %ptr +// CHECK64: store i8* bitcast (void (%struct.C*, ...)* @"??_9C@@$B7AA" to i8*), i8** %ptr2 +// CHECK64: store i8* bitcast (void (%struct.C*, ...)* @"??_9C@@$BBA@AA" to i8*), i8** %ptr3 +// CHECK64: store i8* bitcast (void (%"struct.(anonymous namespace)::D"*, ...)* @"??_9D@?A@@$BA@AA" to i8*), i8** %ptr // CHECK64: } } // Thunk for calling the 1st virtual function in C with no parameters. -// CHECK32-LABEL: define linkonce_odr x86_thiscallcc void @"\01??_9C@@$BA@AE"(%struct.C* %this, ...) +// CHECK32-LABEL: define linkonce_odr x86_thiscallcc void @"??_9C@@$BA@AE"(%struct.C* %this, ...) // CHECK32: #[[ATTR:[0-9]+]] // CHECK32-NOT: unnamed_addr // CHECK32: comdat @@ -80,7 +80,7 @@ void f() { // CHECK32-NEXT: ret void // CHECK32: } // -// CHECK64-LABEL: define linkonce_odr void @"\01??_9C@@$BA@AA"(%struct.C* %this, ...) +// CHECK64-LABEL: define linkonce_odr void @"??_9C@@$BA@AA"(%struct.C* %this, ...) // CHECK64: #[[ATTR:[0-9]+]] // CHECK64-NOT: unnamed_addr // CHECK64: comdat @@ -91,7 +91,7 @@ void f() { // CHECK64: } // Thunk for calling the 2nd virtual function in C, taking int and double as parameters, returning int. -// CHECK32-LABEL: define linkonce_odr x86_thiscallcc void @"\01??_9C@@$B3AE"(%struct.C* %this, ...) +// CHECK32-LABEL: define linkonce_odr x86_thiscallcc void @"??_9C@@$B3AE"(%struct.C* %this, ...) // CHECK32: #[[ATTR]] comdat // CHECK32: [[VPTR:%.*]] = getelementptr inbounds void (%struct.C*, ...)*, void (%struct.C*, ...)** %{{.*}}, i64 1 // CHECK32: [[CALLEE:%.*]] = load void (%struct.C*, ...)*, void (%struct.C*, ...)** [[VPTR]] @@ -99,7 +99,7 @@ void f() { // CHECK32-NEXT: ret void // CHECK32: } // -// CHECK64-LABEL: define linkonce_odr void @"\01??_9C@@$B7AA"(%struct.C* %this, ...) +// CHECK64-LABEL: define linkonce_odr void @"??_9C@@$B7AA"(%struct.C* %this, ...) // CHECK64: #[[ATTR]] comdat // CHECK64: [[VPTR:%.*]] = getelementptr inbounds void (%struct.C*, ...)*, void (%struct.C*, ...)** %{{.*}}, i64 1 // CHECK64: [[CALLEE:%.*]] = load void (%struct.C*, ...)*, void (%struct.C*, ...)** [[VPTR]] @@ -108,7 +108,7 @@ void f() { // CHECK64: } // Thunk for calling the 3rd virtual function in C, taking an int parameter, returning a struct. -// CHECK32-LABEL: define linkonce_odr x86_thiscallcc void @"\01??_9C@@$B7AE"(%struct.C* %this, ...) +// CHECK32-LABEL: define linkonce_odr x86_thiscallcc void @"??_9C@@$B7AE"(%struct.C* %this, ...) // CHECK32: #[[ATTR]] comdat // CHECK32: [[VPTR:%.*]] = getelementptr inbounds void (%struct.C*, ...)*, void (%struct.C*, ...)** %{{.*}}, i64 2 // CHECK32: [[CALLEE:%.*]] = load void (%struct.C*, ...)*, void (%struct.C*, ...)** [[VPTR]] @@ -116,7 +116,7 @@ void f() { // CHECK32-NEXT: ret void // CHECK32: } // -// CHECK64-LABEL: define linkonce_odr void @"\01??_9C@@$BBA@AA"(%struct.C* %this, ...) +// CHECK64-LABEL: define linkonce_odr void @"??_9C@@$BBA@AA"(%struct.C* %this, ...) // CHECK64: #[[ATTR]] comdat // CHECK64: [[VPTR:%.*]] = getelementptr inbounds void (%struct.C*, ...)*, void (%struct.C*, ...)** %{{.*}}, i64 2 // CHECK64: [[CALLEE:%.*]] = load void (%struct.C*, ...)*, void (%struct.C*, ...)** [[VPTR]] @@ -125,7 +125,7 @@ void f() { // CHECK64: } // Thunk for calling the virtual function in internal class D. -// CHECK32-LABEL: define internal x86_thiscallcc void @"\01??_9D@?A@@$BA@AE"(%"struct.(anonymous namespace)::D"* %this, ...) +// CHECK32-LABEL: define internal x86_thiscallcc void @"??_9D@?A@@$BA@AE"(%"struct.(anonymous namespace)::D"* %this, ...) // CHECK32: #[[ATTR]] // CHECK32: [[VPTR:%.*]] = getelementptr inbounds void (%"struct.(anonymous namespace)::D"*, ...)*, void (%"struct.(anonymous namespace)::D"*, ...)** %{{.*}}, i64 0 // CHECK32: [[CALLEE:%.*]] = load void (%"struct.(anonymous namespace)::D"*, ...)*, void (%"struct.(anonymous namespace)::D"*, ...)** [[VPTR]] @@ -133,7 +133,7 @@ void f() { // CHECK32-NEXT: ret void // CHECK32: } // -// CHECK64-LABEL: define internal void @"\01??_9D@?A@@$BA@AA"(%"struct.(anonymous namespace)::D"* %this, ...) +// CHECK64-LABEL: define internal void @"??_9D@?A@@$BA@AA"(%"struct.(anonymous namespace)::D"* %this, ...) // CHECK64: #[[ATTR]] // CHECK64: [[VPTR:%.*]] = getelementptr inbounds void (%"struct.(anonymous namespace)::D"*, ...)*, void (%"struct.(anonymous namespace)::D"*, ...)** %{{.*}}, i64 0 // CHECK64: [[CALLEE:%.*]] = load void (%"struct.(anonymous namespace)::D"*, ...)*, void (%"struct.(anonymous namespace)::D"*, ...)** [[VPTR]] @@ -143,14 +143,14 @@ void f() { // Thunk for calling the fourth virtual function in C, taking a struct parameter // and returning a struct. -// CHECK32-LABEL: define linkonce_odr x86_thiscallcc void @"\01??_9C@@$BM@AE"(%struct.C* %this, ...) {{.*}} comdat +// CHECK32-LABEL: define linkonce_odr x86_thiscallcc void @"??_9C@@$BM@AE"(%struct.C* %this, ...) {{.*}} comdat // CHECK32: [[VPTR:%.*]] = getelementptr inbounds void (%struct.C*, ...)*, void (%struct.C*, ...)** %{{.*}}, i64 3 // CHECK32: [[CALLEE:%.*]] = load void (%struct.C*, ...)*, void (%struct.C*, ...)** [[VPTR]] // CHECK32: musttail call x86_thiscallcc void (%struct.C*, ...) [[CALLEE]](%struct.C* %{{.*}}, ...) // CHECK32-NEXT: ret void // CHECK32: } // -// CHECK64-LABEL: define linkonce_odr void @"\01??_9C@@$BBI@AA"(%struct.C* %this, ...) {{.*}} comdat +// CHECK64-LABEL: define linkonce_odr void @"??_9C@@$BBI@AA"(%struct.C* %this, ...) {{.*}} comdat // CHECK64: [[VPTR:%.*]] = getelementptr inbounds void (%struct.C*, ...)*, void (%struct.C*, ...)** %{{.*}}, i64 3 // CHECK64: [[CALLEE:%.*]] = load void (%struct.C*, ...)*, void (%struct.C*, ...)** [[VPTR]] // CHECK64: musttail call void (%struct.C*, ...) [[CALLEE]](%struct.C* %{{.*}}, ...) @@ -158,28 +158,28 @@ void f() { // CHECK64: } // Thunk for calling the fifth virtual function in C which uses the __cdecl calling convention. -// CHECK32-LABEL: define linkonce_odr void @"\01??_9C@@$BBA@AA"(%struct.C* %this, ...) {{.*}} comdat align 2 { +// CHECK32-LABEL: define linkonce_odr void @"??_9C@@$BBA@AA"(%struct.C* %this, ...) {{.*}} comdat align 2 { // CHECK32: [[VPTR:%.*]] = getelementptr inbounds void (%struct.C*, ...)*, void (%struct.C*, ...)** %{{.*}}, i64 4 // CHECK32: [[CALLEE:%.*]] = load void (%struct.C*, ...)*, void (%struct.C*, ...)** [[VPTR]] // CHECK32: musttail call void (%struct.C*, ...) [[CALLEE]](%struct.C* %{{.*}}, ...) // CHECK32: ret void // CHECK32: } // -// CHECK64-LABEL: define linkonce_odr void @"\01??_9C@@$BCA@AA"(%struct.C* %this, ...) {{.*}} comdat align 2 { +// CHECK64-LABEL: define linkonce_odr void @"??_9C@@$BCA@AA"(%struct.C* %this, ...) {{.*}} comdat align 2 { // CHECK64: [[VPTR:%.*]] = getelementptr inbounds void (%struct.C*, ...)*, void (%struct.C*, ...)** %{{.*}}, i64 4 // CHECK64: [[CALLEE:%.*]] = load void (%struct.C*, ...)*, void (%struct.C*, ...)** [[VPTR]] // CHECK64: musttail call void (%struct.C*, ...) [[CALLEE]](%struct.C* %{{.*}}, ...) // CHECK64: ret void // CHECK64: } -// CHECK32: define linkonce_odr x86_thiscallcc void @"\01??_9C@@$BBE@AE"(%struct.C* %this, ...) {{.*}} comdat align 2 { +// CHECK32: define linkonce_odr x86_thiscallcc void @"??_9C@@$BBE@AE"(%struct.C* %this, ...) {{.*}} comdat align 2 { // CHECK32: [[VPTR:%.*]] = getelementptr inbounds void (%struct.C*, ...)*, void (%struct.C*, ...)** %{{.*}}, i64 5 // CHECK32: [[CALLEE:%.*]] = load void (%struct.C*, ...)*, void (%struct.C*, ...)** [[VPTR]] // CHECK32: musttail call x86_thiscallcc void (%struct.C*, ...) [[CALLEE]](%struct.C* %{{.*}}, ...) // CHECK32: ret void // CHECK32: } -// CHECK64: define linkonce_odr void @"\01??_9C@@$BCI@AA"(%struct.C* %this, ...) {{.*}} comdat align 2 { +// CHECK64: define linkonce_odr void @"??_9C@@$BCI@AA"(%struct.C* %this, ...) {{.*}} comdat align 2 { // CHECK64: [[VPTR:%.*]] = getelementptr inbounds void (%struct.C*, ...)*, void (%struct.C*, ...)** %{{.*}}, i64 5 // CHECK64: [[CALLEE:%.*]] = load void (%struct.C*, ...)*, void (%struct.C*, ...)** [[VPTR]] // CHECK64: musttail call void (%struct.C*, ...) [[CALLEE]](%struct.C* %{{.*}}, ...) diff --git a/test/CodeGenCXX/microsoft-abi-vmemptr-conflicts.cpp b/test/CodeGenCXX/microsoft-abi-vmemptr-conflicts.cpp index f8a12e64c6acb..607ec816aefb5 100644 --- a/test/CodeGenCXX/microsoft-abi-vmemptr-conflicts.cpp +++ b/test/CodeGenCXX/microsoft-abi-vmemptr-conflicts.cpp @@ -19,11 +19,11 @@ void f(C *c) { } } -// CHECK-LABEL: define void @"\01?f@num_params@@YAXPAUC@1@@Z"(%"struct.num_params::C"* %c) -// CHECK: call x86_thiscallcc void bitcast (void (%"struct.num_params::C"*, ...)* @"\01??_9C@num_params@@$BA@AE" to void (%"struct.num_params::C"*, i32)*)(%"struct.num_params::C"* %{{.*}}, i32 0) -// CHECK: call x86_thiscallcc void bitcast (void (%"struct.num_params::C"*, ...)* @"\01??_9C@num_params@@$BA@AE" to void (%"struct.num_params::C"*, i32, i32)*)(%"struct.num_params::C"* %{{.*}}, i32 0, i32 0) +// CHECK-LABEL: define dso_local void @"?f@num_params@@YAXPAUC@1@@Z"(%"struct.num_params::C"* %c) +// CHECK: call x86_thiscallcc void bitcast (void (%"struct.num_params::C"*, ...)* @"??_9C@num_params@@$BA@AE" to void (%"struct.num_params::C"*, i32)*)(%"struct.num_params::C"* %{{.*}}, i32 0) +// CHECK: call x86_thiscallcc void bitcast (void (%"struct.num_params::C"*, ...)* @"??_9C@num_params@@$BA@AE" to void (%"struct.num_params::C"*, i32, i32)*)(%"struct.num_params::C"* %{{.*}}, i32 0, i32 0) -// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @"\01??_9C@num_params@@$BA@AE"(%"struct.num_params::C"* %this, ...) {{.*}} comdat +// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @"??_9C@num_params@@$BA@AE"(%"struct.num_params::C"* %this, ...) {{.*}} comdat // CHECK: musttail call x86_thiscallcc void (%"struct.num_params::C"*, ...) %{{.*}}(%"struct.num_params::C"* %{{.*}}, ...) // CHECK-NEXT: ret void @@ -41,11 +41,11 @@ long long f(C *c) { } } -// CHECK-LABEL: define i64 @"\01?f@i64_return@@YA_JPAUC@1@@Z"(%"struct.i64_return::C"* %c) -// CHECK: call x86_thiscallcc i32 bitcast (void (%"struct.i64_return::C"*, ...)* @"\01??_9C@i64_return@@$BA@AE" to i32 (%"struct.i64_return::C"*)*)(%"struct.i64_return::C"* %{{.*}}) -// CHECK: call x86_thiscallcc i64 bitcast (void (%"struct.i64_return::C"*, ...)* @"\01??_9C@i64_return@@$BA@AE" to i64 (%"struct.i64_return::C"*)*)(%"struct.i64_return::C"* %{{.*}}) +// CHECK-LABEL: define dso_local i64 @"?f@i64_return@@YA_JPAUC@1@@Z"(%"struct.i64_return::C"* %c) +// CHECK: call x86_thiscallcc i32 bitcast (void (%"struct.i64_return::C"*, ...)* @"??_9C@i64_return@@$BA@AE" to i32 (%"struct.i64_return::C"*)*)(%"struct.i64_return::C"* %{{.*}}) +// CHECK: call x86_thiscallcc i64 bitcast (void (%"struct.i64_return::C"*, ...)* @"??_9C@i64_return@@$BA@AE" to i64 (%"struct.i64_return::C"*)*)(%"struct.i64_return::C"* %{{.*}}) -// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @"\01??_9C@i64_return@@$BA@AE"(%"struct.i64_return::C"* %this, ...) {{.*}} comdat +// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @"??_9C@i64_return@@$BA@AE"(%"struct.i64_return::C"* %this, ...) {{.*}} comdat // CHECK: musttail call x86_thiscallcc void (%"struct.i64_return::C"*, ...) %{{.*}}(%"struct.i64_return::C"* %{{.*}}, ...) // CHECK-NEXT: ret void @@ -63,11 +63,11 @@ void f(C *c) { } } -// CHECK-LABEL: define void @"\01?f@sret@@YAXPAUC@1@@Z"(%"struct.sret::C"* %c) -// CHECK: call x86_thiscallcc i32 bitcast (void (%"struct.sret::C"*, ...)* @"\01??_9C@sret@@$BA@AE" to i32 (%"struct.sret::C"*)*)(%"struct.sret::C"* %{{.*}}) -// CHECK: call x86_thiscallcc void bitcast (void (%"struct.sret::C"*, ...)* @"\01??_9C@sret@@$BA@AE" to void (%"struct.sret::C"*, %"struct.sret::Big"*)*)(%"struct.sret::C"* %{{.*}}, %"struct.sret::Big"* sret %{{.*}}) +// CHECK-LABEL: define dso_local void @"?f@sret@@YAXPAUC@1@@Z"(%"struct.sret::C"* %c) +// CHECK: call x86_thiscallcc i32 bitcast (void (%"struct.sret::C"*, ...)* @"??_9C@sret@@$BA@AE" to i32 (%"struct.sret::C"*)*)(%"struct.sret::C"* %{{.*}}) +// CHECK: call x86_thiscallcc void bitcast (void (%"struct.sret::C"*, ...)* @"??_9C@sret@@$BA@AE" to void (%"struct.sret::C"*, %"struct.sret::Big"*)*)(%"struct.sret::C"* %{{.*}}, %"struct.sret::Big"* sret %{{.*}}) -// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @"\01??_9C@sret@@$BA@AE"(%"struct.sret::C"* %this, ...) {{.*}} comdat +// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @"??_9C@sret@@$BA@AE"(%"struct.sret::C"* %this, ...) {{.*}} comdat // CHECK: musttail call x86_thiscallcc void (%"struct.sret::C"*, ...) %{{.*}}(%"struct.sret::C"* %{{.*}}, ...) // CHECK-NEXT: ret void @@ -92,10 +92,10 @@ void f(C *c) { } } -// CHECK-LABEL: define void @"\01?f@cdecl_inalloca@@YAXPAUC@1@@Z"(%"struct.cdecl_inalloca::C"* %c) -// CHECK: call void bitcast (void (%"struct.cdecl_inalloca::C"*, ...)* @"\01??_9C@cdecl_inalloca@@$BA@AA" to void (%"struct.cdecl_inalloca::C"*)*)(%"struct.cdecl_inalloca::C"* %{{.*}}) -// CHECK: call void bitcast (void (%"struct.cdecl_inalloca::C"*, ...)* @"\01??_9C@cdecl_inalloca@@$BA@AA" to void (<{ %"struct.cdecl_inalloca::C"*, %"struct.cdecl_inalloca::Big" }>*)*)(<{ %"struct.cdecl_inalloca::C"*, %"struct.cdecl_inalloca::Big" }>* inalloca %{{.*}}) +// CHECK-LABEL: define dso_local void @"?f@cdecl_inalloca@@YAXPAUC@1@@Z"(%"struct.cdecl_inalloca::C"* %c) +// CHECK: call void bitcast (void (%"struct.cdecl_inalloca::C"*, ...)* @"??_9C@cdecl_inalloca@@$BA@AA" to void (%"struct.cdecl_inalloca::C"*)*)(%"struct.cdecl_inalloca::C"* %{{.*}}) +// CHECK: call void bitcast (void (%"struct.cdecl_inalloca::C"*, ...)* @"??_9C@cdecl_inalloca@@$BA@AA" to void (<{ %"struct.cdecl_inalloca::C"*, %"struct.cdecl_inalloca::Big" }>*)*)(<{ %"struct.cdecl_inalloca::C"*, %"struct.cdecl_inalloca::Big" }>* inalloca %{{.*}}) -// CHECK-LABEL: define linkonce_odr void @"\01??_9C@cdecl_inalloca@@$BA@AA"(%"struct.cdecl_inalloca::C"* %this, ...) {{.*}} comdat +// CHECK-LABEL: define linkonce_odr void @"??_9C@cdecl_inalloca@@$BA@AA"(%"struct.cdecl_inalloca::C"* %this, ...) {{.*}} comdat // CHECK: musttail call void (%"struct.cdecl_inalloca::C"*, ...) %{{.*}}(%"struct.cdecl_inalloca::C"* %{{.*}}, ...) // CHECK-NEXT: ret void diff --git a/test/CodeGenCXX/microsoft-abi-vmemptr-fastcall.cpp b/test/CodeGenCXX/microsoft-abi-vmemptr-fastcall.cpp index 97ab1996c8bce..59e8b0b8c2c89 100644 --- a/test/CodeGenCXX/microsoft-abi-vmemptr-fastcall.cpp +++ b/test/CodeGenCXX/microsoft-abi-vmemptr-fastcall.cpp @@ -7,7 +7,7 @@ void (__fastcall A::*doit())(int, int) { return &A::f; } -// CHECK: define linkonce_odr x86_fastcallcc void @"\01??_9A@@$BA@AI"(%struct.A* inreg %this, ...) {{.*}} comdat align 2 { +// CHECK: define linkonce_odr x86_fastcallcc void @"??_9A@@$BA@AI"(%struct.A* inreg %this, ...) {{.*}} comdat align 2 { // CHECK: [[VPTR:%.*]] = getelementptr inbounds void (%struct.A*, ...)*, void (%struct.A*, ...)** %{{.*}}, i64 0 // CHECK: [[CALLEE:%.*]] = load void (%struct.A*, ...)*, void (%struct.A*, ...)** [[VPTR]] // CHECK: musttail call x86_fastcallcc void (%struct.A*, ...) [[CALLEE]](%struct.A* inreg %{{.*}}, ...) diff --git a/test/CodeGenCXX/microsoft-abi-vmemptr-vbase.cpp b/test/CodeGenCXX/microsoft-abi-vmemptr-vbase.cpp index 85cc84fb0367f..972428af80e3e 100644 --- a/test/CodeGenCXX/microsoft-abi-vmemptr-vbase.cpp +++ b/test/CodeGenCXX/microsoft-abi-vmemptr-vbase.cpp @@ -8,5 +8,5 @@ struct B : virtual A { virtual void f(); }; void (B::*MemPtr)(void) = &B::f; -// CHECK-DAG: @"\01?MemPtr@PR23452@@3P8B@1@AEXXZQ21@" = global { i8*, i32, i32 } { i8* bitcast ({{.*}} @"\01??_9B@PR23452@@$BA@AE" to i8*), i32 0, i32 4 } +// CHECK-DAG: @"?MemPtr@PR23452@@3P8B@1@AEXXZQ21@" = dso_local global { i8*, i32, i32 } { i8* bitcast ({{.*}} @"??_9B@PR23452@@$BA@AE" to i8*), i32 0, i32 4 } } diff --git a/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-no-thunks.cpp b/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-no-thunks.cpp index 86314cff324e3..62289e42804d7 100644 --- a/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-no-thunks.cpp +++ b/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-no-thunks.cpp @@ -24,8 +24,8 @@ struct X : A, B { // CHECK-LABEL: VFTable indices for 'test1::X' (1 entry) // CHECK-NEXT: 0 | void test1::X::f() - // MANGLING-DAG: @"\01??_7X@test1@@6BA@1@@" - // MANGLING-DAG: @"\01??_7X@test1@@6BB@1@@" + // MANGLING-DAG: @"??_7X@test1@@6BA@1@@" + // MANGLING-DAG: @"??_7X@test1@@6BB@1@@" // Overrides only the left child's method (A::f), needs no thunks. virtual void f(); @@ -108,7 +108,7 @@ struct X : Empty, A { // CHECK-LABEL: VFTable indices for 'test4::X' (1 entry). // CHECK-NEXT: 0 | void test4::X::f() - // MANGLING-DAG: @"\01??_7X@test4@@6B@" + // MANGLING-DAG: @"??_7X@test4@@6B@" virtual void f(); } x; @@ -141,8 +141,8 @@ struct X : C { // CHECK-LABEL: VFTable indices for 'test5::X' (1 entry). // CHECK-NEXT: 0 | void test5::X::f() - // MANGLING-DAG: @"\01??_7X@test5@@6BA@1@@" - // MANGLING-DAG: @"\01??_7X@test5@@6BB@1@@" + // MANGLING-DAG: @"??_7X@test5@@6BA@1@@" + // MANGLING-DAG: @"??_7X@test5@@6BB@1@@" // Overrides both C::f and A::f. virtual void f(); @@ -241,8 +241,8 @@ struct X : A, B { // CHECK-LABEL: VFTable indices for 'test8::X' (1 entry). // CHECK-NEXT: 1 | void test8::X::h() - // MANGLING-DAG: @"\01??_7X@test8@@6BA@1@@" - // MANGLING-DAG: @"\01??_7X@test8@@6BB@1@@" + // MANGLING-DAG: @"??_7X@test8@@6BA@1@@" + // MANGLING-DAG: @"??_7X@test8@@6BB@1@@" virtual void h(); } x; @@ -290,10 +290,10 @@ struct X : C, D { // CHECK-LABEL: VFTable indices for 'test9::X' (1 entry). // CHECK-NEXT: 1 | void test9::X::z() - // MANGLING-DAG: @"\01??_7X@test9@@6BA@1@C@1@@" - // MANGLING-DAG: @"\01??_7X@test9@@6BA@1@D@1@@" - // MANGLING-DAG: @"\01??_7X@test9@@6BB@1@C@1@@" - // MANGLING-DAG: @"\01??_7X@test9@@6BB@1@D@1@@" + // MANGLING-DAG: @"??_7X@test9@@6BA@1@C@1@@" + // MANGLING-DAG: @"??_7X@test9@@6BA@1@D@1@@" + // MANGLING-DAG: @"??_7X@test9@@6BB@1@C@1@@" + // MANGLING-DAG: @"??_7X@test9@@6BB@1@D@1@@" virtual void z(); } x; diff --git a/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-pure-virtual.cpp b/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-pure-virtual.cpp index 76182a2e331e1..85022fc3c8586 100644 --- a/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-pure-virtual.cpp +++ b/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-pure-virtual.cpp @@ -23,8 +23,8 @@ struct C : A, B { // CHECK-NEXT: via vfptr at offset 4 // CHECK-NEXT: 0 | void C::g() - // MANGLING-DAG: @"\01??_7C@@6BA@@@" - // MANGLING-DAG: @"\01??_7C@@6BB@@@" + // MANGLING-DAG: @"??_7C@@6BA@@@" + // MANGLING-DAG: @"??_7C@@6BB@@@" // Overrides only the right child's method (B::g), // needs this adjustment but not thunks. diff --git a/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-return-adjustment.cpp b/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-return-adjustment.cpp index 232c0d9c4dd87..f7b79a9fa5d6e 100644 --- a/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-return-adjustment.cpp +++ b/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-return-adjustment.cpp @@ -36,7 +36,7 @@ struct X : D { // CHECK-LABEL: VFTable indices for 'test1::X' (1 entry). // CHECK-NEXT: 2 | test1::C *test1::X::foo() - // MANGLING-DAG: @"\01??_7X@test1@@6B@" + // MANGLING-DAG: @"??_7X@test1@@6B@" virtual C* foo(); } x; diff --git a/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-this-adjustment.cpp b/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-this-adjustment.cpp index 385e9cc17b1b5..e34c4d0cddd07 100644 --- a/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-this-adjustment.cpp +++ b/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-this-adjustment.cpp @@ -29,8 +29,8 @@ struct X : A, B { // CHECK-LABEL: VFTable indices for 'test1::X' (1 entry). // CHECK-NEXT: 0 | void test1::X::g() - // BITCODE-DAG: @"\01??_7X@test1@@6BA@1@@" - // BITCODE-DAG: @"\01??_7X@test1@@6BB@1@@" + // BITCODE-DAG: @"??_7X@test1@@6BA@1@@" + // BITCODE-DAG: @"??_7X@test1@@6BB@1@@" virtual void g(); } x; @@ -71,9 +71,9 @@ struct X : A, B, C { // CHECK-NEXT: via vfptr at offset 4 // CHECK-NEXT: 0 | void test2::X::g() - // BITCODE-DAG: @"\01??_7X@test2@@6BA@1@@" - // BITCODE-DAG: @"\01??_7X@test2@@6BB@1@@" - // BITCODE-DAG: @"\01??_7X@test2@@6BC@1@@" + // BITCODE-DAG: @"??_7X@test2@@6BA@1@@" + // BITCODE-DAG: @"??_7X@test2@@6BB@1@@" + // BITCODE-DAG: @"??_7X@test2@@6BC@1@@" virtual void g(); } x; @@ -154,25 +154,19 @@ struct C : public A, public B { virtual int bar(); }; -// BITCODE-LABEL: define {{.*}}\01?ffun@test4@@YAXAAUC@1@@Z +// BITCODE-LABEL: define {{.*}}"?ffun@test4@@YAXAAUC@1@@Z void ffun(C &c) { - // BITCODE: load - // BITCODE: bitcast - // BITCODE: bitcast // BITCODE: [[THIS1:%.+]] = bitcast %"struct.test4::C"* {{.*}} to i8* // BITCODE: [[THIS2:%.+]] = getelementptr inbounds i8, i8* [[THIS1]], i32 4 - // BITCODE-NEXT: call x86_thiscallcc {{.*}}(i8* [[THIS2]]) + // BITCODE: call x86_thiscallcc {{.*}}(i8* [[THIS2]]) c.bar(); } -// BITCODE-LABEL: define {{.*}}\01?fop@test4@@YAXAAUC@1@@Z +// BITCODE-LABEL: define {{.*}}"?fop@test4@@YAXAAUC@1@@Z void fop(C &c) { - // BITCODE: load - // BITCODE: bitcast - // BITCODE: bitcast // BITCODE: [[THIS1:%.+]] = bitcast %"struct.test4::C"* {{.*}} to i8* // BITCODE: [[THIS2:%.+]] = getelementptr inbounds i8, i8* [[THIS1]], i32 4 - // BITCODE-NEXT: call x86_thiscallcc {{.*}}(i8* [[THIS2]]) + // BITCODE: call x86_thiscallcc {{.*}}(i8* [[THIS2]]) -c; } @@ -195,12 +189,12 @@ void C::g(NonTrivial o) { whatsthis = this; } -// BITCODE-LABEL: define void @"\01?g@C@pr30293@@UAAXUNonTrivial@2@@Z"(<{ i8*, %"struct.pr30293::NonTrivial" }>* inalloca) +// BITCODE-LABEL: define dso_local void @"?g@C@pr30293@@UAAXUNonTrivial@2@@Z"(<{ i8*, %"struct.pr30293::NonTrivial" }>* inalloca) // BITCODE: %[[thisaddr:[^ ]*]] = getelementptr inbounds <{ i8*, %"struct.pr30293::NonTrivial" }>, <{ i8*, %"struct.pr30293::NonTrivial" }>* {{.*}}, i32 0, i32 0 // BITCODE: %[[thisaddr1:[^ ]*]] = bitcast i8** %[[thisaddr]] to %"struct.pr30293::C"** // BITCODE: %[[this1:[^ ]*]] = load %"struct.pr30293::C"*, %"struct.pr30293::C"** %[[thisaddr1]], align 4 // BITCODE: %[[this2:[^ ]*]] = bitcast %"struct.pr30293::C"* %[[this1]] to i8* // BITCODE: %[[this3:[^ ]*]] = getelementptr inbounds i8, i8* %[[this2]], i32 -4 // BITCODE: %[[this4:[^ ]*]] = bitcast i8* %[[this3]] to %"struct.pr30293::C"* -// BITCODE: store %"struct.pr30293::C"* %[[this4]], %"struct.pr30293::C"** @"\01?whatsthis@pr30293@@3PAUC@1@A", align 4 +// BITCODE: store %"struct.pr30293::C"* %[[this4]], %"struct.pr30293::C"** @"?whatsthis@pr30293@@3PAUC@1@A", align 4 } diff --git a/test/CodeGenCXX/microsoft-abi-vtables-return-thunks.cpp b/test/CodeGenCXX/microsoft-abi-vtables-return-thunks.cpp index feba91c505567..38e6ed56847b4 100644 --- a/test/CodeGenCXX/microsoft-abi-vtables-return-thunks.cpp +++ b/test/CodeGenCXX/microsoft-abi-vtables-return-thunks.cpp @@ -26,10 +26,10 @@ J::J() {} // VFTABLES-NEXT: [return adjustment (to type 'struct test1::C *'): 0 non-virtual] // VFTABLES-NEXT: 2 | test1::D *test1::J::foo() -// GLOBALS-LABEL: @"\01??_7J@test1@@6B@" = linkonce_odr unnamed_addr constant { [3 x i8*] } -// GLOBALS: @"\01?foo@J@test1@@QAEPAUB@2@XZ" -// GLOBALS: @"\01?foo@J@test1@@QAEPAUC@2@XZ" -// GLOBALS: @"\01?foo@J@test1@@UAEPAUD@2@XZ" +// GLOBALS-LABEL: @"??_7J@test1@@6B@" = linkonce_odr unnamed_addr constant { [3 x i8*] } +// GLOBALS: @"?foo@J@test1@@QAEPAUB@2@XZ" +// GLOBALS: @"?foo@J@test1@@QAEPAUC@2@XZ" +// GLOBALS: @"?foo@J@test1@@UAEPAUD@2@XZ" K::K() {} @@ -44,26 +44,26 @@ K::K() {} // Only B to C requires adjustment, but we get 3 thunks in K's vftable, two of // which are trivial. -// GLOBALS-LABEL: @"\01??_7K@test1@@6B@" = linkonce_odr unnamed_addr constant { [4 x i8*] } -// GLOBALS: @"\01?foo@K@test1@@QAEPAUB@2@XZ" -// GLOBALS: @"\01?foo@K@test1@@QAEPAUC@2@XZ" -// GLOBALS: @"\01?foo@K@test1@@QAEPAUD@2@XZ" -// GLOBALS: @"\01?foo@K@test1@@UAEPAUE@2@XZ" +// GLOBALS-LABEL: @"??_7K@test1@@6B@" = linkonce_odr unnamed_addr constant { [4 x i8*] } +// GLOBALS: @"?foo@K@test1@@QAEPAUB@2@XZ" +// GLOBALS: @"?foo@K@test1@@QAEPAUC@2@XZ" +// GLOBALS: @"?foo@K@test1@@QAEPAUD@2@XZ" +// GLOBALS: @"?foo@K@test1@@UAEPAUE@2@XZ" // This thunk has a return adjustment. -// CODEGEN-LABEL: define {{.*}} @"\01?foo@K@test1@@QAEPAUB@2@XZ" -// CODEGEN: call {{.*}} @"\01?foo@K@test1@@UAEPAUE@2@XZ" +// CODEGEN-LABEL: define {{.*}} @"?foo@K@test1@@QAEPAUB@2@XZ" +// CODEGEN: call {{.*}} @"?foo@K@test1@@UAEPAUE@2@XZ" // CODEGEN: icmp {{.*}}, null // CODEGEN: getelementptr // CODEGEN: ret // These two don't. -// CODEGEN-LABEL: define {{.*}} @"\01?foo@K@test1@@QAEPAUC@2@XZ" -// CODEGEN: call {{.*}} @"\01?foo@K@test1@@UAEPAUE@2@XZ" +// CODEGEN-LABEL: define {{.*}} @"?foo@K@test1@@QAEPAUC@2@XZ" +// CODEGEN: call {{.*}} @"?foo@K@test1@@UAEPAUE@2@XZ" // CODEGEN-NEXT: ret -// CODEGEN-LABEL: define {{.*}} @"\01?foo@K@test1@@QAEPAUD@2@XZ" -// CODEGEN: call {{.*}} @"\01?foo@K@test1@@UAEPAUE@2@XZ" +// CODEGEN-LABEL: define {{.*}} @"?foo@K@test1@@QAEPAUD@2@XZ" +// CODEGEN: call {{.*}} @"?foo@K@test1@@UAEPAUE@2@XZ" // CODEGEN-NEXT: ret } @@ -90,7 +90,7 @@ J::J() {} // VFTABLES-NEXT: [return adjustment (to type 'struct test2::B *'): 4 non-virtual] // VFTABLES-NEXT: 1 | test2::D *test2::J::foo() -// GLOBALS-LABEL: @"\01??_7J@test2@@6B@" = linkonce_odr unnamed_addr constant { [2 x i8*] } +// GLOBALS-LABEL: @"??_7J@test2@@6B@" = linkonce_odr unnamed_addr constant { [2 x i8*] } K::K() {} @@ -101,7 +101,7 @@ K::K() {} // VFTABLES-NEXT: [return adjustment (to type 'struct test2::D *'): 0 non-virtual] // VFTABLES-NEXT: 2 | test2::E *test2::K::foo() -// GLOBALS-LABEL: @"\01??_7K@test2@@6B@" = linkonce_odr unnamed_addr constant { [3 x i8*] } +// GLOBALS-LABEL: @"??_7K@test2@@6B@" = linkonce_odr unnamed_addr constant { [3 x i8*] } } @@ -124,9 +124,9 @@ struct C : virtual A, B { C::C() {} -// GLOBALS-LABEL: @"\01??_7C@pr20479@@6B@" = linkonce_odr unnamed_addr constant { [2 x i8*] } -// GLOBALS: @"\01?f@B@pr20479@@QAEPAUA@2@XZ" -// GLOBALS: @"\01?f@B@pr20479@@UAEPAU12@XZ" +// GLOBALS-LABEL: @"??_7C@pr20479@@6B@" = linkonce_odr unnamed_addr constant { [2 x i8*] } +// GLOBALS: @"?f@B@pr20479@@QAEPAUA@2@XZ" +// GLOBALS: @"?f@B@pr20479@@UAEPAU12@XZ" } namespace pr21073 { @@ -151,9 +151,9 @@ struct C : virtual A, virtual B { C::C() {} -// GLOBALS-LABEL: @"\01??_7C@pr21073@@6B@" = linkonce_odr unnamed_addr constant { [2 x i8*] } -// GLOBALS: @"\01?f@B@pr21073@@WPPPPPPPI@AEPAUA@2@XZ" -// GLOBALS: @"\01?f@B@pr21073@@WPPPPPPPI@AEPAU12@XZ" +// GLOBALS-LABEL: @"??_7C@pr21073@@6B@" = linkonce_odr unnamed_addr constant { [2 x i8*] } +// GLOBALS: @"?f@B@pr21073@@WPPPPPPPI@AEPAUA@2@XZ" +// GLOBALS: @"?f@B@pr21073@@WPPPPPPPI@AEPAU12@XZ" } namespace pr21073_2 { @@ -168,9 +168,9 @@ D::D() {} // VFTABLES-NEXT: [return adjustment (to type 'struct pr21073_2::A *'): vbase #1, 0 non-virtual] // VFTABLES-NEXT: 1 | pr21073_2::C *pr21073_2::C::foo() -// GLOBALS-LABEL: @"\01??_7D@pr21073_2@@6B@" = {{.*}} constant { [2 x i8*] } -// GLOBALS: @"\01?foo@C@pr21073_2@@QAEPAUA@2@XZ" -// GLOBALS: @"\01?foo@C@pr21073_2@@UAEPAU12@XZ" +// GLOBALS-LABEL: @"??_7D@pr21073_2@@6B@" = {{.*}} constant { [2 x i8*] } +// GLOBALS: @"?foo@C@pr21073_2@@QAEPAUA@2@XZ" +// GLOBALS: @"?foo@C@pr21073_2@@UAEPAU12@XZ" } namespace test3 { @@ -196,10 +196,10 @@ D::D() {} // VFTABLES-NEXT: [return adjustment (to type 'struct test3::D *'): 0 non-virtual] // VFTABLES-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual] -// GLOBALS-LABEL: @"\01??_7D@test3@@6B@" = {{.*}} constant { [3 x i8*] } -// GLOBALS: @"\01?fn@D@test3@@$4PPPPPPPM@A@AEPAUA@2@XZ" -// GLOBALS: @"\01?fn@D@test3@@$4PPPPPPPM@A@AEPAUB@2@XZ" -// GLOBALS: @"\01?fn@D@test3@@$4PPPPPPPM@A@AEPAU12@XZ" +// GLOBALS-LABEL: @"??_7D@test3@@6B@" = {{.*}} constant { [3 x i8*] } +// GLOBALS: @"?fn@D@test3@@$4PPPPPPPM@A@AEPAUA@2@XZ" +// GLOBALS: @"?fn@D@test3@@$4PPPPPPPM@A@AEPAUB@2@XZ" +// GLOBALS: @"?fn@D@test3@@$4PPPPPPPM@A@AEPAU12@XZ" } namespace pr34302 { diff --git a/test/CodeGenCXX/microsoft-abi-vtables-single-inheritance.cpp b/test/CodeGenCXX/microsoft-abi-vtables-single-inheritance.cpp index 738c15d89d211..f84ffd5427dff 100644 --- a/test/CodeGenCXX/microsoft-abi-vtables-single-inheritance.cpp +++ b/test/CodeGenCXX/microsoft-abi-vtables-single-inheritance.cpp @@ -19,7 +19,7 @@ struct A { int ia; }; A a; -// EMITS-VFTABLE-DAG: @"\01??_7A@@6B@" = linkonce_odr unnamed_addr constant { [3 x i8*] } +// EMITS-VFTABLE-DAG: @"??_7A@@6B@" = linkonce_odr unnamed_addr constant { [3 x i8*] } void use(A *obj) { obj->f(); } struct B : A { @@ -39,7 +39,7 @@ struct B : A { virtual void j(); }; B b; -// EMITS-VFTABLE-DAG: @"\01??_7B@@6B@" = linkonce_odr unnamed_addr constant { [5 x i8*] } +// EMITS-VFTABLE-DAG: @"??_7B@@6B@" = linkonce_odr unnamed_addr constant { [5 x i8*] } void use(B *obj) { obj->f(); } struct C { @@ -54,7 +54,7 @@ struct C { virtual void f(); }; void C::f() {} -// NO-VFTABLE-NOT: @"\01??_7C@@6B@" +// NO-VFTABLE-NOT: @"??_7C@@6B@" void use(C *obj) { obj->f(); } struct D { @@ -69,7 +69,7 @@ struct D { virtual ~D(); }; D d; -// EMITS-VFTABLE-DAG: @"\01??_7D@@6B@" = linkonce_odr unnamed_addr constant { [2 x i8*] } +// EMITS-VFTABLE-DAG: @"??_7D@@6B@" = linkonce_odr unnamed_addr constant { [2 x i8*] } void use(D *obj) { obj->f(); } struct E : A { @@ -89,7 +89,7 @@ struct E : A { virtual void i(); }; void E::i() {} -// NO-VFTABLE-NOT: @"\01??_7E@@6B@" +// NO-VFTABLE-NOT: @"??_7E@@6B@" void use(E *obj) { obj->i(); } struct F : A { @@ -107,7 +107,7 @@ struct F : A { virtual ~F(); }; F f; -// EMITS-VFTABLE-DAG: @"\01??_7F@@6B@" = linkonce_odr unnamed_addr constant { [5 x i8*] } +// EMITS-VFTABLE-DAG: @"??_7F@@6B@" = linkonce_odr unnamed_addr constant { [5 x i8*] } void use(F *obj) { obj->i(); } struct G : E { @@ -128,7 +128,7 @@ struct G : E { virtual void j(); }; void G::j() {} -// NO-VFTABLE-NOT: @"\01??_7G@@6B@" +// NO-VFTABLE-NOT: @"??_7G@@6B@" void use(G *obj) { obj->j(); } // Test that the usual Itanium-style key method does not emit a vtable. @@ -136,7 +136,7 @@ struct H { virtual void f(); }; void H::f() {} -// NO-VFTABLE-NOT: @"\01??_7H@@6B@" +// NO-VFTABLE-NOT: @"??_7H@@6B@" struct Empty { }; @@ -295,7 +295,7 @@ struct S { // CHECK-NEXT: 0 | void S::f() [deleted] virtual void f() = delete; S(); - // EMITS-VFTABLE-DAG: @"\01??_7S@@6B@" = linkonce_odr unnamed_addr constant { [1 x i8*] } { [1 x i8*] [i8* bitcast (void ()* @_purecall to i8*)] } + // EMITS-VFTABLE-DAG: @"??_7S@@6B@" = linkonce_odr unnamed_addr constant { [1 x i8*] } { [1 x i8*] [i8* bitcast (void ()* @_purecall to i8*)] } }; S::S() {} diff --git a/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp b/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp index e26d333bad120..c5ce69f5cbcac 100644 --- a/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp +++ b/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp @@ -67,10 +67,10 @@ struct A : virtual V1 { // CHECK-NEXT: 0 | [this adjustment: vtordisp at -4, 0 non-virtual] virtual void f(); - // MANGLING-DAG: @"\01?f@A@simple@@$4PPPPPPPM@A@AEXXZ" + // MANGLING-DAG: @"?f@A@simple@@$4PPPPPPPM@A@AEXXZ" virtual ~A(); - // MANGLING-DAG: @"\01??_EA@simple@@$4PPPPPPPM@A@AEPAXI@Z" + // MANGLING-DAG: @"??_EA@simple@@$4PPPPPPPM@A@AEPAXI@Z" }; A a; @@ -102,11 +102,11 @@ struct B : virtual V3 { B() { use_somewhere_else(this); } virtual void f(); - // MANGLING-DAG: @"\01?f@B@simple@@$4PPPPPPPE@A@AEXXZ" + // MANGLING-DAG: @"?f@B@simple@@$4PPPPPPPE@A@AEXXZ" // Has an implicit destructor. - // MANGLING-DAG: @"\01??_EB@simple@@$4PPPPPPPE@7AEPAXI@Z" - // MANGLING-DAG: @"\01??_EB@simple@@$4PPPPPPPM@A@AEPAXI@Z" + // MANGLING-DAG: @"??_EB@simple@@$4PPPPPPPE@7AEPAXI@Z" + // MANGLING-DAG: @"??_EB@simple@@$4PPPPPPPM@A@AEPAXI@Z" }; B b; @@ -147,12 +147,12 @@ struct C : virtual V4 { int x; virtual void f(); - // MANGLING-DAG: @"\01?f@C@simple@@$4PPPPPPPA@3AEXXZ" - // MANGLING-DAG: @"\01?f@C@simple@@$4PPPPPPPE@A@AEXXZ" + // MANGLING-DAG: @"?f@C@simple@@$4PPPPPPPA@3AEXXZ" + // MANGLING-DAG: @"?f@C@simple@@$4PPPPPPPE@A@AEXXZ" virtual ~C(); - // MANGLING-DAG: @"\01??_EC@simple@@$4PPPPPPPA@M@AEPAXI@Z" - // MANGLING-DAG: @"\01??_EC@simple@@$4PPPPPPPE@7AEPAXI@Z" - // MANGLING-DAG: @"\01??_EC@simple@@$4PPPPPPPM@A@AEPAXI@Z" + // MANGLING-DAG: @"??_EC@simple@@$4PPPPPPPA@M@AEPAXI@Z" + // MANGLING-DAG: @"??_EC@simple@@$4PPPPPPPE@7AEPAXI@Z" + // MANGLING-DAG: @"??_EC@simple@@$4PPPPPPPM@A@AEPAXI@Z" }; C c; @@ -167,7 +167,7 @@ class D : B { D(); int z; - // MANGLING-DAG: @"\01?f@B@simple@@$4PPPPPPPE@3AEXXZ" + // MANGLING-DAG: @"?f@B@simple@@$4PPPPPPPE@3AEXXZ" }; D::D() {} @@ -192,7 +192,7 @@ struct F : virtual E { virtual void g(); // Force a vtordisp. int f; - // MANGLING-DAG: @"\01?g@F@simple@@$4PPPPPPPM@A@AEXXZ"{{.*}}??_EF@simple@@$4PPPPPPPM@A@AEPAXI@Z + // MANGLING-DAG: @"?g@F@simple@@$4PPPPPPPM@A@AEXXZ"{{.*}}??_EF@simple@@$4PPPPPPPM@A@AEPAXI@Z // MANGLING-DAG: ?f@E@simple@@UAEXXZ{{.*}}??_EF@simple@@$4PPPPPPPE@7AEPAXI@Z }; @@ -213,8 +213,8 @@ struct G : F { G(); int g; - // MANGLING-DAG: @"\01?g@F@simple@@$4PPPPPPPM@3AEXXZ"{{.*}}@"\01??_EG@simple@@$4PPPPPPPM@A@AEPAXI@Z" - // MANGLING-DAG: @"\01?f@E@simple@@UAEXXZ"{{.*}}@"\01??_EG@simple@@$4PPPPPPPE@7AEPAXI@Z" + // MANGLING-DAG: @"?g@F@simple@@$4PPPPPPPM@3AEXXZ"{{.*}}@"??_EG@simple@@$4PPPPPPPM@A@AEPAXI@Z" + // MANGLING-DAG: @"?f@E@simple@@UAEXXZ"{{.*}}@"??_EG@simple@@$4PPPPPPPE@7AEPAXI@Z" }; G::G() {} @@ -248,11 +248,11 @@ struct A : virtual simple::A { // CHECK-NEXT: vboffset at 8 in the vbtable, 8 non-virtual] // `vtordispex{8,8,4294967292,8}' - // MANGLING-DAG: @"\01?f@A@simple@@$R477PPPPPPPM@7AEXXZ" + // MANGLING-DAG: @"?f@A@simple@@$R477PPPPPPPM@7AEXXZ" virtual ~A(); // vtordisp{4294967292,0} - // MANGLING-DAG: @"\01??_EA@extended@@$4PPPPPPPM@A@AEPAXI@Z" + // MANGLING-DAG: @"??_EA@extended@@$4PPPPPPPM@A@AEPAXI@Z" }; A a; @@ -273,7 +273,7 @@ struct B : virtual simple::A { // CHECK-NEXT: vboffset at 8 in the vbtable, 8 non-virtual] // vtordisp{4294967292,0} - // MANGLING-DAG: @"\01??_EB@extended@@$4PPPPPPPM@A@AEPAXI@Z" + // MANGLING-DAG: @"??_EB@extended@@$4PPPPPPPM@A@AEPAXI@Z" }; B b; @@ -290,10 +290,10 @@ struct C : virtual simple::A { // CHECK-NEXT: vboffset at 8 in the vbtable, 8 non-virtual] // `vtordispex{12,8,4294967292,8}' - // MANGLING-DAG: @"\01?f@A@simple@@$R4M@7PPPPPPPM@7AEXXZ" + // MANGLING-DAG: @"?f@A@simple@@$R4M@7PPPPPPPM@7AEXXZ" int x; virtual ~C(); - // MANGLING-DAG: @"\01??_EC@extended@@$4PPPPPPPM@A@AEPAXI@Z" + // MANGLING-DAG: @"??_EC@extended@@$4PPPPPPPM@A@AEPAXI@Z" }; C c; @@ -316,10 +316,10 @@ struct E : virtual D { // CHECK-NEXT: vboffset at 8 in the vbtable, 12 non-virtual] // `vtordispex{8,8,4294967292,12}' - // MANGLING-DAG: @"\01?f@D@extended@@$R477PPPPPPPM@M@AEXXZ" + // MANGLING-DAG: @"?f@D@extended@@$R477PPPPPPPM@M@AEXXZ" virtual ~E(); - // MANGLING-DAG: @"\01??_EE@extended@@$4PPPPPPPM@A@AEPAXI@Z" + // MANGLING-DAG: @"??_EE@extended@@$4PPPPPPPM@A@AEPAXI@Z" }; E e; @@ -336,10 +336,10 @@ struct F : virtual Z, virtual D { // CHECK-NEXT: vboffset at 12 in the vbtable, 12 non-virtual] // `vtordispex{20,12,4294967292,12}' - // MANGLING-DAG: @"\01?f@D@extended@@$R4BE@M@PPPPPPPM@M@AEXXZ" + // MANGLING-DAG: @"?f@D@extended@@$R4BE@M@PPPPPPPM@M@AEXXZ" int x; virtual ~F(); - // MANGLING-DAG: @"\01??_EF@extended@@$4PPPPPPPM@M@AEPAXI@Z" + // MANGLING-DAG: @"??_EF@extended@@$4PPPPPPPM@M@AEPAXI@Z" }; F f; @@ -365,7 +365,7 @@ struct G : virtual simple::A { virtual ~G(); // vtordisp{4294967292,0} - // MANGLING-DAG: @"\01??_EG@extended@@$4PPPPPPPM@A@AEPAXI@Z" + // MANGLING-DAG: @"??_EG@extended@@$4PPPPPPPM@A@AEPAXI@Z" }; G g; @@ -385,8 +385,8 @@ struct H : Z, A { // CHECK-NEXT: 0 | [this adjustment: vtordisp at -4, vbptr at 8 to the left, // CHECK-NEXT: vboffset at 8 in the vbtable, 8 non-virtual] - // MANGLING-DAG: @"\01?f@A@simple@@$R477PPPPPPPM@7AEXXZ" - // MANGLING-DAG: @"\01??_EH@extended@@$4PPPPPPPM@BA@AEPAXI@Z" + // MANGLING-DAG: @"?f@A@simple@@$R477PPPPPPPM@7AEXXZ" + // MANGLING-DAG: @"??_EH@extended@@$4PPPPPPPM@BA@AEPAXI@Z" }; H h; @@ -407,7 +407,7 @@ struct A : virtual simple::B { // CHECK-NEXT: 0 | [this adjustment: vtordisp at -12, vbptr at 20 to the left, // CHECK-NEXT: vboffset at 8 in the vbtable, 16 non-virtual] - // MANGLING-DAG: @"\01?f@B@simple@@$R4BE@7PPPPPPPE@BA@AEXXZ" + // MANGLING-DAG: @"?f@B@simple@@$R4BE@7PPPPPPPE@BA@AEXXZ" int a; virtual ~A(); }; @@ -442,7 +442,7 @@ struct D : C { // CHECK-NEXT: 0 | void pr19408::C::f() // CHECK-NEXT: [this adjustment: vtordisp at -4, -4 non-virtual] - // MANGLING-DAG: @"\01?f@C@pr19408@@$4PPPPPPPM@3AEXXZ" + // MANGLING-DAG: @"?f@C@pr19408@@$4PPPPPPPM@3AEXXZ" D(); int d; }; @@ -463,10 +463,10 @@ struct B : virtual A { virtual ~B(); protected: virtual void prot(); - // MANGLING-DAG: @"\01?prot@B@access@@$2PPPPPPPM@A@AEXXZ" + // MANGLING-DAG: @"?prot@B@access@@$2PPPPPPPM@A@AEXXZ" private: virtual void priv(); - // MANGLING-DAG: @"\01?priv@B@access@@$0PPPPPPPM@A@AEXXZ" + // MANGLING-DAG: @"?priv@B@access@@$0PPPPPPPM@A@AEXXZ" }; B b; @@ -474,8 +474,8 @@ B b; struct C : virtual B { virtual ~C(); - // MANGLING-DAG: @"\01?prot@B@access@@$R277PPPPPPPM@7AEXXZ" - // MANGLING-DAG: @"\01?priv@B@access@@$R077PPPPPPPM@7AEXXZ" + // MANGLING-DAG: @"?prot@B@access@@$R277PPPPPPPM@7AEXXZ" + // MANGLING-DAG: @"?priv@B@access@@$R077PPPPPPPM@7AEXXZ" }; C c; @@ -503,7 +503,7 @@ struct X : B, virtual C { // CHECK-NEXT: 0 | void pr19505::B::f() // CHECK-NEXT: 1 | void pr19505::A::z() - // MANGLING-DAG: @"\01??_7X@pr19505@@6BB@1@@" = {{.*}}@"\01?f@B@pr19505@@UAEXXZ" + // MANGLING-DAG: @"??_7X@pr19505@@6BB@1@@" = {{.*}}@"?f@B@pr19505@@UAEXXZ" } x; void build_vftable(X *obj) { obj->g(); } @@ -530,7 +530,7 @@ struct X : C, virtual B { // CHECK-NEXT: 1 | void pr19506::X::g() // CHECK-NEXT: [this adjustment: vtordisp at -4, -12 non-virtual] - // MANGLING-DAG: @"\01??_7X@pr19506@@6BB@1@@" = {{.*}}@"\01?f@B@pr19506@@UAEXXZ" + // MANGLING-DAG: @"??_7X@pr19506@@6BB@1@@" = {{.*}}@"?f@B@pr19506@@UAEXXZ" } x; void build_vftable(X *obj) { obj->g(); } @@ -562,7 +562,7 @@ struct X : B, C { // CHECK-NEXT: 1 | void pr19519::C::g() // CHECK-NEXT: [this adjustment: vtordisp at -4, -4 non-virtual] - // MANGLING-DAG: @"\01??_7X@pr19519@@6B@" = {{.*}}@"\01?g@C@pr19519@@$4PPPPPPPM@3AEXXZ" + // MANGLING-DAG: @"??_7X@pr19519@@6B@" = {{.*}}@"?g@C@pr19519@@$4PPPPPPPM@3AEXXZ" }; X::X() {} diff --git a/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp b/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp index 342a584182cc2..8e309acc9188b 100644 --- a/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp +++ b/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp @@ -22,7 +22,7 @@ struct C: virtual A { // CHECK-NEXT: vbtable index 1, vfptr at offset 0 // CHECK-NEXT: 0 | void C::f() - // MANGLING-DAG: @"\01??_7C@@6B@" + // MANGLING-DAG: @"??_7C@@6B@" virtual void f() {} }; @@ -44,8 +44,8 @@ struct D: virtual A { // CHECK-NEXT: via vbtable index 1, vfptr at offset 0 // CHECK-NEXT: 0 | void D::f() - // MANGLING-DAG: @"\01??_7D@@6B0@@" - // MANGLING-DAG: @"\01??_7D@@6BA@@@" + // MANGLING-DAG: @"??_7D@@6B0@@" + // MANGLING-DAG: @"??_7D@@6BA@@@" virtual void f(); virtual void h(); @@ -60,7 +60,7 @@ struct X { int x; }; // X and A get reordered in the layout since X doesn't have a vfptr while A has. struct Y : X, A { }; -// MANGLING-DAG: @"\01??_7Y@Test1@@6B@" +// MANGLING-DAG: @"??_7Y@Test1@@6B@" struct Z : virtual Y { Z(); @@ -70,7 +70,7 @@ struct Z : virtual Y { // CHECK-NOT: VFTable indices for 'Test1::Z' - // MANGLING-DAG: @"\01??_7Z@Test1@@6B@" + // MANGLING-DAG: @"??_7Z@Test1@@6B@" }; Z::Z() {} @@ -92,9 +92,9 @@ struct X: virtual A, virtual B { // CHECK-LABEL: VFTable indices for 'Test2::X' (1 entry). // CHECK-NEXT: 0 | void Test2::X::h() - // MANGLING-DAG: @"\01??_7X@Test2@@6B01@@" - // MANGLING-DAG: @"\01??_7X@Test2@@6BA@@@" - // MANGLING-DAG: @"\01??_7X@Test2@@6BB@@@" + // MANGLING-DAG: @"??_7X@Test2@@6B01@@" + // MANGLING-DAG: @"??_7X@Test2@@6BA@@@" + // MANGLING-DAG: @"??_7X@Test2@@6BB@@@" virtual void h(); }; @@ -106,7 +106,7 @@ void use(X *obj) { obj->h(); } namespace Test3 { struct X : virtual A { - // MANGLING-DAG: @"\01??_7X@Test3@@6B@" + // MANGLING-DAG: @"??_7X@Test3@@6B@" }; struct Y: virtual X { @@ -117,7 +117,7 @@ struct Y: virtual X { // CHECK-NOT: VFTable indices for 'Test3::Y' - // MANGLING-DAG: @"\01??_7Y@Test3@@6B@" + // MANGLING-DAG: @"??_7Y@Test3@@6B@" }; Y::Y() {} @@ -142,10 +142,10 @@ struct X: virtual C { // CHECK-NOT: VFTable indices for 'Test4::X' - // MANGLING-DAG: @"\01??_7X@Test4@@6B@" + // MANGLING-DAG: @"??_7X@Test4@@6B@" // Also check the mangling of the thunk. - // MANGLING-DAG: define linkonce_odr x86_thiscallcc void @"\01?f@C@@WPPPPPPPI@AEXXZ" + // MANGLING-DAG: define linkonce_odr dso_local x86_thiscallcc void @"?f@C@@WPPPPPPPI@AEXXZ" }; X::X() {} @@ -155,7 +155,7 @@ namespace Test5 { // New methods are added to the base's vftable. struct X : A { - // MANGLING-DAG: @"\01??_7X@Test5@@6B@" + // MANGLING-DAG: @"??_7X@Test5@@6B@" virtual void g(); }; @@ -171,8 +171,8 @@ struct Y : virtual X { // CHECK-LABEL: VFTable indices for 'Test5::Y' (1 entry). // CHECK-NEXT: 0 | void Test5::Y::h() - // MANGLING-DAG: @"\01??_7Y@Test5@@6B01@@" - // MANGLING-DAG: @"\01??_7Y@Test5@@6BX@1@@" + // MANGLING-DAG: @"??_7Y@Test5@@6B01@@" + // MANGLING-DAG: @"??_7Y@Test5@@6BX@1@@" virtual void h(); }; @@ -191,7 +191,7 @@ struct X : A, virtual Empty { // CHECK-NOT: VFTable indices for 'Test6::X' - // MANGLING-DAG: @"\01??_7X@Test6@@6B@" + // MANGLING-DAG: @"??_7X@Test6@@6B@" }; X::X() {} @@ -200,7 +200,7 @@ X::X() {} namespace Test7 { struct X : C { - // MANGLING-DAG: @"\01??_7X@Test7@@6B@" + // MANGLING-DAG: @"??_7X@Test7@@6B@" }; struct Y : virtual X { @@ -215,7 +215,7 @@ struct Y : virtual X { // CHECK-NOT: VFTable indices for 'Test7::Y' - // MANGLING-DAG: @"\01??_7Y@Test7@@6B@" + // MANGLING-DAG: @"??_7Y@Test7@@6B@" }; Y::Y() {} @@ -236,8 +236,8 @@ struct X : D, C { // CHECK-NEXT: via vbtable index 1, vfptr at offset 0 // CHECK-NEXT: 0 | void Test8::X::f() - // MANGLING-DAG: @"\01??_7X@Test8@@6BA@@@" - // MANGLING-DAG: @"\01??_7X@Test8@@6BD@@@" + // MANGLING-DAG: @"??_7X@Test8@@6BA@@@" + // MANGLING-DAG: @"??_7X@Test8@@6BD@@@" virtual void f(); }; @@ -299,8 +299,8 @@ struct Y : virtual X { // CHECK-LABEL: VFTable indices for 'Test9::Y' (1 entry). // CHECK-NEXT: 0 | void Test9::Y::h() - // MANGLING-DAG: @"\01??_7Y@Test9@@6B01@@" - // MANGLING-DAG: @"\01??_7Y@Test9@@6BX@1@@" + // MANGLING-DAG: @"??_7Y@Test9@@6B01@@" + // MANGLING-DAG: @"??_7Y@Test9@@6BX@1@@" virtual void h(); }; @@ -322,10 +322,10 @@ struct Z : Y, virtual B { // CHECK-NOT: VFTable indices for 'Test9::Z' - // MANGLING-DAG: @"\01??_7Z@Test9@@6BX@1@@" - // MANGLING-DAG: @"\01??_7Z@Test9@@6BY@1@@" + // MANGLING-DAG: @"??_7Z@Test9@@6BX@1@@" + // MANGLING-DAG: @"??_7Z@Test9@@6BY@1@@" - // MANGLING-DAG: @"\01??_7Z@Test9@@6B@" + // MANGLING-DAG: @"??_7Z@Test9@@6B@" }; Z::Z() {} @@ -355,12 +355,12 @@ struct W : Z, D, virtual A, virtual B { // CHECK-NOT: VFTable indices for 'Test9::W' - // MANGLING-DAG: @"\01??_7W@Test9@@6BA@@@" - // MANGLING-DAG: @"\01??_7W@Test9@@6BD@@@" - // MANGLING-DAG: @"\01??_7W@Test9@@6BX@1@@" + // MANGLING-DAG: @"??_7W@Test9@@6BA@@@" + // MANGLING-DAG: @"??_7W@Test9@@6BD@@@" + // MANGLING-DAG: @"??_7W@Test9@@6BX@1@@" - // MANGLING-DAG: @"\01??_7W@Test9@@6B@" - // MANGLING-DAG: @"\01??_7W@Test9@@6BY@1@@" + // MANGLING-DAG: @"??_7W@Test9@@6B@" + // MANGLING-DAG: @"??_7W@Test9@@6BY@1@@" }; W::W() {} @@ -404,12 +404,12 @@ struct T : Z, D, virtual A, virtual B { // CHECK-NEXT: via vbtable index 2, vfptr at offset 0 // CHECK-NEXT: 0 | void Test9::T::g() - // MANGLING-DAG: @"\01??_7T@Test9@@6BA@@@" - // MANGLING-DAG: @"\01??_7T@Test9@@6BD@@@" - // MANGLING-DAG: @"\01??_7T@Test9@@6BX@1@@" + // MANGLING-DAG: @"??_7T@Test9@@6BA@@@" + // MANGLING-DAG: @"??_7T@Test9@@6BD@@@" + // MANGLING-DAG: @"??_7T@Test9@@6BX@1@@" - // MANGLING-DAG: @"\01??_7T@Test9@@6B@" - // MANGLING-DAG: @"\01??_7T@Test9@@6BY@1@@" + // MANGLING-DAG: @"??_7T@Test9@@6B@" + // MANGLING-DAG: @"??_7T@Test9@@6BY@1@@" virtual void f(); virtual void g(); @@ -443,8 +443,8 @@ struct X : virtual A {}; struct Y { virtual void g(); }; struct Z : virtual X, Y { - // MANGLING-DAG: @"\01??_7Z@Test11@@6BY@1@@" - // MANGLING-DAG: @"\01??_7Z@Test11@@6BX@1@@" + // MANGLING-DAG: @"??_7Z@Test11@@6BY@1@@" + // MANGLING-DAG: @"??_7Z@Test11@@6BX@1@@" }; Z z; @@ -468,7 +468,7 @@ struct Z : virtual Y { // CHECK-NEXT: 1 | void A::z() int z; - // MANGLING-DAG: @"\01??_7Z@Test12@@6BA@@@" = {{.*}}@"\01?f@Y@Test12@@UAEXXZ" + // MANGLING-DAG: @"??_7Z@Test12@@6BA@@@" = {{.*}}@"?f@Y@Test12@@UAEXXZ" }; struct W : Z { @@ -478,7 +478,7 @@ struct W : Z { W(); int w; - // MANGLING-DAG: @"\01??_7W@Test12@@6BA@@@" = {{.*}}@"\01?f@Y@Test12@@UAEXXZ" + // MANGLING-DAG: @"??_7W@Test12@@6BA@@@" = {{.*}}@"?f@Y@Test12@@UAEXXZ" }; W::W() {} @@ -683,10 +683,10 @@ struct C : virtual B, A { }; C c; -// MANGLING-DAG: @"\01??_7A@pr17748@@6B@" -// MANGLING-DAG: @"\01??_7B@pr17748@@6B@" -// MANGLING-DAG: @"\01??_7C@pr17748@@6BA@1@@" -// MANGLING-DAG: @"\01??_7C@pr17748@@6BB@1@@" +// MANGLING-DAG: @"??_7A@pr17748@@6B@" +// MANGLING-DAG: @"??_7B@pr17748@@6B@" +// MANGLING-DAG: @"??_7C@pr17748@@6BA@1@@" +// MANGLING-DAG: @"??_7C@pr17748@@6BB@1@@" } namespace pr19066 { @@ -721,9 +721,9 @@ D obj; // Each MDC only has one vftable. -// MANGLING-DAG: @"\01??_7D@pr19240@@6B@" -// MANGLING-DAG: @"\01??_7A@pr19240@@6B@" -// MANGLING-DAG: @"\01??_7B@pr19240@@6B@" +// MANGLING-DAG: @"??_7D@pr19240@@6B@" +// MANGLING-DAG: @"??_7A@pr19240@@6B@" +// MANGLING-DAG: @"??_7B@pr19240@@6B@" } @@ -746,7 +746,7 @@ struct Z : Y { Z(); int z; - // MANGLING-DAG: @"\01??_7Z@pr19408@@6B@" = {{.*}}@"\01?f@Y@pr19408@@W3AEXXZ" + // MANGLING-DAG: @"??_7Z@pr19408@@6B@" = {{.*}}@"?f@Y@pr19408@@W3AEXXZ" }; Z::Z() {} @@ -759,7 +759,7 @@ struct W : B, Y { W(); int w; - // MANGLING-DAG: @"\01??_7W@pr19408@@6BY@1@@" = {{.*}}@"\01?f@Y@pr19408@@W3AEXXZ" + // MANGLING-DAG: @"??_7W@pr19408@@6BY@1@@" = {{.*}}@"?f@Y@pr19408@@W3AEXXZ" }; W::W() {} @@ -771,7 +771,7 @@ struct A { }; struct __declspec(dllexport) B : virtual A { virtual void f() = 0; - // MANGLING-DAG: @"\01??_7B@Test13@@6B@" = weak_odr dllexport unnamed_addr constant { [1 x i8*] } { [1 x i8*] [i8* bitcast (void ()* @_purecall to i8*)] } + // MANGLING-DAG: @"??_7B@Test13@@6B@" = weak_odr dllexport unnamed_addr constant { [1 x i8*] } { [1 x i8*] [i8* bitcast (void ()* @_purecall to i8*)] } }; } @@ -788,8 +788,8 @@ C::C() {} // CHECK-LABEL: VFTable for 'pr21031_1::B' in 'pr21031_1::C' (1 entry) // CHECK-NEXT: 0 | void pr21031_1::B::g() -// MANGLING-DAG: @"\01??_7C@pr21031_1@@6BB@1@@" = {{.*}} constant { [1 x i8*] } -// MANGLING-DAG: @"\01??_7C@pr21031_1@@6B@" = {{.*}} constant { [1 x i8*] } +// MANGLING-DAG: @"??_7C@pr21031_1@@6BB@1@@" = {{.*}} constant { [1 x i8*] } +// MANGLING-DAG: @"??_7C@pr21031_1@@6B@" = {{.*}} constant { [1 x i8*] } } namespace pr21031_2 { @@ -804,8 +804,8 @@ C::C() {} // CHECK-LABEL: VFTable for 'pr21031_2::A' in 'pr21031_2::B' in 'pr21031_2::C' (1 entry) // CHECK-NEXT: 0 | void pr21031_2::A::f() -// MANGLING-DAG: @"\01??_7C@pr21031_2@@6BA@1@@" = {{.*}} constant { [1 x i8*] } -// MANGLING-DAG: @"\01??_7C@pr21031_2@@6BB@1@@" = {{.*}} constant { [1 x i8*] } +// MANGLING-DAG: @"??_7C@pr21031_2@@6BA@1@@" = {{.*}} constant { [1 x i8*] } +// MANGLING-DAG: @"??_7C@pr21031_2@@6BB@1@@" = {{.*}} constant { [1 x i8*] } } namespace pr21062_1 { @@ -818,7 +818,7 @@ D::D() {} // CHECK-LABEL: VFTable for 'pr21062_1::A' in 'pr21062_1::D' (1 entry) // CHECK-NEXT: 0 | void pr21062_1::A::f() -// MANGLING-DAG: @"\01??_7D@pr21062_1@@6B@" = {{.*}} constant { [1 x i8*] } +// MANGLING-DAG: @"??_7D@pr21062_1@@6B@" = {{.*}} constant { [1 x i8*] } } namespace pr21062_2 { @@ -831,7 +831,7 @@ D::D() {} // CHECK-LABEL: VFTable for 'pr21062_2::A' in 'pr21062_2::D' (1 entry) // CHECK-NEXT: 0 | void pr21062_2::A::f() -// MANGLING-DAG: @"\01??_7D@pr21062_2@@6B@" = {{.*}} constant { [1 x i8*] } +// MANGLING-DAG: @"??_7D@pr21062_2@@6B@" = {{.*}} constant { [1 x i8*] } } namespace pr21064 { @@ -843,5 +843,5 @@ D::D() {} // CHECK-LABEL: VFTable for 'pr21064::B' in 'pr21064::C' in 'pr21064::D' (1 entry) // CHECK-NEXT: 0 | void pr21064::B::f() -// MANGLING-DAG: @"\01??_7D@pr21064@@6B@" = {{.*}} constant { [1 x i8*] } +// MANGLING-DAG: @"??_7D@pr21064@@6B@" = {{.*}} constant { [1 x i8*] } } diff --git a/test/CodeGenCXX/microsoft-compatibility.cpp b/test/CodeGenCXX/microsoft-compatibility.cpp index 36760243d49b8..64d10a54c0062 100644 --- a/test/CodeGenCXX/microsoft-compatibility.cpp +++ b/test/CodeGenCXX/microsoft-compatibility.cpp @@ -8,7 +8,7 @@ struct S { template <> const int S<char>::x[] = {1}; -// CHECK-LABEL: @"\01?x@?$S@D@@2QBHB" = weak_odr constant [1 x i32] [i32 1], comdat +// CHECK-LABEL: @"?x@?$S@D@@2QBHB" = weak_odr dso_local constant [1 x i32] [i32 1], comdat template<class T> void destroy(T *p) { @@ -20,11 +20,11 @@ extern "C" void f() { destroy((void*)&a); } -// CHECK-LABEL: define void @f() -// CHECK: call void @"\01??$destroy@X@@YAXPAX@Z" +// CHECK-LABEL: define dso_local void @f() +// CHECK: call void @"??$destroy@X@@YAXPAX@Z" // CHECK: ret void -// CHECK-LABEL: define linkonce_odr void @"\01??$destroy@X@@YAXPAX@Z"(i8* %p) +// CHECK-LABEL: define linkonce_odr dso_local void @"??$destroy@X@@YAXPAX@Z"(i8* %p) // The pseudo-dtor expr should not generate calls to anything. // CHECK-NOT: call // CHECK-NOT: invoke diff --git a/test/CodeGenCXX/microsoft-inaccessible-base.cpp b/test/CodeGenCXX/microsoft-inaccessible-base.cpp index 2c0d124eb01eb..d8af8ef9eaf7f 100644 --- a/test/CodeGenCXX/microsoft-inaccessible-base.cpp +++ b/test/CodeGenCXX/microsoft-inaccessible-base.cpp @@ -10,11 +10,11 @@ struct B : A { int b; }; struct C : A, B { }; extern "C" A *a_from_c(C *p) { return p; } -// CHECK-LABEL: define %struct.A* @a_from_c(%struct.C* %{{.*}}) +// CHECK-LABEL: define dso_local %struct.A* @a_from_c(%struct.C* %{{.*}}) // CHECK: bitcast %struct.C* %{{.*}} to %struct.A* struct D : B, A { }; extern "C" A *a_from_d(D *p) { return p; } -// CHECK-LABEL: define %struct.A* @a_from_d(%struct.D* %{{.*}}) +// CHECK-LABEL: define dso_local %struct.A* @a_from_d(%struct.D* %{{.*}}) // CHECK: %[[p_i8:[^ ]*]] = bitcast %struct.D* %{{.*}} to i8* // CHECK: getelementptr inbounds i8, i8* %[[p_i8]], i64 8 diff --git a/test/CodeGenCXX/microsoft-interface.cpp b/test/CodeGenCXX/microsoft-interface.cpp index 5f3a94a494b7c..74a52097d7936 100644 --- a/test/CodeGenCXX/microsoft-interface.cpp +++ b/test/CodeGenCXX/microsoft-interface.cpp @@ -17,24 +17,24 @@ int fn() { return s.test(); } -// CHECK: @_ZTV1S = linkonce_odr unnamed_addr constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1S to i8*), i8* bitcast (i32 (%struct.S*)* @_ZN1S4testEv to i8*)] } +// CHECK: @_ZTV1S = linkonce_odr dso_local unnamed_addr constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1S to i8*), i8* bitcast (i32 (%struct.S*)* @_ZN1S4testEv to i8*)] } -// CHECK-LABEL: define i32 @_Z2fnv() +// CHECK-LABEL: define dso_local i32 @_Z2fnv() // CHECK: call x86_thiscallcc void @_ZN1SC1Ev(%struct.S* %s) // CHECK: %{{[.0-9A-Z_a-z]+}} = call x86_thiscallcc i32 @_ZN1S4testEv(%struct.S* %s) -// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @_ZN1SC1Ev(%struct.S* %this) +// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @_ZN1SC1Ev(%struct.S* %this) // CHECK: call x86_thiscallcc void @_ZN1SC2Ev(%struct.S* %{{[.0-9A-Z_a-z]+}}) -// CHECK-LABEL: define linkonce_odr x86_thiscallcc i32 @_ZN1S4testEv(%struct.S* %this) +// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc i32 @_ZN1S4testEv(%struct.S* %this) // CHECK: %{{[.0-9A-Z_a-z]+}} = call x86_thiscallcc i32 @_ZN1I4testEv(%__interface.I* %{{[.0-9A-Z_a-z]+}}) -// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @_ZN1SC2Ev(%struct.S* %this) +// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @_ZN1SC2Ev(%struct.S* %this) // CHECK: call x86_thiscallcc void @_ZN1IC2Ev(%__interface.I* %{{[.0-9A-Z_a-z]+}}) // CHECK: store i32 (...)** bitcast (i8** getelementptr inbounds ({ [3 x i8*] }, { [3 x i8*] }* @_ZTV1S, i32 0, inrange i32 0, i32 2) to i32 (...)**), i32 (...)*** %{{[.0-9A-Z_a-z]+}} -// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @_ZN1IC2Ev(%__interface.I* %this) +// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @_ZN1IC2Ev(%__interface.I* %this) // CHECK: store i32 (...)** bitcast (i8** getelementptr inbounds ({ [3 x i8*] }, { [3 x i8*] }* @_ZTV1I, i32 0, inrange i32 0, i32 2) to i32 (...)**), i32 (...)*** %{{[.0-9A-Z_a-z]+}} -// CHECK-LABEL: define linkonce_odr x86_thiscallcc i32 @_ZN1I4testEv(%__interface.I* %this) +// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc i32 @_ZN1I4testEv(%__interface.I* %this) // CHECK: ret i32 1 diff --git a/test/CodeGenCXX/microsoft-new.cpp b/test/CodeGenCXX/microsoft-new.cpp index 7857e478ef82b..01b0960968be7 100644 --- a/test/CodeGenCXX/microsoft-new.cpp +++ b/test/CodeGenCXX/microsoft-new.cpp @@ -13,7 +13,7 @@ namespace PR13164 { // MSVC will fall back on the non-array operator new. void *a; int *p = new(arbitrary) int[4]; - // CHECK: call i8* @"\01??2@YAPAXIUarbitrary_t@@@Z"(i32 16, %struct.arbitrary_t* + // CHECK: call i8* @"??2@YAPAXIUarbitrary_t@@@Z"(i32 16, %struct.arbitrary_t* } struct S { @@ -22,9 +22,9 @@ namespace PR13164 { void g() { S *s = new(arbitrary) S[2]; - // CHECK: call i8* @"\01??_US@PR13164@@SAPAXIUarbitrary_t@@@Z"(i32 2, %struct.arbitrary_t* + // CHECK: call i8* @"??_US@PR13164@@SAPAXIUarbitrary_t@@@Z"(i32 2, %struct.arbitrary_t* S *s1 = new(arbitrary) S; - // CHECK: call i8* @"\01??2@YAPAXIUarbitrary_t@@@Z"(i32 1, %struct.arbitrary_t* + // CHECK: call i8* @"??2@YAPAXIUarbitrary_t@@@Z"(i32 1, %struct.arbitrary_t* } struct T { @@ -34,6 +34,6 @@ namespace PR13164 { void h() { // This should still call the global operator new[]. T *t = new(arbitrary2) T[2]; - // CHECK: call i8* @"\01??_U@YAPAXIUarbitrary2_t@@@Z"(i32 2, %struct.arbitrary2_t* + // CHECK: call i8* @"??_U@YAPAXIUarbitrary2_t@@@Z"(i32 2, %struct.arbitrary2_t* } } diff --git a/test/CodeGenCXX/microsoft-no-rtti-data.cpp b/test/CodeGenCXX/microsoft-no-rtti-data.cpp index 05255909ced32..3d218ed08fde7 100644 --- a/test/CodeGenCXX/microsoft-no-rtti-data.cpp +++ b/test/CodeGenCXX/microsoft-no-rtti-data.cpp @@ -1,8 +1,8 @@ // RUN: %clang_cc1 %s -fno-rtti-data -triple=i386-pc-win32 -o - -emit-llvm | FileCheck %s // vftable shouldn't have RTTI data in it. -// CHECK-NOT: @"\01??_R4S@@6B@" -// CHECK: @"\01??_7S@@6B@" = linkonce_odr unnamed_addr constant { [1 x i8*] } { [1 x i8*] [i8* bitcast ({{.*}} @"\01??_GS@@UAEPAXI@Z" to i8*)] }, comdat +// CHECK-NOT: @"??_R4S@@6B@" +// CHECK: @"??_7S@@6B@" = linkonce_odr unnamed_addr constant { [1 x i8*] } { [1 x i8*] [i8* bitcast ({{.*}} @"??_GS@@UAEPAXI@Z" to i8*)] }, comdat struct type_info; namespace std { using ::type_info; } @@ -19,4 +19,4 @@ extern S *getS(); const std::type_info &ti = typeid(*getS()); const U &u = dynamic_cast<U &>(*getS()); -// CHECK: call i8* @__RTDynamicCast(i8* %{{.+}}, i32 0, i8* bitcast ({{.*}} @"\01??_R0?AUS@@@8" to i8*), i8* bitcast ({{.*}} @"\01??_R0?AUU@@@8" to i8*), i32 1) +// CHECK: call i8* @__RTDynamicCast(i8* %{{.+}}, i32 0, i8* bitcast ({{.*}} @"??_R0?AUS@@@8" to i8*), i8* bitcast ({{.*}} @"??_R0?AUU@@@8" to i8*), i32 1) diff --git a/test/CodeGenCXX/microsoft-templ-uuidof.cpp b/test/CodeGenCXX/microsoft-templ-uuidof.cpp index 74d6069bbacf3..7d40a15c93a5b 100644 --- a/test/CodeGenCXX/microsoft-templ-uuidof.cpp +++ b/test/CodeGenCXX/microsoft-templ-uuidof.cpp @@ -15,13 +15,15 @@ struct __declspec(uuid("{BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB}")) X<B> {}; struct __declspec(uuid("{CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCCCC}")) C {}; +// CHECK-DAG: @_GUID_aaaaaaaa_aaaa_aaaa_aaaa_aaaaaaaaaaaa = linkonce_odr dso_local + const _GUID &xa = __uuidof(X<A>); -// CHECK-DAG: @"\01?xa@@3ABU_GUID@@B" = {{.*}} @_GUID_aaaaaaaa_aaaa_aaaa_aaaa_aaaaaaaaaaaa +// CHECK-DAG: @"?xa@@3ABU_GUID@@B" = {{.*}} @_GUID_aaaaaaaa_aaaa_aaaa_aaaa_aaaaaaaaaaaa const _GUID &xb = __uuidof(X<B>); -// CHECK-DAG: @"\01?xb@@3ABU_GUID@@B" = {{.*}} @_GUID_bbbbbbbb_bbbb_bbbb_bbbb_bbbbbbbbbbbb +// CHECK-DAG: @"?xb@@3ABU_GUID@@B" = {{.*}} @_GUID_bbbbbbbb_bbbb_bbbb_bbbb_bbbbbbbbbbbb const _GUID &xc = __uuidof(X<C>); -// CHECK-DAG: @"\01?xc@@3ABU_GUID@@B" = {{.*}} @_GUID_cccccccc_cccc_cccc_cccc_cccccccccccc +// CHECK-DAG: @"?xc@@3ABU_GUID@@B" = {{.*}} @_GUID_cccccccc_cccc_cccc_cccc_cccccccccccc template <> struct __declspec(uuid("{DDDDDDDD-DDDD-DDDD-DDDD-DDDDDDDDDDDD}")) X<C> {}; @@ -31,7 +33,7 @@ struct __declspec(uuid("{EEEEEEEE-EEEE-EEEE-EEEE-EEEEEEEEEEEE}")) Y { }; const _GUID &xd = __uuidof(X<C>); -// CHECK-DAG: @"\01?xd@@3ABU_GUID@@B" = {{.*}} @_GUID_dddddddd_dddd_dddd_dddd_dddddddddddd +// CHECK-DAG: @"?xd@@3ABU_GUID@@B" = {{.*}} @_GUID_dddddddd_dddd_dddd_dddd_dddddddddddd const _GUID &yd = __uuidof(Y<X<C> >); -// CHECK-DAG: @"\01?yd@@3ABU_GUID@@B" = {{.*}} @_GUID_dddddddd_dddd_dddd_dddd_dddddddddddd +// CHECK-DAG: @"?yd@@3ABU_GUID@@B" = {{.*}} @_GUID_dddddddd_dddd_dddd_dddd_dddddddddddd diff --git a/test/CodeGenCXX/microsoft-uuidof.cpp b/test/CodeGenCXX/microsoft-uuidof.cpp index 9b4ff68d9aa84..f8d2da7379107 100644 --- a/test/CodeGenCXX/microsoft-uuidof.cpp +++ b/test/CodeGenCXX/microsoft-uuidof.cpp @@ -63,12 +63,12 @@ const GUID& zeroiid = __uuidof(0); // CHECK: @_GUID_87654321_4321_4321_4321_ba0987654321 = linkonce_odr constant { i32, i16, i16, [8 x i8] } { i32 -2023406815, i16 17185, i16 17185, [8 x i8] c"C!\BA\09\87eC!" }, comdat // The static initializer for thing. -// CHECK-DEFINE-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast (%struct._GUID* @thing to i8*), i8* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ac to i8*), i32 16, i32 4, i1 false) -// CHECK-DEFINE-WRONG-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast (%struct._GUID* @thing to i8*), i8* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ac to i8*), i32 4, i32 4, i1 false) +// CHECK-DEFINE-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 bitcast (%struct._GUID* @thing to i8*), i8* align 4 bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ac to i8*), i32 16, i1 false) +// CHECK-DEFINE-WRONG-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 bitcast (%struct._GUID* @thing to i8*), i8* align 4 bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ac to i8*), i32 4, i1 false) // The static initializer for g. -// CHECK-DEFINE-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast (%struct._GUID* @g to i8*), i8* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 16, i32 4, i1 false) -// CHECK-DEFINE-WRONG-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast (%struct._GUID* @g to i8*), i8* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 4, i32 4, i1 false) +// CHECK-DEFINE-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 bitcast (%struct._GUID* @g to i8*), i8* align 4 bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 16, i1 false) +// CHECK-DEFINE-WRONG-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 bitcast (%struct._GUID* @g to i8*), i8* align 4 bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 4, i1 false) #ifdef DEFINE_GUID void fun() { @@ -81,20 +81,20 @@ void fun() { // CHECK-DEFINE-GUID: [[U1:%.+]] = bitcast %struct._GUID* %s1_1 to i8* // CHECK-DEFINE-WRONG-GUID: [[U1:%.+]] = bitcast %struct._GUID* %s1_1 to i8* - // CHECK-DEFINE-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* [[U1]], i8* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 16, i32 4, i1 false) - // CHECK-DEFINE-WRONG-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* [[U1]], i8* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 4, i32 4, i1 false) + // CHECK-DEFINE-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 [[U1]], i8* align 4 bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 16, i1 false) + // CHECK-DEFINE-WRONG-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 [[U1]], i8* align 4 bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 4, i1 false) GUID s1_1 = __uuidof(S1); // CHECK-DEFINE-GUID: [[U2:%.+]] = bitcast %struct._GUID* %s1_2 to i8* // CHECK-DEFINE-WRONG-GUID: [[U2:%.+]] = bitcast %struct._GUID* %s1_2 to i8* - // CHECK-DEFINE-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* [[U2]], i8* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 16, i32 4, i1 false) - // CHECK-DEFINE-WRONG-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* [[U2]], i8* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 4, i32 4, i1 false) + // CHECK-DEFINE-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 [[U2]], i8* align 4 bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 16, i1 false) + // CHECK-DEFINE-WRONG-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 [[U2]], i8* align 4 bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 4, i1 false) GUID s1_2 = __uuidof(S1); // CHECK-DEFINE-GUID: [[U3:%.+]] = bitcast %struct._GUID* %s1_3 to i8* // CHECK-DEFINE-WRONG-GUID: [[U3:%.+]] = bitcast %struct._GUID* %s1_3 to i8* - // CHECK-DEFINE-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* [[U3]], i8* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 16, i32 4, i1 false) - // CHECK-DEFINE-WRONG-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* [[U3]], i8* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 4, i32 4, i1 false) + // CHECK-DEFINE-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 [[U3]], i8* align 4 bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 16, i1 false) + // CHECK-DEFINE-WRONG-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 [[U3]], i8* align 4 bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 4, i1 false) GUID s1_3 = __uuidof(s1); } #endif diff --git a/test/CodeGenCXX/mingw-new-abi.cpp b/test/CodeGenCXX/mingw-new-abi.cpp index 2b05253b0985a..fe98a1fb2f022 100644 --- a/test/CodeGenCXX/mingw-new-abi.cpp +++ b/test/CodeGenCXX/mingw-new-abi.cpp @@ -3,8 +3,8 @@ namespace test1 { struct foo { - // MINGW: declare x86_thiscallcc void @_ZN5test13foo1fEv - // CYGWIN: declare void @_ZN5test13foo1fEv + // MINGW: declare dso_local x86_thiscallcc void @_ZN5test13foo1fEv + // CYGWIN: declare dso_local void @_ZN5test13foo1fEv void f(); }; void g(foo *x) { diff --git a/test/CodeGenCXX/mingw-w64-seh-exceptions.cpp b/test/CodeGenCXX/mingw-w64-seh-exceptions.cpp index 046c4a815f46f..f3c3dca303870 100644 --- a/test/CodeGenCXX/mingw-w64-seh-exceptions.cpp +++ b/test/CodeGenCXX/mingw-w64-seh-exceptions.cpp @@ -16,12 +16,12 @@ extern "C" void test() { foo(); } -// X64: define void @test() +// X64: define dso_local void @test() // X64-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_seh0 to i8*) // X64: invoke void @foo() // X64: landingpad { i8*, i32 } -// X86: define void @test() +// X86: define dso_local void @test() // X86-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) // X86: invoke void @foo() // X86: landingpad { i8*, i32 } diff --git a/test/CodeGenCXX/ms-eh-personality.cpp b/test/CodeGenCXX/ms-eh-personality.cpp deleted file mode 100644 index 592ab69efaf2d..0000000000000 --- a/test/CodeGenCXX/ms-eh-personality.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// RUN: %clang_cc1 -triple x86_64-windows-msvc -fexceptions -fcxx-exceptions %s -emit-llvm -o - | FileCheck %s --check-prefix=MSVC -// RUN: %clang_cc1 -triple x86_64-windows-msvc -fexceptions -fcxx-exceptions -fsjlj-exceptions %s -emit-llvm -o - | FileCheck %s --check-prefix=SJLJ -// RUN: %clang_cc1 -triple x86_64-windows-msvc -fexceptions -fcxx-exceptions -fseh-exceptions %s -emit-llvm -o - | FileCheck %s --check-prefix=MSVC -// RUN: %clang_cc1 -triple x86_64-windows-msvc -fexceptions -fcxx-exceptions -fdwarf-exceptions %s -emit-llvm -o - | FileCheck %s --check-prefix=DWARF - -// MSVC: define void @f(){{.*}}@__CxxFrameHandler3 -// SJLJ: define void @f(){{.*}}@__gxx_personality_sj0 -// DWARF: define void @f(){{.*}}@__gxx_personality_v0 - -struct Cleanup { - Cleanup(); - ~Cleanup(); - int x = 0; -}; - -void g(); -extern "C" void f() { - Cleanup c; - g(); -} diff --git a/test/CodeGenCXX/ms-inline-asm-return.cpp b/test/CodeGenCXX/ms-inline-asm-return.cpp index 837f1b437a4c1..4a7165ab075e4 100644 --- a/test/CodeGenCXX/ms-inline-asm-return.cpp +++ b/test/CodeGenCXX/ms-inline-asm-return.cpp @@ -12,7 +12,7 @@ long long f_i64() { mov edx, 1 } } -// CHECK-LABEL: define i64 @f_i64() +// CHECK-LABEL: define dso_local i64 @f_i64() // CHECK: %[[r:[^ ]*]] = call i64 asm sideeffect inteldialect "mov eax, $$1\0A\09mov edx, $$1", "=A,~{eax},{{.*}}" // CHECK: ret i64 %[[r]] @@ -22,7 +22,7 @@ int f_i32() { mov edx, 1 } } -// CHECK-LABEL: define i32 @f_i32() +// CHECK-LABEL: define dso_local i32 @f_i32() // CHECK: %[[r:[^ ]*]] = call i32 asm sideeffect inteldialect "mov eax, $$1\0A\09mov edx, $$1", "={eax},~{eax},{{.*}}" // CHECK: ret i32 %[[r]] @@ -32,7 +32,7 @@ short f_i16() { mov edx, 1 } } -// CHECK-LABEL: define signext i16 @f_i16() +// CHECK-LABEL: define dso_local signext i16 @f_i16() // CHECK: %[[r:[^ ]*]] = call i32 asm sideeffect inteldialect "mov eax, $$1\0A\09mov edx, $$1", "={eax},~{eax},{{.*}}" // CHECK: %[[r_i16:[^ ]*]] = trunc i32 %[[r]] to i16 // CHECK: ret i16 %[[r_i16]] @@ -43,7 +43,7 @@ char f_i8() { mov edx, 1 } } -// CHECK-LABEL: define signext i8 @f_i8() +// CHECK-LABEL: define dso_local signext i8 @f_i8() // CHECK: %[[r:[^ ]*]] = call i32 asm sideeffect inteldialect "mov eax, $$1\0A\09mov edx, $$1", "={eax},~{eax},{{.*}}" // CHECK: %[[r_i8:[^ ]*]] = trunc i32 %[[r]] to i8 // CHECK: ret i8 %[[r_i8]] @@ -54,7 +54,7 @@ bool f_i1() { mov edx, 1U } } -// CHECK-LABEL: define zeroext i1 @f_i1() +// CHECK-LABEL: define dso_local zeroext i1 @f_i1() // CHECK: %[[r:[^ ]*]] = call i32 asm sideeffect inteldialect "mov eax, $$1\0A\09mov edx, $$1", "={eax},~{eax},{{.*}}" // CHECK: %[[r_i8:[^ ]*]] = trunc i32 %[[r]] to i8 // CHECK: store i8 %[[r_i8]], i8* %{{.*}} @@ -69,7 +69,7 @@ FourChars f_s4() { mov eax, 0x01010101 } } -// CHECK-LABEL: define i32 @f_s4() +// CHECK-LABEL: define dso_local i32 @f_s4() // CHECK: %[[r:[^ ]*]] = call i32 asm sideeffect inteldialect "mov eax, $$16843009", "={eax},~{eax},{{.*}}" // CHECK: store i32 %[[r]], i32* %{{.*}} // CHECK: %[[r_i32:[^ ]*]] = load i32, i32* %{{.*}} @@ -84,7 +84,7 @@ EightChars f_s8() { mov edx, 01010101b } } -// CHECK-LABEL: define i64 @f_s8() +// CHECK-LABEL: define dso_local i64 @f_s8() // CHECK: %[[r:[^ ]*]] = call i64 asm sideeffect inteldialect "mov eax, $$16843009\0A\09mov edx, $$85", "=A,~{eax},{{.*}}" // CHECK: store i64 %[[r]], i64* %{{.*}} // CHECK: %[[r_i64:[^ ]*]] = load i64, i64* %{{.*}} @@ -95,6 +95,6 @@ EightChars f_s8() { int main() { __asm xor eax, eax } -// CHECK-LABEL: define i32 @main() +// CHECK-LABEL: define dso_local i32 @main() // CHECK: %[[r:[^ ]*]] = call i32 asm sideeffect inteldialect "xor eax, eax", "={eax},{{.*}}" // CHECK: ret i32 %[[r]] diff --git a/test/CodeGenCXX/ms-integer-static-data-members-exported.cpp b/test/CodeGenCXX/ms-integer-static-data-members-exported.cpp index 78bb3a2b1afab..2537361383e6a 100644 --- a/test/CodeGenCXX/ms-integer-static-data-members-exported.cpp +++ b/test/CodeGenCXX/ms-integer-static-data-members-exported.cpp @@ -17,6 +17,6 @@ struct __declspec(dllexport) S { }; }; -// CHECK: @"\01?x@S@@2FB" = weak_odr dllexport constant i16 42, comdat, align 2 -// CHECK: @"\01?y@S@@2W4Enum@@B" = weak_odr dllexport constant i32 2, comdat, align 4 +// CHECK: @"?x@S@@2FB" = weak_odr dso_local dllexport constant i16 42, comdat, align 2 +// CHECK: @"?y@S@@2W4Enum@@B" = weak_odr dso_local dllexport constant i32 2, comdat, align 4 // CHECK-NOT: NonExported diff --git a/test/CodeGenCXX/ms-integer-static-data-members.cpp b/test/CodeGenCXX/ms-integer-static-data-members.cpp index b2bfc92d264c0..98414350b4519 100644 --- a/test/CodeGenCXX/ms-integer-static-data-members.cpp +++ b/test/CodeGenCXX/ms-integer-static-data-members.cpp @@ -33,20 +33,20 @@ const int S::OutOfLine_Def_Ref = 5; // No initialization. -// CHECK-DAG: @"\01?NoInit_Ref@S@@2HB" = external constant i32 +// CHECK-DAG: @"?NoInit_Ref@S@@2HB" = external dso_local constant i32 // Inline initialization, no real definiton, not referenced. -// CHECK-NOT: @"\01?Inline_NotDef_NotRef@S@@2HB" = {{.*}} constant i32 5 +// CHECK-NOT: @"?Inline_NotDef_NotRef@S@@2HB" = {{.*}} constant i32 5 // Inline initialization, no real definiton, referenced. -// CHECK-DAG: @"\01?Inline_NotDef_Ref@S@@2HB" = linkonce_odr constant i32 5, comdat, align 4 +// CHECK-DAG: @"?Inline_NotDef_Ref@S@@2HB" = linkonce_odr dso_local constant i32 5, comdat, align 4 // Inline initialization, real definiton, not referenced. -// CHECK-NOT: @"\01?Inline_Def_NotRef@S@@2HB" = constant i32 5, align 4 +// CHECK-NOT: @"?Inline_Def_NotRef@S@@2HB" = dso_local constant i32 5, align 4 // Inline initialization, real definiton, referenced. -// CHECK-DAG: @"\01?Inline_Def_Ref@S@@2HB" = linkonce_odr constant i32 5, comdat, align 4 +// CHECK-DAG: @"?Inline_Def_Ref@S@@2HB" = linkonce_odr dso_local constant i32 5, comdat, align 4 // Out-of-line initialization. -// CHECK-DAG: @"\01?OutOfLine_Def_NotRef@S@@2HB" = constant i32 5, align 4 -// CHECK-DAG: @"\01?OutOfLine_Def_Ref@S@@2HB" = constant i32 5, align 4 +// CHECK-DAG: @"?OutOfLine_Def_NotRef@S@@2HB" = dso_local constant i32 5, align 4 +// CHECK-DAG: @"?OutOfLine_Def_Ref@S@@2HB" = dso_local constant i32 5, align 4 diff --git a/test/CodeGenCXX/ms-novtable.cpp b/test/CodeGenCXX/ms-novtable.cpp index 8d54878d23f99..db0cf6886ca2e 100644 --- a/test/CodeGenCXX/ms-novtable.cpp +++ b/test/CodeGenCXX/ms-novtable.cpp @@ -1,14 +1,14 @@ // RUN: %clang_cc1 -triple i386-pc-win32 %s -emit-llvm -fms-extensions -fms-compatibility -fno-rtti -o - | FileCheck %s -// CHECK-NOT: @"\01??_7C@@6B@" +// CHECK-NOT: @"??_7C@@6B@" -// CHECK-DAG: @"\01??_7A2@@6B@" +// CHECK-DAG: @"??_7A2@@6B@" -// CHECK-DAG: @"\01??_7B2@@6B@" +// CHECK-DAG: @"??_7B2@@6B@" -// CHECK-NOT: @"\01??_7B1@@6B@" +// CHECK-NOT: @"??_7B1@@6B@" -// CHECK-NOT: @"\01??_7A1@@6B@" +// CHECK-NOT: @"??_7A1@@6B@" struct __declspec(novtable) A1 { virtual void a(); diff --git a/test/CodeGenCXX/ms-property.cpp b/test/CodeGenCXX/ms-property.cpp index 49e957b58e339..4f01528dda878 100644 --- a/test/CodeGenCXX/ms-property.cpp +++ b/test/CodeGenCXX/ms-property.cpp @@ -53,61 +53,61 @@ int main(int argc, char **argv) { Test1 t(argc); S *p1 = 0; St<float> *p2 = 0; - // CHECK: call i32 @"\01?GetX@S@@QEAAHHH@Z"(%class.S* %{{.+}}, i32 223, i32 11) + // CHECK: call i32 @"?GetX@S@@QEAAHHH@Z"(%class.S* %{{.+}}, i32 223, i32 11) int j = p1->x[223][11]; // CHECK: [[J:%.+]] = load i32, i32* % - // CHECK-NEXT: call void @"\01?PutX@S@@QEAAXHHH@Z"(%class.S* %{{.+}}, i32 23, i32 1, i32 [[J]]) + // CHECK-NEXT: call void @"?PutX@S@@QEAAXHHH@Z"(%class.S* %{{.+}}, i32 23, i32 1, i32 [[J]]) p1->x[23][1] = j; - // CHECK: call float @"\01?GetX@?$St@M@@QEAAMMM@Z"(%class.St* %{{.+}}, float 2.230000e+02, float 1.100000e+01) + // CHECK: call float @"?GetX@?$St@M@@QEAAMMM@Z"(%class.St* %{{.+}}, float 2.230000e+02, float 1.100000e+01) float j1 = p2->x[223][11]; // CHECK: [[J1:%.+]] = load float, float* % - // CHECK-NEXT: [[CALL:%.+]] = call float @"\01?PutX@?$St@M@@QEAAMMMM@Z"(%class.St* %{{.+}}, float 2.300000e+01, float 1.000000e+00, float [[J1]]) + // CHECK-NEXT: [[CALL:%.+]] = call float @"?PutX@?$St@M@@QEAAMMMM@Z"(%class.St* %{{.+}}, float 2.300000e+01, float 1.000000e+00, float [[J1]]) // CHECK-NEXT: [[CONV:%.+]] = fptosi float [[CALL]] to i32 // CHECK-NEXT: store i32 [[CONV]], i32* argc = p2->x[23][1] = j1; - // CHECK: [[IDX:%.+]] = call i32 @"\01?idx@@YAHXZ"() + // CHECK: [[IDX:%.+]] = call i32 @"?idx@@YAHXZ"() // CHECK-NEXT: [[CONV:%.+]] = sitofp i32 [[IDX]] to float - // CHECK-NEXT: [[GET:%.+]] = call float @"\01?GetX@?$St@M@@QEAAMMM@Z"(%class.St* %{{.+}}, float [[CONV]], float 1.000000e+00) + // CHECK-NEXT: [[GET:%.+]] = call float @"?GetX@?$St@M@@QEAAMMM@Z"(%class.St* %{{.+}}, float [[CONV]], float 1.000000e+00) // CHECK-NEXT: [[INC:%.+]] = fadd float [[GET]], 1.000000e+00 // CHECK-NEXT: [[CONV:%.+]] = sitofp i32 [[IDX]] to float - // CHECK-NEXT: call float @"\01?PutX@?$St@M@@QEAAMMMM@Z"(%class.St* %{{.+}}, float [[CONV]], float 1.000000e+00, float [[INC]]) + // CHECK-NEXT: call float @"?PutX@?$St@M@@QEAAMMMM@Z"(%class.St* %{{.+}}, float [[CONV]], float 1.000000e+00, float [[INC]]) ++p2->x[idx()][1]; - // CHECK: call void @"\01??$foo@H@@YAXHH@Z"(i32 %{{.+}}, i32 %{{.+}}) + // CHECK: call void @"??$foo@H@@YAXHH@Z"(i32 %{{.+}}, i32 %{{.+}}) foo(argc, (int)argv[0][0]); // CHECK: [[P2:%.+]] = load %class.St*, %class.St** % - // CHECK: [[T_X:%.+]] = call i32 @"\01?get_x@Test1@@QEBAHXZ"(%class.Test1* %{{.+}}) // CHECK: [[P1:%.+]] = load %class.S*, %class.S** % - // CHECK: [[P1_X_22_33:%.+]] = call i32 @"\01?GetX@S@@QEAAHHH@Z"(%class.S* [[P1]], i32 22, i32 33) + // CHECK: [[P1_X_22_33:%.+]] = call i32 @"?GetX@S@@QEAAHHH@Z"(%class.S* [[P1]], i32 22, i32 33) // CHECK: [[CAST:%.+]] = sitofp i32 [[P1_X_22_33]] to double // CHECK: [[ARGC:%.+]] = load i32, i32* % + // CHECK: [[T_X:%.+]] = call i32 @"?get_x@Test1@@QEBAHXZ"(%class.Test1* %{{.+}}) // CHECK: [[CAST2:%.+]] = trunc i32 [[T_X]] to i8 - // CHECK: call void @"\01?PutY@?$St@M@@QEAAXDHN@Z"(%class.St* [[P2]], i8 [[CAST2]], i32 [[ARGC]], double [[CAST]]) + // CHECK: call void @"?PutY@?$St@M@@QEAAXDHN@Z"(%class.St* [[P2]], i8 [[CAST2]], i32 [[ARGC]], double [[CAST]]) p2->y[t.X][argc] = p1->x[22][33]; // CHECK: [[P2_1:%.+]] = load %class.St*, %class.St** // CHECK: [[P2_2:%.+]] = load %class.St*, %class.St** // CHECK: [[P1:%.+]] = load %class.S*, %class.S** // CHECK: [[ARGC:%.+]] = load i32, i32* % - // CHECK: [[P1_X_ARGC_0:%.+]] = call i32 @"\01?GetX@S@@QEAAHHH@Z"(%class.S* [[P1]], i32 [[ARGC]], i32 0) + // CHECK: [[P1_X_ARGC_0:%.+]] = call i32 @"?GetX@S@@QEAAHHH@Z"(%class.S* [[P1]], i32 [[ARGC]], i32 0) // CHECK: [[CAST:%.+]] = trunc i32 [[P1_X_ARGC_0]] to i8 - // CHECK: [[P2_Y_p1_X_ARGC_0_T:%.+]] = call i8 @"\01?GetY@?$St@M@@QEAADDVTest1@@@Z"(%class.St* [[P2_2]], i8 [[CAST]], %class.Test1* %{{.+}}) + // CHECK: [[P2_Y_p1_X_ARGC_0_T:%.+]] = call i8 @"?GetY@?$St@M@@QEAADDVTest1@@@Z"(%class.St* [[P2_2]], i8 [[CAST]], %class.Test1* %{{.+}}) // CHECK: [[CAST:%.+]] = sitofp i8 [[P2_Y_p1_X_ARGC_0_T]] to float // CHECK: [[J:%.+]] = load i32, i32* % // CHECK: [[CAST1:%.+]] = sitofp i32 [[J]] to float // CHECK: [[J:%.+]] = load i32, i32* % // CHECK: [[CAST2:%.+]] = sitofp i32 [[J]] to float - // CHECK: call float @"\01?PutX@?$St@M@@QEAAMMMM@Z"(%class.St* [[P2_1]], float [[CAST2]], float [[CAST1]], float [[CAST]]) + // CHECK: call float @"?PutX@?$St@M@@QEAAMMMM@Z"(%class.St* [[P2_1]], float [[CAST2]], float [[CAST1]], float [[CAST]]) p2->x[j][j] = p2->y[p1->x[argc][0]][t]; - // CHECK: [[CALL:%.+]] = call %class.Test1* @"\01?GetTest1@Test1@@SAPEAV1@XZ"() - // CHECK-NEXT: call i32 @"\01?get_x@Test1@@QEBAHXZ"(%class.Test1* [[CALL]]) + // CHECK: [[CALL:%.+]] = call %class.Test1* @"?GetTest1@Test1@@SAPEAV1@XZ"() + // CHECK-NEXT: call i32 @"?get_x@Test1@@QEBAHXZ"(%class.Test1* [[CALL]]) return Test1::GetTest1()->X; } -// CHECK: define linkonce_odr void @"\01??$foo@H@@YAXHH@Z"(i32 %{{.+}}, i32 %{{.+}}) -// CHECK: call i32 @"\01?GetX@?$St@H@@QEAAHHH@Z"(%class.St{{.+}}* [[BAR:%.+]], i32 %{{.+}} i32 %{{.+}}) -// CHECK: call i32 @"\01?PutX@?$St@H@@QEAAHHHH@Z"(%class.St{{.+}}* [[BAR]], i32 %{{.+}}, i32 %{{.+}}, i32 %{{.+}}) -// CHECK: call i32 @"\01?GetX@?$St@H@@QEAAHHH@Z"(%class.St{{.+}}* [[BAR]], i32 %{{.+}} i32 %{{.+}}) -// CHECK: call void @"\01?PutY@?$St@H@@QEAAXDHN@Z"(%class.St{{.+}}* [[BAR]], i8 %{{.+}}, i32 %{{.+}}, double %{{.+}} -// CHECK: call i32 @"\01?GetX@?$St@H@@QEAAHHH@Z"(%class.St{{.+}}* [[BAR]], i32 %{{.+}} i32 %{{.+}}) -// CHECK: call i8 @"\01?GetY@?$St@H@@QEAADDVTest1@@@Z"(%class.St{{.+}}* [[BAR]], i8 %{{.+}}, %class.Test1* %{{.+}}) -// CHECK: call i32 @"\01?PutX@?$St@H@@QEAAHHHH@Z"(%class.St{{.+}}* [[BAR]], i32 %{{.+}}, i32 %{{.+}}, i32 %{{.+}}) +// CHECK: define linkonce_odr dso_local void @"??$foo@H@@YAXHH@Z"(i32 %{{.+}}, i32 %{{.+}}) +// CHECK: call i32 @"?GetX@?$St@H@@QEAAHHH@Z"(%class.St{{.+}}* [[BAR:%.+]], i32 %{{.+}} i32 %{{.+}}) +// CHECK: call i32 @"?PutX@?$St@H@@QEAAHHHH@Z"(%class.St{{.+}}* [[BAR]], i32 %{{.+}}, i32 %{{.+}}, i32 %{{.+}}) +// CHECK: call i32 @"?GetX@?$St@H@@QEAAHHH@Z"(%class.St{{.+}}* [[BAR]], i32 %{{.+}} i32 %{{.+}}) +// CHECK: call void @"?PutY@?$St@H@@QEAAXDHN@Z"(%class.St{{.+}}* [[BAR]], i8 %{{.+}}, i32 %{{.+}}, double %{{.+}} +// CHECK: call i32 @"?GetX@?$St@H@@QEAAHHH@Z"(%class.St{{.+}}* [[BAR]], i32 %{{.+}} i32 %{{.+}}) +// CHECK: call i8 @"?GetY@?$St@H@@QEAADDVTest1@@@Z"(%class.St{{.+}}* [[BAR]], i8 %{{.+}}, %class.Test1* %{{.+}}) +// CHECK: call i32 @"?PutX@?$St@H@@QEAAHHHH@Z"(%class.St{{.+}}* [[BAR]], i32 %{{.+}}, i32 %{{.+}}, i32 %{{.+}}) #endif //HEADER diff --git a/test/CodeGenCXX/ms-thread_local.cpp b/test/CodeGenCXX/ms-thread_local.cpp index dc7958d6eacf1..76eba52b1634c 100644 --- a/test/CodeGenCXX/ms-thread_local.cpp +++ b/test/CodeGenCXX/ms-thread_local.cpp @@ -5,18 +5,18 @@ struct A { ~A(); }; -// CHECK-DAG: $"\01??$a@X@@3UA@@A" = comdat any -// CHECK-DAG: @"\01??$a@X@@3UA@@A" = linkonce_odr thread_local global %struct.A zeroinitializer, comdat, align 1 -// CHECK-DAG: @"\01??__E?$a@X@@YAXXZ$initializer$" = internal constant void ()* @"\01??__E?$a@X@@YAXXZ", section ".CRT$XDU", comdat($"\01??$a@X@@3UA@@A") +// CHECK-DAG: $"??$a@X@@3UA@@A" = comdat any +// CHECK-DAG: @"??$a@X@@3UA@@A" = linkonce_odr dso_local thread_local global %struct.A zeroinitializer, comdat, align 1 +// CHECK-DAG: @"??__E?$a@X@@YAXXZ$initializer$" = internal constant void ()* @"??__E?$a@X@@YAXXZ", section ".CRT$XDU", comdat($"??$a@X@@3UA@@A") template <typename T> thread_local A a = A(); -// CHECK-DAG: @"\01?b@@3UA@@A" = thread_local global %struct.A zeroinitializer, align 1 +// CHECK-DAG: @"?b@@3UA@@A" = dso_local thread_local global %struct.A zeroinitializer, align 1 // CHECK-DAG: @"__tls_init$initializer$" = internal constant void ()* @__tls_init, section ".CRT$XDU" thread_local A b; // CHECK-LABEL: define internal void @__tls_init() -// CHECK: call void @"\01??__Eb@@YAXXZ" +// CHECK: call void @"??__Eb@@YAXXZ" thread_local A &c = b; thread_local A &d = c; diff --git a/test/CodeGenCXX/ms-thunks-unprototyped-return.cpp b/test/CodeGenCXX/ms-thunks-unprototyped-return.cpp new file mode 100644 index 0000000000000..ef39fd70607cd --- /dev/null +++ b/test/CodeGenCXX/ms-thunks-unprototyped-return.cpp @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -fno-rtti-data -triple x86_64-windows-msvc -emit-llvm-only %s -verify + +// Verify that we error out on this return adjusting thunk that we can't emit. + +struct Incomplete; + +struct A { + virtual A * clone(Incomplete p) = 0; +}; +struct B : virtual A { + // expected-error@+1 2 {{cannot compile this return-adjusting thunk with incomplete parameter type yet}} + B * clone(Incomplete p) override; +}; +struct C : B { int c; }; +C c; diff --git a/test/CodeGenCXX/ms-thunks-unprototyped.cpp b/test/CodeGenCXX/ms-thunks-unprototyped.cpp new file mode 100644 index 0000000000000..0a232b98518e1 --- /dev/null +++ b/test/CodeGenCXX/ms-thunks-unprototyped.cpp @@ -0,0 +1,73 @@ +// RUN: %clang_cc1 -fno-rtti-data -triple x86_64-windows-msvc -emit-llvm %s -o - | FileCheck %s + +// In this example, C does not override B::foo, but it needs to emit a thunk to +// adjust for the relative difference of position between A-in-B and A-in-C. + +struct Incomplete; +template <typename T> +struct DoNotInstantiate { + typename T::does_not_exist field; +}; +template <typename T> +struct InstantiateLater; + +struct A { + virtual void foo(Incomplete p) = 0; + virtual void bar(DoNotInstantiate<int> p) = 0; + virtual int baz(InstantiateLater<int> p) = 0; +}; +struct B : virtual A { + void foo(Incomplete p) override; + void bar(DoNotInstantiate<int> p) override; + inline int baz(InstantiateLater<int> p) override; +}; +struct C : B { int c; }; +C c; + +// Do the same thing, but with an incomplete return type. +struct B1 { virtual DoNotInstantiate<void> f() = 0; }; +struct B2 { virtual DoNotInstantiate<void> f() = 0; }; +struct S : B1, B2 { DoNotInstantiate<void> f() override; }; +S s; + +// CHECK: @"??_7S@@6BB2@@@" = linkonce_odr unnamed_addr constant +// CHECK-SAME: void (%struct.S*, ...)* @"?f@S@@W7EAA?AU?$DoNotInstantiate@X@@XZ" + +// CHECK: @"??_7C@@6B@" = linkonce_odr unnamed_addr constant +// CHECK-SAME: void (%struct.B*, ...)* @"?foo@B@@W7EAAXUIncomplete@@@Z" +// CHECK-SAME: void (%struct.B*, ...)* @"?bar@B@@W7EAAXU?$DoNotInstantiate@H@@@Z" +// CHECK-SAME: i32 (i8*, i32)* @"?baz@B@@W7EAAHU?$InstantiateLater@H@@@Z" + + +// CHECK-LABEL: define linkonce_odr dso_local void @"?f@S@@W7EAA?AU?$DoNotInstantiate@X@@XZ"(%struct.S* %this, ...) +// CHECK: %[[THIS_ADJ_i8:[^ ]*]] = getelementptr i8, i8* {{.*}}, i32 -8 +// CHECK: %[[THIS_ADJ:[^ ]*]] = bitcast i8* %[[THIS_ADJ_i8]] to %struct.S* +// CHECK: musttail call void (%struct.S*, ...) {{.*}}@"?f@S@@UEAA?AU?$DoNotInstantiate@X@@XZ" +// CHECK-SAME: (%struct.S* %[[THIS_ADJ]], ...) +// CHECK: ret void + +// The thunks should have a -8 adjustment. + +// CHECK-LABEL: define linkonce_odr dso_local void @"?foo@B@@W7EAAXUIncomplete@@@Z"(%struct.B* %this, ...) +// CHECK: %[[THIS_ADJ_i8:[^ ]*]] = getelementptr i8, i8* {{.*}}, i32 -8 +// CHECK: %[[THIS_ADJ:[^ ]*]] = bitcast i8* %[[THIS_ADJ_i8]] to %struct.B* +// CHECK: musttail call void (%struct.B*, ...) {{.*}}@"?foo@B@@UEAAXUIncomplete@@@Z" +// CHECK-SAME: (%struct.B* %[[THIS_ADJ]], ...) +// CHECK-NEXT: ret void + +// CHECK-LABEL: define linkonce_odr dso_local void @"?bar@B@@W7EAAXU?$DoNotInstantiate@H@@@Z"(%struct.B* %this, ...) +// CHECK: %[[THIS_ADJ_i8:[^ ]*]] = getelementptr i8, i8* {{.*}}, i32 -8 +// CHECK: %[[THIS_ADJ:[^ ]*]] = bitcast i8* %[[THIS_ADJ_i8]] to %struct.B* +// CHECK: musttail call void (%struct.B*, ...) {{.*}}@"?bar@B@@UEAAXU?$DoNotInstantiate@H@@@Z" +// CHECK-SAME: (%struct.B* %[[THIS_ADJ]], ...) +// CHECK-NEXT: ret void + +// If we complete the definition later, things work out. +template <typename T> struct InstantiateLater { T x; }; +inline int B::baz(InstantiateLater<int> p) { return p.x; } + +// CHECK-LABEL: define linkonce_odr dso_local i32 @"?baz@B@@W7EAAHU?$InstantiateLater@H@@@Z"(i8* %this.coerce, i32 %p.coerce) +// CHECK: = getelementptr i8, i8* {{.*}}, i32 -8 +// CHECK: tail call i32 @"?baz@B@@UEAAHU?$InstantiateLater@H@@@Z"(i8* {{[^,]*}}, i32 {{.*}}) + +// CHECK-LABEL: define linkonce_odr dso_local i32 @"?baz@B@@UEAAHU?$InstantiateLater@H@@@Z"(i8* %this.coerce, i32 %p.coerce) diff --git a/test/CodeGenCXX/ms_wide_predefined_expr.cpp b/test/CodeGenCXX/ms_wide_predefined_expr.cpp index 03c78d982f1cf..bdfd1cd650ba2 100644 --- a/test/CodeGenCXX/ms_wide_predefined_expr.cpp +++ b/test/CodeGenCXX/ms_wide_predefined_expr.cpp @@ -1,6 +1,6 @@ // RUN: %clang_cc1 %s -fms-extensions -triple i686-pc-win32 -emit-llvm -o - | FileCheck %s -// CHECK: @"\01??_C@_19DPFBEKIN@?$AAf?$AAu?$AAn?$AAc?$AA?$AA@" = linkonce_odr unnamed_addr constant [5 x i16] [i16 102, i16 117, i16 110, i16 99, i16 0], comdat, align 2 +// CHECK: @"??_C@_19DPFBEKIN@?$AAf?$AAu?$AAn?$AAc?$AA?$AA@" = linkonce_odr dso_local unnamed_addr constant [5 x i16] [i16 102, i16 117, i16 110, i16 99, i16 0], comdat, align 2 void wprint(const wchar_t*); diff --git a/test/CodeGenCXX/msabi-blocks.cpp b/test/CodeGenCXX/msabi-blocks.cpp index bee59d9ed5352..02d0958f635c0 100644 --- a/test/CodeGenCXX/msabi-blocks.cpp +++ b/test/CodeGenCXX/msabi-blocks.cpp @@ -7,25 +7,25 @@ void (^b)() = ^{ static int i = 0; }; -// CHECK-X86-DAG: @"\01?i@?1??_block_invoke@@YAXPAU__block_literal@@@Z@4HA" ={{.*}} global i32 0 -// CHECK-X64-DAG: @"\01?i@?1??_block_invoke@@YAXPEAU__block_literal@@@Z@4HA" ={{.*}} global i32 0 +// CHECK-X86-DAG: @"?i@?1??_block_invoke@@YAXPAU__block_literal@@@Z@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"?i@?1??_block_invoke@@YAXPEAU__block_literal@@@Z@4HA" ={{.*}} global i32 0 void f(void) { static int i = 0; ^{ static int i = e(); }(); -// CHECK-X86-DAG: @"\01?i@?1??_block_invoke_1@@YAXPAU__block_literal_1@@@Z?1??f@@YAXXZ@4HA" ={{.*}} global i32 0 -// CHECK-X64-DAG: @"\01?i@?1??_block_invoke_1@@YAXPEAU__block_literal_1@@@Z?1??f@@YAXXZ@4HA" ={{.*}} global i32 0 +// CHECK-X86-DAG: @"?i@?1??_block_invoke_1@@YAXPAU__block_literal_1@@@Z?1??f@@YAXXZ@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"?i@?1??_block_invoke_1@@YAXPEAU__block_literal_1@@@Z?1??f@@YAXXZ@4HA" ={{.*}} global i32 0 ^{ static int i = e(); }(); -// CHECK-X86-DAG: @"\01?i@?1??_block_invoke_2@@YAXPAU__block_literal_2@@@Z?1??f@@YAXXZ@4HA" ={{.*}} global i32 0 -// CHECK-X64-DAG: @"\01?i@?1??_block_invoke_2@@YAXPEAU__block_literal_2@@@Z?1??f@@YAXXZ@4HA" ={{.*}} global i32 0 +// CHECK-X86-DAG: @"?i@?1??_block_invoke_2@@YAXPAU__block_literal_2@@@Z?1??f@@YAXXZ@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"?i@?1??_block_invoke_2@@YAXPEAU__block_literal_2@@@Z?1??f@@YAXXZ@4HA" ={{.*}} global i32 0 ^{ ^{ static int i = e(); }(); }(); -// CHECK-X86-DAG: @"\01?i@?1??_block_invoke_3@@YAXPAU__block_literal_3@@@Z?1??_block_invoke_4@@YAXPAU__block_literal_4@@@Z?1??f@@YAXXZ@4HA" ={{.*}} global i32 0 -// CHECK-X64-DAG: @"\01?i@?1??_block_invoke_3@@YAXPEAU__block_literal_3@@@Z?1??_block_invoke_4@@YAXPEAU__block_literal_4@@@Z?1??f@@YAXXZ@4HA" ={{.*}} global i32 0 +// CHECK-X86-DAG: @"?i@?1??_block_invoke_3@@YAXPAU__block_literal_3@@@Z?1??_block_invoke_4@@YAXPAU__block_literal_4@@@Z?1??f@@YAXXZ@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"?i@?1??_block_invoke_3@@YAXPEAU__block_literal_3@@@Z?1??_block_invoke_4@@YAXPEAU__block_literal_4@@@Z?1??f@@YAXXZ@4HA" ={{.*}} global i32 0 } @@ -36,47 +36,47 @@ void g(void) { template void g<char>(void); -// CHECK-X86-DAG: @"\01?i@?2??_block_invoke_1@@YAXPAU__block_literal_1@@@Z?2???$g@D@@YAXXZ@4HA" ={{.*}} global i32 0 -// CHECK-X64-DAG: @"\01?i@?2??_block_invoke_1@@YAXPEAU__block_literal_1@@@Z?2???$g@D@@YAXXZ@4HA" ={{.*}} global i32 0 +// CHECK-X86-DAG: @"?i@?2??_block_invoke_1@@YAXPAU__block_literal_1@@@Z?2???$g@D@@YAXXZ@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"?i@?2??_block_invoke_1@@YAXPEAU__block_literal_1@@@Z?2???$g@D@@YAXXZ@4HA" ={{.*}} global i32 0 template void g<int>(void); -// CHECK-X86-DAG: @"\01?i@?2??_block_invoke_1@@YAXPAU__block_literal_1@@@Z?2???$g@H@@YAXXZ@4HA" ={{.*}} global i32 0 -// CHECK-X64-DAG: @"\01?i@?2??_block_invoke_1@@YAXPEAU__block_literal_1@@@Z?2???$g@H@@YAXXZ@4HA" ={{.*}} global i32 0 +// CHECK-X86-DAG: @"?i@?2??_block_invoke_1@@YAXPAU__block_literal_1@@@Z?2???$g@H@@YAXXZ@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"?i@?2??_block_invoke_1@@YAXPEAU__block_literal_1@@@Z?2???$g@H@@YAXXZ@4HA" ={{.*}} global i32 0 inline void h(void) { ^{ static int i = e(); }(); } -// CHECK-X86-DAG: @"\01?i@?2??_block_invoke_1@@YAXPAU__block_literal_1@@@Z?2??h@@YAXXZ@4HA" ={{.*}} global i32 0 -// CHECK-X64-DAG: @"\01?i@?2??_block_invoke_1@@YAXPEAU__block_literal_1@@@Z?2??h@@YAXXZ@4HA" ={{.*}} global i32 0 +// CHECK-X86-DAG: @"?i@?2??_block_invoke_1@@YAXPAU__block_literal_1@@@Z?2??h@@YAXXZ@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"?i@?2??_block_invoke_1@@YAXPEAU__block_literal_1@@@Z?2??h@@YAXXZ@4HA" ={{.*}} global i32 0 struct s { int i = ^{ static int i = e(); return ++i; }(); -// CHECK-X86-DAG: @"\01?i@?0??_block_invoke_1@0s@@YAXPAU__block_literal_1@@@Z@4HA" ={{.*}} global i32 0 -// CHECK-X64-DAG: @"\01?i@?0??_block_invoke_1@0s@@YAXPEAU__block_literal_1@@@Z@4HA" ={{.*}} global i32 0 +// CHECK-X86-DAG: @"?i@?0??_block_invoke_1@0s@@YAXPAU__block_literal_1@@@Z@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"?i@?0??_block_invoke_1@0s@@YAXPEAU__block_literal_1@@@Z@4HA" ={{.*}} global i32 0 int j = ^{ static int i = e(); return ++i; }(); -// CHECK-X86-DAG: @"\01?i@?0??_block_invoke_1@j@s@@YAXPAU__block_literal_1@@@Z@4HA" ={{.*}} global i32 0 -// CHECK-X64-DAG: @"\01?i@?0??_block_invoke_1@j@s@@YAXPEAU__block_literal_1@@@Z@4HA" ={{.*}} global i32 0 +// CHECK-X86-DAG: @"?i@?0??_block_invoke_1@j@s@@YAXPAU__block_literal_1@@@Z@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"?i@?0??_block_invoke_1@j@s@@YAXPEAU__block_literal_1@@@Z@4HA" ={{.*}} global i32 0 void m(int i = ^{ static int i = e(); return ++i; }(), int j = ^{ static int i = e(); return ++i; }()) {} -// CHECK-X86-DAG: @"\01?i@?0??_block_invoke_1_1@@YAXPAU__block_literal_1_1@@@Z?0??m@s@@QAEXHH@Z@4HA" ={{.*}} global i32 0 -// CHECK-X86-DAG: @"\01?i@?0??_block_invoke_1_2@@YAXPAU__block_literal_1_2@@@Z?0??m@s@@QAEXHH@Z@4HA" ={{.*}} global i32 0 -// CHECK-X64-DAG: @"\01?i@?0??_block_invoke_1_1@@YAXPEAU__block_literal_1_1@@@Z?0??m@s@@QEAAXHH@Z@4HA" ={{.*}} global i32 0 -// CHECK-X64-DAG: @"\01?i@?0??_block_invoke_1_2@@YAXPEAU__block_literal_1_2@@@Z?0??m@s@@QEAAXHH@Z@4HA" ={{.*}} global i32 0 +// CHECK-X86-DAG: @"?i@?0??_block_invoke_1_1@@YAXPAU__block_literal_1_1@@@Z?0??m@s@@QAEXHH@Z@4HA" ={{.*}} global i32 0 +// CHECK-X86-DAG: @"?i@?0??_block_invoke_1_2@@YAXPAU__block_literal_1_2@@@Z?0??m@s@@QAEXHH@Z@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"?i@?0??_block_invoke_1_1@@YAXPEAU__block_literal_1_1@@@Z?0??m@s@@QEAAXHH@Z@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"?i@?0??_block_invoke_1_2@@YAXPEAU__block_literal_1_2@@@Z?0??m@s@@QEAAXHH@Z@4HA" ={{.*}} global i32 0 void n(int = ^{ static int i = e(); return ++i; }(), int = ^{ static int i = e(); return ++i; }()) {} -// CHECK-X86-DAG: @"\01?i@?0??_block_invoke_1_1@@YAXPAU__block_literal_1_1@@@Z?0??n@s@@QAEXHH@Z@4HA" ={{.*}} global i32 0 -// CHECK-X86-DAG: @"\01?i@?0??_block_invoke_1_2@@YAXPAU__block_literal_1_2@@@Z?0??n@s@@QAEXHH@Z@4HA" ={{.*}} global i32 0 -// CHECK-X64-DAG: @"\01?i@?0??_block_invoke_1_1@@YAXPEAU__block_literal_1_1@@@Z?0??n@s@@QEAAXHH@Z@4HA" ={{.*}} global i32 0 -// CHECK-X64-DAG: @"\01?i@?0??_block_invoke_1_2@@YAXPEAU__block_literal_1_2@@@Z?0??n@s@@QEAAXHH@Z@4HA" ={{.*}} global i32 0 +// CHECK-X86-DAG: @"?i@?0??_block_invoke_1_1@@YAXPAU__block_literal_1_1@@@Z?0??n@s@@QAEXHH@Z@4HA" ={{.*}} global i32 0 +// CHECK-X86-DAG: @"?i@?0??_block_invoke_1_2@@YAXPAU__block_literal_1_2@@@Z?0??n@s@@QAEXHH@Z@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"?i@?0??_block_invoke_1_1@@YAXPEAU__block_literal_1_1@@@Z?0??n@s@@QEAAXHH@Z@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"?i@?0??_block_invoke_1_2@@YAXPEAU__block_literal_1_2@@@Z?0??n@s@@QEAAXHH@Z@4HA" ={{.*}} global i32 0 }; @@ -84,8 +84,8 @@ struct t { struct u { int i = ^{ static int i = e(); return ++i; }(); -// CHECK-X86-DAG: @"\01?i@?0??_block_invoke_1@0u@t@@YAXPAU__block_literal_1@@@Z@4HA" ={{.*}} global i32 0 -// CHECK-X64-DAG: @"\01?i@?0??_block_invoke_1@0u@t@@YAXPEAU__block_literal_1@@@Z@4HA" ={{.*}} global i32 0 +// CHECK-X86-DAG: @"?i@?0??_block_invoke_1@0u@t@@YAXPAU__block_literal_1@@@Z@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"?i@?0??_block_invoke_1@0u@t@@YAXPEAU__block_literal_1@@@Z@4HA" ={{.*}} global i32 0 }; }; diff --git a/test/CodeGenCXX/msabi-swiftcall-cc.cpp b/test/CodeGenCXX/msabi-swiftcall-cc.cpp new file mode 100644 index 0000000000000..d8205ed192a57 --- /dev/null +++ b/test/CodeGenCXX/msabi-swiftcall-cc.cpp @@ -0,0 +1,67 @@ +// RUN: %clang_cc1 -triple i686-unknown-windows-msvc -fdeclspec -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -fdeclspec -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-64 + +void __attribute__((__swiftcall__)) f() {} +// CHECK-DAG: @"?f@@YSXXZ" +// CHECK-64-DAG: @"?f@@YSXXZ" + +void (__attribute__((__swiftcall__)) *p)(); +// CHECK-DAG: @"?p@@3P6SXXZA" +// CHECK-64-DAG: @"?p@@3P6SXXZEA + +namespace { +void __attribute__((__swiftcall__)) __attribute__((__used__)) f() { } +} +// CHECK-DAG: @"?f@?A@@YSXXZ" +// CHECK-64-DAG: @"?f@?A@@YSXXZ" + +namespace n { +void __attribute__((__swiftcall__)) f() {} +} +// CHECK-DAG: @"?f@n@@YSXXZ" +// CHECK-64-DAG: @"?f@n@@YSXXZ" + +struct __declspec(dllexport) S { + S(const S &) = delete; + S & operator=(const S &) = delete; + void __attribute__((__swiftcall__)) m() { } +}; +// CHECK-DAG: @"?m@S@@QASXXZ" +// CHECK-64-DAG: @"?m@S@@QEASXXZ" + +void f(void (__attribute__((__swiftcall__))())) {} +// CHECK-DAG: @"?f@@YAXP6SXXZ@Z" +// CHECK-64-DAG: @"?f@@YAXP6SXXZ@Z" + +void __attribute__((__preserve_most__)) g() {} +// CHECK-DAG: @"?g@@YUXXZ" +// CHECK-64-DAG: @"?g@@YUXXZ" + +void (__attribute__((__preserve_most__)) *q)(); +// CHECK-DAG: @"?q@@3P6UXXZA" +// CHECK-64-DAG: @"?q@@3P6UXXZEA" + +namespace { +void __attribute__((__preserve_most__)) __attribute__((__used__)) g() {} +} +// CHECK-DAG: @"?g@?A@@YUXXZ" +// CHECK-64-DAG: @"?g@?A@@YUXXZ" + +namespace n { +void __attribute__((__preserve_most__)) g() {} +} +// CHECK-DAG: @"?g@n@@YUXXZ" +// CHECK-64-DAG: @"?g@n@@YUXXZ" + +struct __declspec(dllexport) T { + T(const T &) = delete; + T & operator=(const T &) = delete; + void __attribute__((__preserve_most__)) m() {} +}; +// CHECK-DAG: @"?m@T@@QAUXXZ" +// CHECK-64-DAG: @"?m@T@@QEAUXXZ" + +void g(void (__attribute__((__preserve_most__))())) {} +// CHECK-DAG: @"?g@@YAXP6UXXZ@Z" +// CHECK-64-DAG: @"?g@@YAXP6UXXZ@Z" + diff --git a/test/CodeGenCXX/naked.cpp b/test/CodeGenCXX/naked.cpp index 34f22b3636b5e..c6fe1330cbfd7 100644 --- a/test/CodeGenCXX/naked.cpp +++ b/test/CodeGenCXX/naked.cpp @@ -7,7 +7,7 @@ public: }; __attribute__((naked)) void TestNaked::NakedFunction() { - // CHECK-LABEL: define {{(x86_thiscallcc )?}}void @ + // CHECK-LABEL: define {{(dso_local )?}}{{(x86_thiscallcc )?}}void @ // CHECK: call void asm sideeffect asm(""); } diff --git a/test/CodeGenCXX/new-array-init.cpp b/test/CodeGenCXX/new-array-init.cpp index ccc218e2b2dcf..90cd600229b59 100644 --- a/test/CodeGenCXX/new-array-init.cpp +++ b/test/CodeGenCXX/new-array-init.cpp @@ -50,10 +50,10 @@ void string_nonconst(int n) { // FIXME: Conditionally throw an exception rather than passing -1 to alloc function // CHECK: select // CHECK: %[[PTR:.*]] = call i8* @_Zna{{.}}(i{{32|64}} - // CHECK: call void @llvm.memcpy{{.*}}(i8* %[[PTR]], i8* getelementptr inbounds ([4 x i8], [4 x i8]* @[[ABC4]], i32 0, i32 0), i32 4, + // CHECK: call void @llvm.memcpy{{.*}}(i8* align {{[0-9]+}} %[[PTR]], i8* align {{[0-9]+}} getelementptr inbounds ([4 x i8], [4 x i8]* @[[ABC4]], i32 0, i32 0), i32 4, // CHECK: %[[REST:.*]] = getelementptr inbounds i8, i8* %[[PTR]], i32 4 // CHECK: %[[RESTSIZE:.*]] = sub {{.*}}, 4 - // CHECK: call void @llvm.memset{{.*}}(i8* %[[REST]], i8 0, i{{32|64}} %[[RESTSIZE]], + // CHECK: call void @llvm.memset{{.*}}(i8* align {{[0-9]+}} %[[REST]], i8 0, i{{32|64}} %[[RESTSIZE]], new char[n] { "abc" }; } @@ -61,7 +61,7 @@ void string_nonconst(int n) { void string_exact() { // CHECK-NOT: icmp // CHECK: %[[PTR:.*]] = call i8* @_Zna{{.}}(i{{32|64}} 4) - // CHECK: call void @llvm.memcpy{{.*}}(i8* %[[PTR]], i8* getelementptr inbounds ([4 x i8], [4 x i8]* @[[ABC4]], i32 0, i32 0), i32 4, + // CHECK: call void @llvm.memcpy{{.*}}(i8* align {{[0-9]+}} %[[PTR]], i8* align {{[0-9]+}} getelementptr inbounds ([4 x i8], [4 x i8]* @[[ABC4]], i32 0, i32 0), i32 4, // CHECK-NOT: memset new char[4] { "abc" }; } @@ -71,7 +71,7 @@ void string_sufficient() { // CHECK-NOT: icmp // CHECK: %[[PTR:.*]] = call i8* @_Zna{{.}}(i{{32|64}} 15) // FIXME: For very large arrays, it would be preferable to emit a small copy and a memset. - // CHECK: call void @llvm.memcpy{{.*}}(i8* %[[PTR]], i8* getelementptr inbounds ([15 x i8], [15 x i8]* @[[ABC15]], i32 0, i32 0), i32 15, + // CHECK: call void @llvm.memcpy{{.*}}(i8* align {{[0-9]+}} %[[PTR]], i8* align {{[0-9]+}} getelementptr inbounds ([15 x i8], [15 x i8]* @[[ABC15]], i32 0, i32 0), i32 15, // CHECK-NOT: memset new char[15] { "abc" }; } @@ -113,7 +113,7 @@ void aggr_sufficient(int n) { // CHECK: %[[PTR2:.*]] = getelementptr inbounds %[[AGGR]], %[[AGGR]]* %[[PTR1]], i32 1{{$}} // CHECK: %[[REMAIN:.*]] = sub i32 {{.*}}, 16 // CHECK: %[[MEM:.*]] = bitcast %[[AGGR]]* %[[PTR2]] to i8* - // CHECK: call void @llvm.memset{{.*}}(i8* %[[MEM]], i8 0, i32 %[[REMAIN]], + // CHECK: call void @llvm.memset{{.*}}(i8* align {{[0-9]+}} %[[MEM]], i8 0, i32 %[[REMAIN]], struct Aggr { int a, b; }; new Aggr[n] { 1, 2, 3 }; } diff --git a/test/CodeGenCXX/no-opt-volatile-memcpy.cpp b/test/CodeGenCXX/no-opt-volatile-memcpy.cpp index a061daaf26360..a51421cdb3df7 100644 --- a/test/CodeGenCXX/no-opt-volatile-memcpy.cpp +++ b/test/CodeGenCXX/no-opt-volatile-memcpy.cpp @@ -18,10 +18,10 @@ void foo (void) { // CHECK: %[[LS:.*]] = alloca %struct.s, align 4 // CHECK-NEXT: %[[ZERO:.*]] = bitcast %struct.s* %[[LS]] to i8* // CHECK-NEXT: %[[ONE:.*]] = bitcast %struct.s* %[[LS]] to i8* -// CHECK-NEXT: call void @llvm.memcpy.{{.*}}(i8* %[[ZERO]], i8* %[[ONE]], i64 132, i32 4, i1 true) -// CHECK-NEXT: call void @llvm.memcpy.{{.*}}(i8* getelementptr inbounds (%struct.s, %struct.s* @gs, i32 0, i32 0, i32 0), i8* getelementptr inbounds (%struct.s, %struct.s* @gs, i32 0, i32 0, i32 0), i64 132, i32 4, i1 true) +// CHECK-NEXT: call void @llvm.memcpy.{{.*}}(i8* align 4 %[[ZERO]], i8* align 4 %[[ONE]], i64 132, i1 true) +// CHECK-NEXT: call void @llvm.memcpy.{{.*}}(i8* align 4 getelementptr inbounds (%struct.s, %struct.s* @gs, i32 0, i32 0, i32 0), i8* align 4 getelementptr inbounds (%struct.s, %struct.s* @gs, i32 0, i32 0, i32 0), i64 132, i1 true) // CHECK-NEXT: %[[TWO:.*]] = bitcast %struct.s* %[[LS]] to i8* -// CHECK-NEXT: call void @llvm.memcpy.{{.*}}(i8* %[[TWO]], i8* getelementptr inbounds (%struct.s, %struct.s* @gs, i32 0, i32 0, i32 0), i64 132, i32 4, i1 true) +// CHECK-NEXT: call void @llvm.memcpy.{{.*}}(i8* align 4 %[[TWO]], i8* align 4 getelementptr inbounds (%struct.s, %struct.s* @gs, i32 0, i32 0, i32 0), i64 132, i1 true) struct s1 { @@ -35,8 +35,8 @@ void fee (void) { s.y = gs; } // CHECK-LABEL: define void @_Z3feev() -// CHECK: call void @llvm.memcpy.{{.*}}(i8* getelementptr inbounds (%struct.s1, %struct.s1* @s, i32 0, i32 0, i32 0, i32 0), i8* getelementptr inbounds (%struct.s1, %struct.s1* @s, i32 0, i32 0, i32 0, i32 0), i64 132, i32 4, i1 true) -// CHECK-NEXT: call void @llvm.memcpy.{{.*}}(i8* getelementptr inbounds (%struct.s1, %struct.s1* @s, i32 0, i32 0, i32 0, i32 0), i8* getelementptr inbounds (%struct.s, %struct.s* @gs, i32 0, i32 0, i32 0), i64 132, i32 4, i1 true) +// CHECK: call void @llvm.memcpy.{{.*}}(i8* align 4 getelementptr inbounds (%struct.s1, %struct.s1* @s, i32 0, i32 0, i32 0, i32 0), i8* align 4 getelementptr inbounds (%struct.s1, %struct.s1* @s, i32 0, i32 0, i32 0, i32 0), i64 132, i1 true) +// CHECK-NEXT: call void @llvm.memcpy.{{.*}}(i8* align 4 getelementptr inbounds (%struct.s1, %struct.s1* @s, i32 0, i32 0, i32 0, i32 0), i8* align 4 getelementptr inbounds (%struct.s, %struct.s* @gs, i32 0, i32 0, i32 0), i64 132, i1 true) struct d : s1 { }; @@ -47,4 +47,4 @@ void gorf(void) { gd = gd; } // CHECK-LABEL: define void @_Z4gorfv() -// CHECK: call void @llvm.memcpy.{{.*}}(i8* getelementptr inbounds (%struct.d, %struct.d* @gd, i32 0, i32 0, i32 0, i32 0, i32 0), i8* getelementptr inbounds (%struct.d, %struct.d* @gd, i32 0, i32 0, i32 0, i32 0, i32 0), i64 132, i32 4, i1 true) +// CHECK: call void @llvm.memcpy.{{.*}}(i8* align 4 getelementptr inbounds (%struct.d, %struct.d* @gd, i32 0, i32 0, i32 0, i32 0, i32 0), i8* align 4 getelementptr inbounds (%struct.d, %struct.d* @gd, i32 0, i32 0, i32 0, i32 0, i32 0), i64 132, i1 true) diff --git a/test/CodeGenCXX/optnone-pragma-optimize-off.cpp b/test/CodeGenCXX/optnone-pragma-optimize-off.cpp new file mode 100644 index 0000000000000..d750c4c2848cb --- /dev/null +++ b/test/CodeGenCXX/optnone-pragma-optimize-off.cpp @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 %s -triple %itanium_abi_triple -O1 -disable-llvm-passes -emit-llvm -o - | FileCheck %s + +// Test the attributes for the lambda function contains 'optnone' as result of +// the _Pragma("clang optimize off"). + +_Pragma("clang optimize off") + +void foo(int p) { + auto lambda = [&p]() { ++p; }; + lambda(); + // CHECK: define {{.*}} @"_ZZ3fooiENK3$_0clEv"({{.*}}) #[[LAMBDA_ATR:[0-9]+]] +} + +_Pragma("clang optimize on") + +// CHECK: attributes #[[LAMBDA_ATR]] = { {{.*}} optnone {{.*}} }
\ No newline at end of file diff --git a/test/CodeGenCXX/override-bit-field-layout.cpp b/test/CodeGenCXX/override-bit-field-layout.cpp new file mode 100644 index 0000000000000..e84fcb0f450d6 --- /dev/null +++ b/test/CodeGenCXX/override-bit-field-layout.cpp @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -w -fdump-record-layouts-simple -foverride-record-layout=%S/Inputs/override-bit-field-layout.layout %s | FileCheck %s + +// CHECK: Type: struct S1 +// CHECK: FieldOffsets: [0, 11] +struct S1 { + short a : 3; + short b : 5; +}; + +// CHECK: Type: struct S2 +// CHECK: FieldOffsets: [64] +struct S2 { + virtual ~S2() = default; + short a : 3; +}; + +void use_structs() { + S1 s1s[sizeof(S1)]; + S2 s2s[sizeof(S2)]; +} diff --git a/test/CodeGenCXX/personality.cpp b/test/CodeGenCXX/personality.cpp new file mode 100644 index 0000000000000..ce4bad370d91c --- /dev/null +++ b/test/CodeGenCXX/personality.cpp @@ -0,0 +1,42 @@ +// RUN: %clang_cc1 -triple i686-unknown-linux-gnu -fexceptions -fcxx-exceptions -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-GNU +// RUN: %clang_cc1 -triple i686-unknown-linux-gnu -fexceptions -fdwarf-exceptions -fcxx-exceptions -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-GNU-DWARF +// RUN: %clang_cc1 -triple i686-unknown-linux-gnu -fexceptions -fseh-exceptions -fcxx-exceptions -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-GNU-SEH +// RUN: %clang_cc1 -triple i686-unknown-linux-gnu -fexceptions -fsjlj-exceptions -fcxx-exceptions -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-GNU-SJLJ + +// RUN: %clang_cc1 -triple i686-unknown-windows-msvc -fexceptions -fcxx-exceptions -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-WIN +// RUN: %clang_cc1 -triple i686-unknown-windows-msvc -D __SEH_EXCEPTIONS__ -fms-extensions -fexceptions -fcxx-exceptions -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-WIN-SEH-X86 +// RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -D __SEH_EXCEPTIONS__ -fms-extensions -fexceptions -fcxx-exceptions -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-WIN-SEH-X64 + +// RUN: %clang_cc1 -triple i686-unknown-windows-gnu -fexceptions -fcxx-exceptions -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-GNU +// RUN: %clang_cc1 -triple i686-unknown-windows-gnu -fexceptions -fdwarf-exceptions -fcxx-exceptions -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-GNU-DWARF +// RUN: %clang_cc1 -triple i686-unknown-windows-gnu -fexceptions -fseh-exceptions -fcxx-exceptions -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-GNU-SEH +// RUN: %clang_cc1 -triple i686-unknown-windows-gnu -fexceptions -fsjlj-exceptions -fcxx-exceptions -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-GNU-SJLJ + +extern void g(); + +// CHECK-GNU: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) +// CHECK-GNU-DWARF: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) +// CHECK-GNU-SEH: personality i8* bitcast (i32 (...)* @__gxx_personality_seh0 to i8*) +// CHECK-GNU-SJLJ: personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + +// CHECK-WIN: personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + +void f() { + try { + g(); + } catch (...) { + } +} + +#if defined(__SEH_EXCEPTIONS__) +// CHECK-WIN-SEH-X86: personality i8* bitcast (i32 (...)* @_except_handler3 to i8*) +// CHECK-WIN-SEH-X64: personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) + +void h(void) { + __try { + g(); + } __finally { + } +} +#endif + diff --git a/test/CodeGenCXX/pod-member-memcpys.cpp b/test/CodeGenCXX/pod-member-memcpys.cpp index 97d203fde2e01..9facb8ad507c7 100644 --- a/test/CodeGenCXX/pod-member-memcpys.cpp +++ b/test/CodeGenCXX/pod-member-memcpys.cpp @@ -116,59 +116,59 @@ CALL_AO(PackedMembers) // Basic copy-assignment: // CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.Basic* @_ZN5BasicaSERKS_(%struct.Basic* %this, %struct.Basic* dereferenceable({{[0-9]+}})) -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}}) // CHECK: call dereferenceable({{[0-9]+}}) %struct.NonPOD* @_ZN6NonPODaSERKS_ -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}}) // CHECK: ret %struct.Basic* // PODMember copy-assignment: // CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.PODMember* @_ZN9PODMemberaSERKS_(%struct.PODMember* %this, %struct.PODMember* dereferenceable({{[0-9]+}})) -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 32, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 32, i1 {{.*}}) // CHECK: call dereferenceable({{[0-9]+}}) %struct.NonPOD* @_ZN6NonPODaSERKS_ -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}}) // CHECK: ret %struct.PODMember* // PODLikeMember copy-assignment: // CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.PODLikeMember* @_ZN13PODLikeMemberaSERKS_(%struct.PODLikeMember* %this, %struct.PODLikeMember* dereferenceable({{[0-9]+}})) -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 32, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 32, i1 {{.*}}) // CHECK: call dereferenceable({{[0-9]+}}) %struct.NonPOD* @_ZN6NonPODaSERKS_ -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}}) // CHECK: ret %struct.PODLikeMember* // ArrayMember copy-assignment: // CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.ArrayMember* @_ZN11ArrayMemberaSERKS_(%struct.ArrayMember* %this, %struct.ArrayMember* dereferenceable({{[0-9]+}})) -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 64, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 64, i1 {{.*}}) // CHECK: call dereferenceable({{[0-9]+}}) %struct.NonPOD* @_ZN6NonPODaSERKS_ -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 64, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 64, i1 {{.*}}) // CHECK: ret %struct.ArrayMember* // VolatileMember copy-assignment: // CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.VolatileMember* @_ZN14VolatileMemberaSERKS_(%struct.VolatileMember* %this, %struct.VolatileMember* dereferenceable({{[0-9]+}})) -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}}) // CHECK: load volatile i32, i32* {{.*}}, align 4 // CHECK: store volatile i32 {{.*}}, align 4 // CHECK: call dereferenceable({{[0-9]+}}) %struct.NonPOD* @_ZN6NonPODaSERKS_ -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}}) // CHECK: ret %struct.VolatileMember* // BitfieldMember copy-assignment: // CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.BitfieldMember* @_ZN14BitfieldMemberaSERKS_(%struct.BitfieldMember* %this, %struct.BitfieldMember* dereferenceable({{[0-9]+}})) -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}}) // CHECK: call dereferenceable({{[0-9]+}}) %struct.NonPOD* @_ZN6NonPODaSERKS_ -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 3, i32 1{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 1 {{.*}} align 1 {{.*}}i64 3, i1 {{.*}}) // CHECK: ret %struct.BitfieldMember* // InnerClass copy-assignment: // CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.InnerClassMember* @_ZN16InnerClassMemberaSERKS_(%struct.InnerClassMember* %this, %struct.InnerClassMember* dereferenceable({{[0-9]+}})) -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 32, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 32, i1 {{.*}}) // CHECK: call dereferenceable({{[0-9]+}}) %struct.NonPOD* @_ZN6NonPODaSERKS_ -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}}) // CHECK: ret %struct.InnerClassMember* // PackedMembers copy-assignment: // CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.PackedMembers* @_ZN13PackedMembersaSERKS_(%struct.PackedMembers* %this, %struct.PackedMembers* dereferenceable({{[0-9]+}})) // CHECK: call dereferenceable({{[0-9]+}}) %struct.NonPOD* @_ZN6NonPODaSERKS_ -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 1{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 1 {{.*}} align 1 {{.*}}i64 16, i1 {{.*}}) // CHECK: ret %struct.PackedMembers* // COPY-CONSTRUCTORS: @@ -183,70 +183,70 @@ CALL_CC(PackedMembers) // PackedMembers copy-assignment: // CHECK-LABEL: define linkonce_odr void @_ZN13PackedMembersC2ERKS_(%struct.PackedMembers* %this, %struct.PackedMembers* dereferenceable({{[0-9]+}})) // CHECK: call void @_ZN6NonPODC1ERKS_ -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 1{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 1 {{.*}} align 1 {{.*}}i64 16, i1 {{.*}}) // CHECK: ret void CALL_CC(BitfieldMember2) // BitfieldMember2 copy-constructor: // CHECK-2-LABEL: define linkonce_odr void @_ZN15BitfieldMember2C2ERKS_(%struct.BitfieldMember2* %this, %struct.BitfieldMember2* dereferenceable({{[0-9]+}})) -// CHECK-2: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4, i1 false) +// CHECK-2: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 false) // CHECK-2: call void @_ZN6NonPODC1ERKS_ // CHECK-2: ret void CALL_CC(BitfieldMember3) // BitfieldMember3 copy-constructor: // CHECK-LABEL: define linkonce_odr void @_ZN15BitfieldMember3C2ERKS_(%struct.BitfieldMember3* %this, %struct.BitfieldMember3* dereferenceable({{[0-9]+}})) -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 8, i32 8, i1 false) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 8, i1 false) // CHECK: ret void CALL_CC(ReferenceMember) // ReferenceMember copy-constructor: // CHECK-LABEL: define linkonce_odr void @_ZN15ReferenceMemberC2ERKS_(%struct.ReferenceMember* %this, %struct.ReferenceMember* dereferenceable({{[0-9]+}})) -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 8{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 16, i1 {{.*}}) // CHECK: call void @_ZN6NonPODC1ERKS_ -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 8{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 16, i1 {{.*}}) // CHECK: ret void CALL_CC(InnerClassMember) // InnerClass copy-constructor: // CHECK-LABEL: define linkonce_odr void @_ZN16InnerClassMemberC2ERKS_(%struct.InnerClassMember* %this, %struct.InnerClassMember* dereferenceable({{[0-9]+}})) -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 32, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 32, i1 {{.*}}) // CHECK: call void @_ZN6NonPODC1ERKS_ -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}}) // CHECK: ret void CALL_CC(BitfieldMember) // BitfieldMember copy-constructor: // CHECK-LABEL: define linkonce_odr void @_ZN14BitfieldMemberC2ERKS_(%struct.BitfieldMember* %this, %struct.BitfieldMember* dereferenceable({{[0-9]+}})) -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}}) // CHECK: call void @_ZN6NonPODC1ERKS_ -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 3, i32 1{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 1 {{.*}} align 1 {{.*}}i64 3, i1 {{.*}}) // CHECK: ret void CALL_CC(VolatileMember) // VolatileMember copy-constructor: // CHECK-LABEL: define linkonce_odr void @_ZN14VolatileMemberC2ERKS_(%struct.VolatileMember* %this, %struct.VolatileMember* dereferenceable({{[0-9]+}})) -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}}) // CHECK: load volatile i32, i32* {{.*}}, align 4 // CHECK: store volatile i32 {{.*}}, align 4 // CHECK: call void @_ZN6NonPODC1ERKS_ -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}}) // CHECK: ret void CALL_CC(ArrayMember) // ArrayMember copy-constructor: // CHECK-LABEL: define linkonce_odr void @_ZN11ArrayMemberC2ERKS_(%struct.ArrayMember* %this, %struct.ArrayMember* dereferenceable({{[0-9]+}})) -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 64, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 64, i1 {{.*}}) // CHECK: call void @_ZN6NonPODC1ERKS_ -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 64, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 64, i1 {{.*}}) // CHECK: ret void CALL_CC(PODLikeMember) // PODLikeMember copy-constructor: // CHECK-LABEL: define linkonce_odr void @_ZN13PODLikeMemberC2ERKS_(%struct.PODLikeMember* %this, %struct.PODLikeMember* dereferenceable({{[0-9]+}})) -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 32, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 32, i1 {{.*}}) // CHECK: invoke void @_ZN6NonPODC1ERKS_ -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}}) // CHECK: ret void // CHECK: landingpad // CHECK: invoke void @_ZN7PODLikeD1Ev @@ -254,15 +254,15 @@ CALL_CC(PODLikeMember) CALL_CC(PODMember) // PODMember copy-constructor: // CHECK-LABEL: define linkonce_odr void @_ZN9PODMemberC2ERKS_(%struct.PODMember* %this, %struct.PODMember* dereferenceable({{[0-9]+}})) -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 32, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 32, i1 {{.*}}) // CHECK: call void @_ZN6NonPODC1ERKS_ -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}}) // CHECK: ret void CALL_CC(Basic) // Basic copy-constructor: // CHECK-LABEL: define linkonce_odr void @_ZN5BasicC2ERKS_(%struct.Basic* %this, %struct.Basic* dereferenceable({{[0-9]+}})) -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}}) // CHECK: call void @_ZN6NonPODC1ERKS_ -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}}) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}}) // CHECK: ret void diff --git a/test/CodeGenCXX/pr20719.cpp b/test/CodeGenCXX/pr20719.cpp index 1c3b21b0b84e3..79fdd7416024f 100644 --- a/test/CodeGenCXX/pr20719.cpp +++ b/test/CodeGenCXX/pr20719.cpp @@ -2,8 +2,8 @@ // Make sure that we emit H's constructor twice: once with the first lambda // inside of 'lep' and again with the second lambda inside of 'lep'. -// CHECK-DAG: @"\01??0?$H@V<lambda_1>@?0???$lep@X@@YAXXZ@@@QAE@XZ" -// CHECK-DAG: @"\01??0?$H@V<lambda_2>@?0???$lep@X@@YAXXZ@@@QAE@XZ" +// CHECK-DAG: @"??0?$H@V<lambda_1>@?0???$lep@X@@YAXXZ@@@QAE@XZ" +// CHECK-DAG: @"??0?$H@V<lambda_2>@?0???$lep@X@@YAXXZ@@@QAE@XZ" template <typename> struct H { diff --git a/test/CodeGenCXX/pr20897.cpp b/test/CodeGenCXX/pr20897.cpp index 9a7fdb999ba43..73995fc271557 100644 --- a/test/CodeGenCXX/pr20897.cpp +++ b/test/CodeGenCXX/pr20897.cpp @@ -3,13 +3,13 @@ struct Base {}; // __declspec(dllexport) causes us to export the implicit constructor. struct __declspec(dllexport) Derived : virtual Base { -// CHECK-LABEL: define weak_odr dllexport x86_thiscallcc %struct.Derived* @"\01??0Derived@@QAE@ABU0@@Z" +// CHECK-LABEL: define weak_odr dso_local dllexport x86_thiscallcc %struct.Derived* @"??0Derived@@QAE@ABU0@@Z" // CHECK: %[[this:.*]] = load %struct.Derived*, %struct.Derived** {{.*}} // CHECK-NEXT: store %struct.Derived* %[[this]], %struct.Derived** %[[retval:.*]] // CHECK: %[[dest_a_gep:.*]] = getelementptr inbounds %struct.Derived, %struct.Derived* %[[this]], i32 0, i32 1 // CHECK-NEXT: %[[src_load:.*]] = load %struct.Derived*, %struct.Derived** {{.*}} // CHECK-NEXT: %[[src_a_gep:.*]] = getelementptr inbounds %struct.Derived, %struct.Derived* %[[src_load:.*]], i32 0, i32 1 -// CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %[[dest_a_gep]], i8* %[[src_a_gep]], i64 1, i32 4, i1 false) +// CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %[[dest_a_gep]], i8* align 4 %[[src_a_gep]], i64 1, i1 false) // CHECK-NEXT: %[[dest_this:.*]] = load %struct.Derived*, %struct.Derived** %[[retval]] // CHECK-NEXT: ret %struct.Derived* %[[dest_this]] bool a : 1; @@ -18,7 +18,7 @@ struct __declspec(dllexport) Derived : virtual Base { // __declspec(dllexport) causes us to export the implicit copy constructor. struct __declspec(dllexport) Derived2 : virtual Base { -// CHECK-LABEL: define weak_odr dllexport x86_thiscallcc %struct.Derived2* @"\01??0Derived2@@QAE@ABU0@@Z" +// CHECK-LABEL: define weak_odr dso_local dllexport x86_thiscallcc %struct.Derived2* @"??0Derived2@@QAE@ABU0@@Z" // CHECK: %[[this:.*]] = load %struct.Derived2*, %struct.Derived2** {{.*}} // CHECK-NEXT: store %struct.Derived2* %[[this]], %struct.Derived2** %[[retval:.*]] // CHECK: %[[dest_a_gep:.*]] = getelementptr inbounds %struct.Derived2, %struct.Derived2* %[[this]], i32 0, i32 1 @@ -26,7 +26,7 @@ struct __declspec(dllexport) Derived2 : virtual Base { // CHECK-NEXT: %[[src_a_gep:.*]] = getelementptr inbounds %struct.Derived2, %struct.Derived2* %[[src_load:.*]], i32 0, i32 1 // CHECK-NEXT: %[[dest_a_bitcast:.*]] = bitcast [1 x i32]* %[[dest_a_gep]] to i8* // CHECK-NEXT: %[[src_a_bitcast:.*]] = bitcast [1 x i32]* %[[src_a_gep]] to i8* -// CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[dest_a_bitcast]], i8* %[[src_a_bitcast]], i32 4, i32 4, i1 false) +// CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %[[dest_a_bitcast]], i8* align 4 %[[src_a_bitcast]], i32 4, i1 false) // CHECK-NEXT: %[[dest_this:.*]] = load %struct.Derived2*, %struct.Derived2** %[[retval]] // CHECK-NEXT: ret %struct.Derived2* %[[dest_this]] int Array[1]; diff --git a/test/CodeGenCXX/pr27030.cpp b/test/CodeGenCXX/pr27030.cpp index 5c24051d7a2b0..ce83c89798918 100644 --- a/test/CodeGenCXX/pr27030.cpp +++ b/test/CodeGenCXX/pr27030.cpp @@ -5,7 +5,7 @@ extern "C" { extern int B::*a; void test1() { (int A::*)(a); } } -// CHECK-LABEL: define void @test1( +// CHECK-LABEL: define dso_local void @test1( // CHECK: %[[load:.*]] = load i32, i32* @a // CHECK: %[[memptr_cmp:.*]] = icmp ne i32 %[[load]], -1 // CHECK: br i1 %[[memptr_cmp]] diff --git a/test/CodeGenCXX/pr28360.cpp b/test/CodeGenCXX/pr28360.cpp index 5d7e1ae0c1fde..6bf2ea78b9380 100644 --- a/test/CodeGenCXX/pr28360.cpp +++ b/test/CodeGenCXX/pr28360.cpp @@ -10,7 +10,7 @@ void Bar(const MpTy &); void Baz() { Bar(&A::Foo); } -// CHECK-LABEL: define void @"\01?Baz@@YAXXZ"( +// CHECK-LABEL: define dso_local void @"?Baz@@YAXXZ"( // CHECK: %[[ref_tmp:.*]] = alloca i8*, align 4 -// CHECK: store i8* bitcast (void (%struct.A*)* @"\01?Foo@A@@QAEXXZ" to i8*), i8** %[[ref_tmp]], align 4 -// CHECK: call void @"\01?Bar@@YAXABQ8A@@AEXXZ@Z"(i8** dereferenceable(4) %[[ref_tmp]]) +// CHECK: store i8* bitcast (void (%struct.A*)* @"?Foo@A@@QAEXXZ" to i8*), i8** %[[ref_tmp]], align 4 +// CHECK: call void @"?Bar@@YAXABQ8A@@AEXXZ@Z"(i8** dereferenceable(4) %[[ref_tmp]]) diff --git a/test/CodeGenCXX/pr30731.cpp b/test/CodeGenCXX/pr30731.cpp index 078f21ceda4f6..36da43fe29b08 100644 --- a/test/CodeGenCXX/pr30731.cpp +++ b/test/CodeGenCXX/pr30731.cpp @@ -16,6 +16,6 @@ struct S : A, virtual B, C { void f(S* s) { s->f(); } -// CHECK-LABEL: define void @"\01?f@@YAXPAUS@@@Z" +// CHECK-LABEL: define dso_local void @"?f@@YAXPAUS@@@Z" // CHECK: call // CHECK: ret void diff --git a/test/CodeGenCXX/pr33080.cpp b/test/CodeGenCXX/pr33080.cpp index a744bca189863..bae47cc2e0686 100644 --- a/test/CodeGenCXX/pr33080.cpp +++ b/test/CodeGenCXX/pr33080.cpp @@ -1,25 +1,29 @@ // RUN: %clang_cc1 -triple %itanium_abi_triple -fms-extensions -emit-llvm -o- %s | FileCheck %s void fa(__unaligned struct A *) {} -// CHECK: define void @_Z2faPU11__unaligned1A( +// CHECK: define {{(dso_local )?}}void @_Z2faPU11__unaligned1A( void ga(struct A *, struct A *) {} -// CHECK: define void @_Z2gaP1AS0_( +// CHECK: define {{(dso_local )?}}void @_Z2gaP1AS0_( void gb(__unaligned struct A *, struct A *) {} -// CHECK: define void @_Z2gbPU11__unaligned1APS_( +// CHECK: define {{(dso_local )?}}void @_Z2gbPU11__unaligned1APS_( void gc(struct A *, __unaligned struct A *) {} -// CHECK: define void @_Z2gcP1APU11__unalignedS_( +// CHECK: define {{(dso_local )?}}void @_Z2gcP1APU11__unalignedS_( void gd(__unaligned struct A *, __unaligned struct A *) {} -// CHECK: define void @_Z2gdPU11__unaligned1AS1_( +// CHECK: define {{(dso_local )?}}void @_Z2gdPU11__unaligned1AS1_( void hb(__unaligned struct A *, __unaligned const struct A *) {} -// CHECK: define void @_Z2hbPU11__unaligned1APU11__unalignedKS_( +// CHECK: define {{(dso_local )?}}void @_Z2hbPU11__unaligned1APU11__unalignedKS_( void ja(__unaligned struct A *, __unaligned struct A *__unaligned *, __unaligned struct A *__unaligned *__unaligned *) {} -// CHECK: define void @_Z2jaPU11__unaligned1APU11__unalignedS1_PU11__unalignedS3_( +// CHECK: define {{(dso_local )?}}void @_Z2jaPU11__unaligned1APU11__unalignedS1_PU11__unalignedS3_( + +struct A; +void memptr(void (A::*a)(int) __unaligned) {} +// CHECK: define {{.*}} @_Z6memptrM1AU11__unalignedFviE( void jb(__unaligned struct A *, __unaligned struct A **, __unaligned struct A *__unaligned *__unaligned *) {} // CHECK: @_Z2jbPU11__unaligned1APS1_PU11__unalignedPU11__unalignedS1_( diff --git a/test/CodeGenCXX/pragma-init_seg.cpp b/test/CodeGenCXX/pragma-init_seg.cpp index 1ed841f23ddd6..8b33b854fd216 100644 --- a/test/CodeGenCXX/pragma-init_seg.cpp +++ b/test/CodeGenCXX/pragma-init_seg.cpp @@ -2,24 +2,24 @@ int f(); -// CHECK: $"\01?x@selectany_init@@3HA" = comdat any -// CHECK: $"\01?x@?$A@H@explicit_template_instantiation@@2HB" = comdat any -// CHECK: $"\01?x@?$A@H@implicit_template_instantiation@@2HB" = comdat any +// CHECK: $"?x@selectany_init@@3HA" = comdat any +// CHECK: $"?x@?$A@H@explicit_template_instantiation@@2HB" = comdat any +// CHECK: $"?x@?$A@H@implicit_template_instantiation@@2HB" = comdat any namespace simple_init { #pragma init_seg(compiler) int x = f(); -// CHECK: @"\01?x@simple_init@@3HA" = global i32 0, align 4 -// CHECK: @__cxx_init_fn_ptr = private constant void ()* @"\01??__Ex@simple_init@@YAXXZ", section ".CRT$XCC" +// CHECK: @"?x@simple_init@@3HA" = dso_local global i32 0, align 4 +// CHECK: @__cxx_init_fn_ptr = private constant void ()* @"??__Ex@simple_init@@YAXXZ", section ".CRT$XCC" #pragma init_seg(lib) int y = f(); -// CHECK: @"\01?y@simple_init@@3HA" = global i32 0, align 4 -// CHECK: @__cxx_init_fn_ptr.1 = private constant void ()* @"\01??__Ey@simple_init@@YAXXZ", section ".CRT$XCL" +// CHECK: @"?y@simple_init@@3HA" = dso_local global i32 0, align 4 +// CHECK: @__cxx_init_fn_ptr.1 = private constant void ()* @"??__Ey@simple_init@@YAXXZ", section ".CRT$XCL" #pragma init_seg(user) int z = f(); -// CHECK: @"\01?z@simple_init@@3HA" = global i32 0, align 4 +// CHECK: @"?z@simple_init@@3HA" = dso_local global i32 0, align 4 // No function pointer! This one goes on @llvm.global_ctors. } @@ -28,31 +28,31 @@ int z = f(); namespace internal_init { namespace { int x = f(); -// CHECK: @"\01?x@?A@internal_init@@3HA" = internal global i32 0, align 4 -// CHECK: @__cxx_init_fn_ptr.2 = private constant void ()* @"\01??__Ex@?A@internal_init@@YAXXZ", section ".asdf" +// CHECK: @"?x@?A@internal_init@@3HA" = internal global i32 0, align 4 +// CHECK: @__cxx_init_fn_ptr.2 = private constant void ()* @"??__Ex@?A@internal_init@@YAXXZ", section ".asdf" } } namespace selectany_init { int __declspec(selectany) x = f(); -// CHECK: @"\01?x@selectany_init@@3HA" = weak_odr global i32 0, comdat, align 4 -// CHECK: @__cxx_init_fn_ptr.3 = private constant void ()* @"\01??__Ex@selectany_init@@YAXXZ", section ".asdf", comdat($"\01?x@selectany_init@@3HA") +// CHECK: @"?x@selectany_init@@3HA" = weak_odr dso_local global i32 0, comdat, align 4 +// CHECK: @__cxx_init_fn_ptr.3 = private constant void ()* @"??__Ex@selectany_init@@YAXXZ", section ".asdf", comdat($"?x@selectany_init@@3HA") } namespace explicit_template_instantiation { template <typename T> struct A { static const int x; }; template <typename T> const int A<T>::x = f(); template struct A<int>; -// CHECK: @"\01?x@?$A@H@explicit_template_instantiation@@2HB" = weak_odr global i32 0, comdat, align 4 -// CHECK: @__cxx_init_fn_ptr.4 = private constant void ()* @"\01??__Ex@?$A@H@explicit_template_instantiation@@2HB@YAXXZ", section ".asdf", comdat($"\01?x@?$A@H@explicit_template_instantiation@@2HB") +// CHECK: @"?x@?$A@H@explicit_template_instantiation@@2HB" = weak_odr dso_local global i32 0, comdat, align 4 +// CHECK: @__cxx_init_fn_ptr.4 = private constant void ()* @"??__Ex@?$A@H@explicit_template_instantiation@@2HB@YAXXZ", section ".asdf", comdat($"?x@?$A@H@explicit_template_instantiation@@2HB") } namespace implicit_template_instantiation { template <typename T> struct A { static const int x; }; template <typename T> const int A<T>::x = f(); int g() { return A<int>::x; } -// CHECK: @"\01?x@?$A@H@implicit_template_instantiation@@2HB" = linkonce_odr global i32 0, comdat, align 4 -// CHECK: @__cxx_init_fn_ptr.5 = private constant void ()* @"\01??__Ex@?$A@H@implicit_template_instantiation@@2HB@YAXXZ", section ".asdf", comdat($"\01?x@?$A@H@implicit_template_instantiation@@2HB") +// CHECK: @"?x@?$A@H@implicit_template_instantiation@@2HB" = linkonce_odr dso_local global i32 0, comdat, align 4 +// CHECK: @__cxx_init_fn_ptr.5 = private constant void ()* @"??__Ex@?$A@H@implicit_template_instantiation@@2HB@YAXXZ", section ".asdf", comdat($"?x@?$A@H@implicit_template_instantiation@@2HB") } // ... and here's where we emitted user level ctors. diff --git a/test/CodeGenCXX/pragma-weak.cpp b/test/CodeGenCXX/pragma-weak.cpp index caab2662a9f5b..83d66bca3b5ac 100644 --- a/test/CodeGenCXX/pragma-weak.cpp +++ b/test/CodeGenCXX/pragma-weak.cpp @@ -5,7 +5,7 @@ int zex; // GCC produces a weak symbol for this because it matches mangled names. // Different c++ ABIs may or may not mangle this, so we produce a strong // symbol. -// CHECK: @zex = global i32 +// CHECK: @zex = {{(dso_local )?}}global i32 #pragma weak foo struct S { void foo(); }; diff --git a/test/CodeGenCXX/reference-init.cpp b/test/CodeGenCXX/reference-init.cpp index ba7b282028cf2..5a91d3bd6d1fe 100644 --- a/test/CodeGenCXX/reference-init.cpp +++ b/test/CodeGenCXX/reference-init.cpp @@ -3,6 +3,12 @@ // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - -std=c++11 | FileCheck %s --check-prefix=CHECK-CXX11 // expected-no-diagnostics +#if __cplusplus >= 201103L +// CHECK-CXX11: @_ZZ15InitRefWithListvE1r = internal constant i32* @_ZGRZ15InitRefWithListvE1r_ +// CHECK-CXX11: @_ZGRZ15InitRefWithListvE1r_ = internal constant i32 123 +int InitRefWithList() { static const int &r = {123}; return r; } +#endif + struct XPTParamDescriptor {}; struct nsXPTParamInfo { nsXPTParamInfo(const XPTParamDescriptor& desc); @@ -31,6 +37,6 @@ const int &s2 = s.bitfield; struct SelfReference { SelfReference &r; }; extern SelfReference self_reference_1; SelfReference self_reference_2 = {self_reference_1}; -// CHECK-CXX98: @self_reference_2 = global %[[SELF_REF:.*]] { %[[SELF_REF]]* @self_reference_1 } -// CHECK-CXX11: @self_reference_2 = global %[[SELF_REF:.*]] zeroinitializer +// CHECK-CXX98: @self_reference_2 = {{.*}}global %[[SELF_REF:.*]] { %[[SELF_REF]]* @self_reference_1 } +// CHECK-CXX11: @self_reference_2 = {{(dso_local )?}}global %[[SELF_REF:.*]] zeroinitializer // CHECK-CXX11: call {{.*}}memcpy{{.*}} @self_reference_2 {{.*}} @self_reference_1 diff --git a/test/CodeGenCXX/regcall.cpp b/test/CodeGenCXX/regcall.cpp index 2b7b9e2a6effb..fbc1dbf7d7c9a 100644 --- a/test/CodeGenCXX/regcall.cpp +++ b/test/CodeGenCXX/regcall.cpp @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -std=c++11 %s -o - | FileCheck -check-prefix=CHECK-LIN -check-prefix=CHECK-LIN64 %s -// RUN: %clang_cc1 -triple i386-linux-gnu -emit-llvm -std=c++11 %s -o - | FileCheck -check-prefix=CHECK-LIN -check-prefix=CHECK-LIN32 %s -// RUN: %clang_cc1 -triple x86_64-windows-msvc -emit-llvm -std=c++11 %s -o - -DWIN_TEST | FileCheck -check-prefix=CHECK-WIN64 %s -// RUN: %clang_cc1 -triple i386-windows-msvc -emit-llvm -std=c++11 %s -o - -DWIN_TEST | FileCheck -check-prefix=CHECK-WIN32 %s +// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -std=c++11 %s -o - | FileCheck -allow-deprecated-dag-overlap -check-prefix=CHECK-LIN -check-prefix=CHECK-LIN64 %s +// RUN: %clang_cc1 -triple i386-linux-gnu -emit-llvm -std=c++11 %s -o - | FileCheck -allow-deprecated-dag-overlap -check-prefix=CHECK-LIN -check-prefix=CHECK-LIN32 %s +// RUN: %clang_cc1 -triple x86_64-windows-msvc -emit-llvm -std=c++11 %s -o - -DWIN_TEST | FileCheck -allow-deprecated-dag-overlap -check-prefix=CHECK-WIN64 %s +// RUN: %clang_cc1 -triple i386-windows-msvc -emit-llvm -std=c++11 %s -o - -DWIN_TEST | FileCheck -allow-deprecated-dag-overlap -check-prefix=CHECK-WIN32 %s int __regcall foo(int i); @@ -15,15 +15,15 @@ int main() return lambda(p); } // CHECK-LIN: call x86_regcallcc {{.+}} @_Z15__regcall3__foo -// CHECK-WIN64: call x86_regcallcc {{.+}} @"\01?foo@@YwHH@Z" -// CHECK-WIN32: call x86_regcallcc {{.+}} @"\01?foo@@YwHH@Z" +// CHECK-WIN64: call x86_regcallcc {{.+}} @"?foo@@YwHH@Z" +// CHECK-WIN32: call x86_regcallcc {{.+}} @"?foo@@YwHH@Z" int __regcall foo (int i){ return i; } // CHECK-LIN: define x86_regcallcc {{.+}}@_Z15__regcall3__foo -// CHECK-WIN64: define x86_regcallcc {{.+}}@"\01?foo@@YwHH@Z" -// CHECK-WIN32: define x86_regcallcc {{.+}}@"\01?foo@@YwHH@Z" +// CHECK-WIN64: define dso_local x86_regcallcc {{.+}}@"?foo@@YwHH@Z" +// CHECK-WIN32: define dso_local x86_regcallcc {{.+}}@"?foo@@YwHH@Z" // used to give a body to test_class functions static int x = 0; @@ -37,8 +37,8 @@ public: // CHECK-LIN-DAG: define linkonce_odr x86_regcallcc void @_ZN10test_classC1Ev // CHECK-LIN-DAG: define linkonce_odr x86_regcallcc void @_ZN10test_classC2Ev // Windows ignores calling convention on constructor/destructors. - // CHECK-WIN64-DAG: define linkonce_odr %class.test_class* @"\01??0test_class@@QEAA@XZ" - // CHECK-WIN32-DAG: define linkonce_odr x86_thiscallcc %class.test_class* @"\01??0test_class@@QAE@XZ" + // CHECK-WIN64-DAG: define linkonce_odr dso_local %class.test_class* @"??0test_class@@QEAA@XZ" + // CHECK-WIN32-DAG: define linkonce_odr dso_local x86_thiscallcc %class.test_class* @"??0test_class@@QAE@XZ" #ifndef WIN_TEST __regcall @@ -47,43 +47,43 @@ public: // CHECK-LIN-DAG: define linkonce_odr x86_regcallcc void @_ZN10test_classD2Ev // CHECK-LIN-DAG: define linkonce_odr x86_regcallcc void @_ZN10test_classD1Ev // Windows ignores calling convention on constructor/destructors. - // CHECK-WIN64-DAG: define linkonce_odr void @"\01??_Dtest_class@@QEAAXXZ" - // CHECK-WIN32-DAG: define linkonce_odr x86_thiscallcc void @"\01??_Dtest_class@@QAEXXZ" + // CHECK-WIN64-DAG: define linkonce_odr dso_local void @"??1test_class@@QEAA@XZ" + // CHECK-WIN32-DAG: define linkonce_odr dso_local x86_thiscallcc void @"??1test_class@@QAE@XZ" test_class& __regcall operator+=(const test_class&){ return *this; } // CHECK-LIN-DAG: define linkonce_odr x86_regcallcc dereferenceable(4) %class.test_class* @_ZN10test_classpLERKS_ - // CHECK-WIN64-DAG: define linkonce_odr x86_regcallcc dereferenceable(4) %class.test_class* @"\01??Ytest_class@@QEAwAEAV0@AEBV0@@Z" - // CHECK-WIN32-DAG: define linkonce_odr x86_regcallcc dereferenceable(4) %class.test_class* @"\01??Ytest_class@@QAwAAV0@ABV0@@Z" + // CHECK-WIN64-DAG: define linkonce_odr dso_local x86_regcallcc dereferenceable(4) %class.test_class* @"??Ytest_class@@QEAwAEAV0@AEBV0@@Z" + // CHECK-WIN32-DAG: define linkonce_odr dso_local x86_regcallcc dereferenceable(4) %class.test_class* @"??Ytest_class@@QAwAAV0@ABV0@@Z" void __regcall do_thing(){} // CHECK-LIN-DAG: define linkonce_odr x86_regcallcc void @_ZN10test_class20__regcall3__do_thingEv - // CHECK-WIN64-DAG: define linkonce_odr x86_regcallcc void @"\01?do_thing@test_class@@QEAwXXZ" - // CHECK-WIN32-DAG: define linkonce_odr x86_regcallcc void @"\01?do_thing@test_class@@QAwXXZ" + // CHECK-WIN64-DAG: define linkonce_odr dso_local x86_regcallcc void @"?do_thing@test_class@@QEAwXXZ" + // CHECK-WIN32-DAG: define linkonce_odr dso_local x86_regcallcc void @"?do_thing@test_class@@QAwXXZ" template<typename T> void __regcall tempFunc(T i){} // CHECK-LIN-DAG: define linkonce_odr x86_regcallcc void @_ZN10test_class20__regcall3__tempFuncIiEEvT_ - // CHECK-WIN64-DAG: define linkonce_odr x86_regcallcc void @"\01??$freeTempFunc@H@@YwXH@Z" - // CHECK-WIN32-DAG: define linkonce_odr x86_regcallcc void @"\01??$freeTempFunc@H@@YwXH@Z" + // CHECK-WIN64-DAG: define linkonce_odr dso_local x86_regcallcc void @"??$freeTempFunc@H@@YwXH@Z" + // CHECK-WIN32-DAG: define linkonce_odr dso_local x86_regcallcc void @"??$freeTempFunc@H@@YwXH@Z" }; bool __regcall operator ==(const test_class&, const test_class&){ --x; return false;} // CHECK-LIN-DAG: define x86_regcallcc zeroext i1 @_ZeqRK10test_classS1_ -// CHECK-WIN64-DAG: define x86_regcallcc zeroext i1 @"\01??8@Yw_NAEBVtest_class@@0@Z" -// CHECK-WIN32-DAG: define x86_regcallcc zeroext i1 @"\01??8@Yw_NABVtest_class@@0@Z" +// CHECK-WIN64-DAG: define dso_local x86_regcallcc zeroext i1 @"??8@Yw_NAEBVtest_class@@0@Z" +// CHECK-WIN32-DAG: define dso_local x86_regcallcc zeroext i1 @"??8@Yw_NABVtest_class@@0@Z" test_class __regcall operator""_test_class (unsigned long long) { ++x; return test_class{};} // CHECK-LIN64-DAG: define x86_regcallcc void @_Zli11_test_classy(%class.test_class* noalias sret %agg.result, i64) // CHECK-LIN32-DAG: define x86_regcallcc void @_Zli11_test_classy(%class.test_class* inreg noalias sret %agg.result, i64) -// CHECK-WIN64-DAG: \01??__K_test_class@@Yw?AVtest_class@@_K@Z" -// CHECK-WIN32-DAG: \01??__K_test_class@@Yw?AVtest_class@@_K@Z" +// CHECK-WIN64-DAG: ??__K_test_class@@Yw?AVtest_class@@_K@Z" +// CHECK-WIN32-DAG: ??__K_test_class@@Yw?AVtest_class@@_K@Z" template<typename T> void __regcall freeTempFunc(T i){} // CHECK-LIN-DAG: define linkonce_odr x86_regcallcc void @_Z24__regcall3__freeTempFuncIiEvT_ -// CHECK-WIN64-DAG: define linkonce_odr x86_regcallcc void @"\01??$freeTempFunc@H@@YwXH@Z" -// CHECK-WIN32-DAG: define linkonce_odr x86_regcallcc void @"\01??$freeTempFunc@H@@YwXH@Z" +// CHECK-WIN64-DAG: define linkonce_odr dso_local x86_regcallcc void @"??$freeTempFunc@H@@YwXH@Z" +// CHECK-WIN32-DAG: define linkonce_odr dso_local x86_regcallcc void @"??$freeTempFunc@H@@YwXH@Z" // class to force generation of functions void force_gen() { @@ -101,5 +101,5 @@ long double _Complex __regcall foo(long double _Complex f) { } // CHECK-LIN64-DAG: define x86_regcallcc void @_Z15__regcall3__fooCe({ x86_fp80, x86_fp80 }* noalias sret %agg.result, { x86_fp80, x86_fp80 }* byval align 16 %f) // CHECK-LIN32-DAG: define x86_regcallcc void @_Z15__regcall3__fooCe({ x86_fp80, x86_fp80 }* inreg noalias sret %agg.result, { x86_fp80, x86_fp80 }* byval align 4 %f) -// CHECK-WIN64-DAG: define x86_regcallcc { double, double } @"\01?foo@@YwU?$_Complex@O@__clang@@U12@@Z"(double %f.0, double %f.1) -// CHECK-WIN32-DAG: define x86_regcallcc { double, double } @"\01?foo@@YwU?$_Complex@O@__clang@@U12@@Z"(double %f.0, double %f.1) +// CHECK-WIN64-DAG: define dso_local x86_regcallcc { double, double } @"?foo@@YwU?$_Complex@O@__clang@@U12@@Z"(double %f.0, double %f.1) +// CHECK-WIN32-DAG: define dso_local x86_regcallcc { double, double } @"?foo@@YwU?$_Complex@O@__clang@@U12@@Z"(double %f.0, double %f.1) diff --git a/test/CodeGenCXX/rtti-fundamental.cpp b/test/CodeGenCXX/rtti-fundamental.cpp index a0ad80d7c98a6..d0e5890f89c75 100644 --- a/test/CodeGenCXX/rtti-fundamental.cpp +++ b/test/CodeGenCXX/rtti-fundamental.cpp @@ -1,4 +1,5 @@ // RUN: %clang_cc1 %s -I%S -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -I%S -triple=x86_64-apple-darwin10 -emit-llvm -fvisibility hidden -o - | FileCheck %s -check-prefix=CHECK-HIDDEN #include <typeinfo> @@ -16,116 +17,184 @@ namespace __cxxabiv1 { // void // CHECK: @_ZTIv = constant +// CHECK-HIDDEN: @_ZTIv = hidden constant // CHECK: @_ZTIPv = constant +// CHECK-HIDDEN: @_ZTIPv = hidden constant // CHECK: @_ZTIPKv = constant +// CHECK-HIDDEN: @_ZTIPKv = hidden constant // std::nullptr_t // CHECK: @_ZTIDn = constant +// CHECK-HIDDEN: @_ZTIDn = hidden constant // CHECK: @_ZTIPDn = constant +// CHECK-HIDDEN: @_ZTIPDn = hidden constant // CHECK: @_ZTIPKDn = constant +// CHECK-HIDDEN: @_ZTIPKDn = hidden constant // bool // CHECK: @_ZTIb = constant +// CHECK-HIDDEN: @_ZTIb = hidden constant // CHECK: @_ZTIPb = constant +// CHECK-HIDDEN: @_ZTIPb = hidden constant // CHECK: @_ZTIPKb = constant +// CHECK-HIDDEN: @_ZTIPKb = hidden constant // wchar_t // CHECK: @_ZTIw = constant +// CHECK-HIDDEN: @_ZTIw = hidden constant // CHECK: @_ZTIPw = constant +// CHECK-HIDDEN: @_ZTIPw = hidden constant // CHECK: @_ZTIPKw = constant +// CHECK-HIDDEN: @_ZTIPKw = hidden constant // char // CHECK: @_ZTIc = constant +// CHECK-HIDDEN: @_ZTIc = hidden constant // CHECK: @_ZTIPc = constant +// CHECK-HIDDEN: @_ZTIPc = hidden constant // CHECK: @_ZTIPKc = constant +// CHECK-HIDDEN: @_ZTIPKc = hidden constant // unsigned char // CHECK: @_ZTIh = constant +// CHECK-HIDDEN: @_ZTIh = hidden constant // CHECK: @_ZTIPh = constant +// CHECK-HIDDEN: @_ZTIPh = hidden constant // CHECK: @_ZTIPKh = constant +// CHECK-HIDDEN: @_ZTIPKh = hidden constant // signed char // CHECK: @_ZTIa = constant +// CHECK-HIDDEN: @_ZTIa = hidden constant // CHECK: @_ZTIPa = constant +// CHECK-HIDDEN: @_ZTIPa = hidden constant // CHECK: @_ZTIPKa = constant +// CHECK-HIDDEN: @_ZTIPKa = hidden constant // short // CHECK: @_ZTIs = constant +// CHECK-HIDDEN: @_ZTIs = hidden constant // CHECK: @_ZTIPs = constant +// CHECK-HIDDEN: @_ZTIPs = hidden constant // CHECK: @_ZTIPKs = constant +// CHECK-HIDDEN: @_ZTIPKs = hidden constant // unsigned short // CHECK: @_ZTIt = constant +// CHECK-HIDDEN: @_ZTIt = hidden constant // CHECK: @_ZTIPt = constant +// CHECK-HIDDEN: @_ZTIPt = hidden constant // CHECK: @_ZTIPKt = constant +// CHECK-HIDDEN: @_ZTIPKt = hidden constant // int // CHECK: @_ZTIi = constant +// CHECK-HIDDEN: @_ZTIi = hidden constant // CHECK: @_ZTIPi = constant +// CHECK-HIDDEN: @_ZTIPi = hidden constant // CHECK: @_ZTIPKi = constant +// CHECK-HIDDEN: @_ZTIPKi = hidden constant // unsigned int // CHECK: @_ZTIj = constant +// CHECK-HIDDEN: @_ZTIj = hidden constant // CHECK: @_ZTIPj = constant +// CHECK-HIDDEN: @_ZTIPj = hidden constant // CHECK: @_ZTIPKj = constant +// CHECK-HIDDEN: @_ZTIPKj = hidden constant // long // CHECK: @_ZTIl = constant +// CHECK-HIDDEN: @_ZTIl = hidden constant // CHECK: @_ZTIPl = constant +// CHECK-HIDDEN: @_ZTIPl = hidden constant // CHECK: @_ZTIPKl = constant +// CHECK-HIDDEN: @_ZTIPKl = hidden constant // unsigned long // CHECK: @_ZTIm = constant +// CHECK-HIDDEN: @_ZTIm = hidden constant // CHECK: @_ZTIPm = constant +// CHECK-HIDDEN: @_ZTIPm = hidden constant // CHECK: @_ZTIPKm = constant +// CHECK-HIDDEN: @_ZTIPKm = hidden constant // long long // CHECK: @_ZTIx = constant +// CHECK-HIDDEN: @_ZTIx = hidden constant // CHECK: @_ZTIPx = constant +// CHECK-HIDDEN: @_ZTIPx = hidden constant // CHECK: @_ZTIPKx = constant +// CHECK-HIDDEN: @_ZTIPKx = hidden constant // unsigned long long // CHECK: @_ZTIy = constant +// CHECK-HIDDEN: @_ZTIy = hidden constant // CHECK: @_ZTIPy = constant +// CHECK-HIDDEN: @_ZTIPy = hidden constant // CHECK: @_ZTIPKy = constant +// CHECK-HIDDEN: @_ZTIPKy = hidden constant // __int128 // CHECK: @_ZTIn = constant +// CHECK-HIDDEN: @_ZTIn = hidden constant // CHECK: @_ZTIPn = constant +// CHECK-HIDDEN: @_ZTIPn = hidden constant // CHECK: @_ZTIPKn = constant +// CHECK-HIDDEN: @_ZTIPKn = hidden constant // unsigned __int128 // CHECK: @_ZTIo = constant +// CHECK-HIDDEN: @_ZTIo = hidden constant // CHECK: @_ZTIPo = constant +// CHECK-HIDDEN: @_ZTIPo = hidden constant // CHECK: @_ZTIPKo = constant +// CHECK-HIDDEN: @_ZTIPKo = hidden constant // half // CHECK: @_ZTIDh = constant +// CHECK-HIDDEN: @_ZTIDh = hidden constant // CHECK: @_ZTIPDh = constant +// CHECK-HIDDEN: @_ZTIPDh = hidden constant // CHECK: @_ZTIPKDh = constant +// CHECK-HIDDEN: @_ZTIPKDh = hidden constant // float // CHECK: @_ZTIf = constant +// CHECK-HIDDEN: @_ZTIf = hidden constant // CHECK: @_ZTIPf = constant +// CHECK-HIDDEN: @_ZTIPf = hidden constant // CHECK: @_ZTIPKf = constant +// CHECK-HIDDEN: @_ZTIPKf = hidden constant // double // CHECK: @_ZTId = constant +// CHECK-HIDDEN: @_ZTId = hidden constant // CHECK: @_ZTIPd = constant +// CHECK-HIDDEN: @_ZTIPd = hidden constant // CHECK: @_ZTIPKd = constant +// CHECK-HIDDEN: @_ZTIPKd = hidden constant // long double // CHECK: @_ZTIe = constant +// CHECK-HIDDEN: @_ZTIe = hidden constant // CHECK: @_ZTIPe = constant +// CHECK-HIDDEN: @_ZTIPe = hidden constant // CHECK: @_ZTIPKe = constant +// CHECK-HIDDEN: @_ZTIPKe = hidden constant // char16_t // CHECK: @_ZTIDs = constant +// CHECK-HIDDEN: @_ZTIDs = hidden constant // CHECK: @_ZTIPDs = constant +// CHECK-HIDDEN: @_ZTIPDs = hidden constant // CHECK: @_ZTIPKDs = constant +// CHECK-HIDDEN: @_ZTIPKDs = hidden constant // char32_t // CHECK: @_ZTIDi = constant +// CHECK-HIDDEN: @_ZTIDi = hidden constant // CHECK: @_ZTIPDi = constant +// CHECK-HIDDEN: @_ZTIPDi = hidden constant // CHECK: @_ZTIPKDi = constant - +// CHECK-HIDDEN: @_ZTIPKDi = hidden constant diff --git a/test/CodeGenCXX/rtti-hidden.cpp b/test/CodeGenCXX/rtti-hidden.cpp new file mode 100644 index 0000000000000..3ae487f58025f --- /dev/null +++ b/test/CodeGenCXX/rtti-hidden.cpp @@ -0,0 +1,10 @@ +// RUN: %clang_cc1 %s -triple=x86_64-pc-linux -emit-llvm -o - | FileCheck %s + +// Test that this is not hidden. +// CHECK: @_ZTVN10__cxxabiv120__si_class_type_infoE = external global + +class foo { + virtual void baz(); +}; +struct __attribute__((__visibility__("hidden"))) bar : public foo {}; +bar zed; diff --git a/test/CodeGenCXX/rtti-mingw64.cpp b/test/CodeGenCXX/rtti-mingw64.cpp index 9f3e03961e891..628a4d0313c7f 100644 --- a/test/CodeGenCXX/rtti-mingw64.cpp +++ b/test/CodeGenCXX/rtti-mingw64.cpp @@ -7,8 +7,8 @@ class C { }; C::~C() {} -// CHECK: @_ZTI1C = linkonce_odr -// CHECK: @_ZTI1B = linkonce_odr constant { i8*, i8*, i32, i32, i8*, i64 } +// CHECK: @_ZTI1C = linkonce_odr dso_local +// CHECK: @_ZTI1B = linkonce_odr dso_local constant { i8*, i8*, i32, i32, i8*, i64 } // CHECK-SAME: i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv121__vmi_class_type_infoE, i64 2) to i8*), // CHECK-SAME: i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1B, i32 0, i32 0), // CHECK-SAME: i32 0, diff --git a/test/CodeGenCXX/runtime-dllstorage.cpp b/test/CodeGenCXX/runtime-dllstorage.cpp index 8ccf0291687c9..7220fa50b0eed 100644 --- a/test/CodeGenCXX/runtime-dllstorage.cpp +++ b/test/CodeGenCXX/runtime-dllstorage.cpp @@ -1,21 +1,21 @@ -// RUN: %clang_cc1 -triple i686-windows-msvc -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-MS -check-prefix CHECK-MS-DYNAMIC -// RUN: %clang_cc1 -triple i686-windows-msvc -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -flto-visibility-public-std -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-MS -check-prefix CHECK-MS-STATIC - -// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-IA -check-prefix CHECK-DYNAMIC-IA -check-prefix CHECK-DYNAMIC-NODECL-IA -check-prefix CHECK-DYANMIC-IA-CXA-ATEXIT -// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -flto-visibility-public-std -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-IA -check-prefix CHECK-STATIC-IA -check-prefix CHECK-STATIC-NODECL-IA -check-prefix CHECK-IA-STATIC-CXA-ATEXIT -// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -DIMPORT_DECLARATIONS -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-IA -check-prefix CHECK-DYNAMIC-IA -check-prefix CHECK-DYNAMIC-IMPORT-IA -check-prefix CHECK-DYANMIC-IA-CXA-ATEXIT -// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -flto-visibility-public-std -DIMPORT_DECLARATIONS -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-IA -check-prefix CHECK-STATIC-IA -check-prefix CHECK-STATIC-IMPORT-IA -check-prefix CHECK-IA-STATIC-CXA-ATEXIT -// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -DEXPORT_DECLARATIONS -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-IA -check-prefix CHECK-DYNAMIC-IA -check-prefix CHECK-DYANMIC-IA-CXA-ATEXIT -// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -flto-visibility-public-std -DEXPORT_DECLARATIONS -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-IA -check-prefix CHECK-STATIC-IA -check-prefix CHECK-IA-STATIC-CXA-ATEXIT -// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -DDECL -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-IA -check-prefix CHECK-DYNAMIC-IA -check-prefix CHECK-DYNAMIC-DECL-IA -check-prefix CHECK-DYANMIC-IA-CXA-ATEXIT -// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -flto-visibility-public-std -DDECL -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-IA -check-prefix CHECK-STATIC-IA -check-prefix CHECK-STATIC-DECL-IA -check-prefix CHECK-IA-STATIC-CXA-ATEXIT +// RUN: %clang_cc1 -triple i686-windows-msvc -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-MS -check-prefix CHECK-MS-DYNAMIC +// RUN: %clang_cc1 -triple i686-windows-msvc -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -flto-visibility-public-std -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-MS -check-prefix CHECK-MS-STATIC + +// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-DYNAMIC-IA -check-prefix CHECK-DYNAMIC-NODECL-IA -check-prefix CHECK-DYANMIC-IA-CXA-ATEXIT +// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -flto-visibility-public-std -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-STATIC-IA -check-prefix CHECK-STATIC-NODECL-IA -check-prefix CHECK-IA-STATIC-CXA-ATEXIT +// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -DIMPORT_DECLARATIONS -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-DYNAMIC-IA -check-prefix CHECK-DYNAMIC-IMPORT-IA -check-prefix CHECK-DYANMIC-IA-CXA-ATEXIT +// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -flto-visibility-public-std -DIMPORT_DECLARATIONS -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-STATIC-IA -check-prefix CHECK-STATIC-IMPORT-IA -check-prefix CHECK-IA-STATIC-CXA-ATEXIT +// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -DEXPORT_DECLARATIONS -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-DYNAMIC-IA -check-prefix CHECK-DYANMIC-IA-CXA-ATEXIT +// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -flto-visibility-public-std -DEXPORT_DECLARATIONS -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-STATIC-IA -check-prefix CHECK-IA-STATIC-CXA-ATEXIT +// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -DDECL -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-DYNAMIC-IA -check-prefix CHECK-DYNAMIC-DECL-IA -check-prefix CHECK-DYANMIC-IA-CXA-ATEXIT +// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -flto-visibility-public-std -DDECL -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-STATIC-IA -check-prefix CHECK-STATIC-DECL-IA -check-prefix CHECK-IA-STATIC-CXA-ATEXIT // %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -fno-use-cxa-atexit -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-IA -check-prefix CHECK-DYNAMIC-IA -check-prefix CHECK-DYNAMIC-IA-ATEXIT // %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -fno-use-cxa-atexit -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-IA -check-prefix CHECK-STATIC-IA -check-prefix CHECK-STATIC-IA-ATEXIT -// RUN: %clang_cc1 -triple i686-windows-gnu -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-IA -check-prefix CHECK-STATIC-IA -// RUN: %clang_cc1 -triple i686-windows-gnu -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -flto-visibility-public-std -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-IA -check-prefix CHECK-STATIC-IA -// RUN: %clang_cc1 -triple i686-windows-cygnus -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-IA -check-prefix CHECK-DYNAMIC-IA -// RUN: %clang_cc1 -triple i686-windows-cygnus -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -flto-visibility-public-std -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-IA -check-prefix CHECK-STATIC-IA +// RUN: %clang_cc1 -triple i686-windows-gnu -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-STATIC-IA +// RUN: %clang_cc1 -triple i686-windows-gnu -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -flto-visibility-public-std -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-STATIC-IA +// RUN: %clang_cc1 -triple i686-windows-cygnus -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-DYNAMIC-IA +// RUN: %clang_cc1 -triple i686-windows-cygnus -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -flto-visibility-public-std -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-STATIC-IA #if defined(IMPORT_DECLARATIONS) namespace __cxxabiv1 { @@ -106,15 +106,16 @@ void l() { } // CHECK-MS-DAG: @_Init_thread_epoch = external thread_local global i32 -// CHECK-MS-DAG: declare i32 @__tlregdtor(void ()*) -// CHECK-MS-DAG: declare i32 @atexit(void ()*) +// CHECK-MS-DAG: declare dso_local i32 @__tlregdtor(void ()*) +// CHECK-MS-DAG: declare dso_local i32 @atexit(void ()*) // CHECK-MS-DYNAMIC-DAG: declare dllimport {{.*}} void @_CxxThrowException // CHECK-MS-STATIC-DAG: declare {{.*}} void @_CxxThrowException -// CHECK-MS-DAG: declare noalias i8* @"\01??2@YAPAXI@Z" -// CHECK-MS-DAG: declare void @_Init_thread_header(i32*) -// CHECK-MS-DAG: declare void @_Init_thread_footer(i32*) +// CHECK-MS-DAG: declare dso_local noalias i8* @"??2@YAPAXI@Z" +// CHECK-MS-DAG: declare dso_local void @_Init_thread_header(i32*) +// CHECK-MS-DAG: declare dso_local void @_Init_thread_footer(i32*) -// CHECK-IA-DAG: declare i32 @__gxx_personality_v0(...) +// CHECK-IA-DAG: @_ZTH1t = dso_local alias void (), void ()* @__tls_init +// CHECK-IA-DAG: declare dso_local i32 @__gxx_personality_v0(...) // CHECK-IA-DAG: define linkonce_odr hidden void @__clang_call_terminate(i8*) // CHECK-DYNAMIC-IA-DAG: declare dllimport i32 @__cxa_thread_atexit(void (i8*)*, i8*, i8*) @@ -128,31 +129,31 @@ void l() { // CHECK-DYNAMIC-NODECL-IA-DAG: declare dllimport i32 @__cxa_guard_acquire(i64*) // CHECK-DYNAMIC-IMPORT-IA-DAG: declare dllimport i32 @__cxa_guard_acquire(i64*) // CHECK-DYNAMIC-EXPORT-IA-DAG: declare dllexport i32 @__cxa_guard_acquire(i64*) -// CHECK-IA-DAG: declare noalias i8* @_Znwj(i32) +// CHECK-IA-DAG: declare dso_local noalias i8* @_Znwj(i32) // CHECK-DYNAMIC-DECL-IA-DAG: declare dllimport void @__cxa_guard_release(i64*) // CHECK-DYNAMIC-NODECL-IA-DAG: declare dllimport void @__cxa_guard_release(i64*) // CHECK-DYNAMIC-IMPORT-IA-DAG: declare dllimport void @__cxa_guard_release(i64*) // CHECK-DYNAMIC-EXPORT-IA-DAG: declare dllimport void @__cxa_guard_release(i64*) // CHECK-DYANMIC-IA-DAG: declare dllimport void @_ZSt9terminatev() -// CHECK-DYNAMIC-NODECL-IA-DAG: declare void @_ZSt9terminatev() +// CHECK-DYNAMIC-NODECL-IA-DAG: declare dso_local void @_ZSt9terminatev() // CHECK-DYNAMIC-IMPORT-IA-DAG: declare dllimport void @_ZSt9terminatev() -// CHECK-DYNAMIC-EXPORT-IA-DAG: declare dllexport void @_ZSt9terminatev() - -// CHECK-STATIC-IA-DAG: declare i32 @__cxa_thread_atexit(void (i8*)*, i8*, i8*) -// CHECK-STATIC-IA-DAG: declare i32 @__cxa_atexit(void (i8*)*, i8*, i8*) -// CHECK-STATIC-IA-DAG: declare i8* @__cxa_allocate_exception(i32) -// CHECK-STATIC-IA-DAG: declare void @__cxa_throw(i8*, i8*, i8*) -// CHECK-STATIC-DECL-IA-DAG: declare i32 @__cxa_guard_acquire(i64*) -// CHECK-STATIC-NODECL-IA-DAG: declare i32 @__cxa_guard_acquire(i64*) -// CHECK-STATIC-IMPORT-IA-DAG: declare i32 @__cxa_guard_acquire(i64*) -// CHECK-STATIC-EXPORT-IA-DAG: declare i32 @__cxa_guard_acquire(i64*) -// CHECK-IA-DAG: declare noalias i8* @_Znwj(i32) -// CHECK-STATIC-DECL-IA-DAG: declare void @__cxa_guard_release(i64*) -// CHECK-STATIC-NODECL-IA-DAG: declare void @__cxa_guard_release(i64*) -// CHECK-STATIC-IMPORT-IA-DAG: declare void @__cxa_guard_release(i64*) -// CHECK-STATIC-EXPORT-IA-DAG: declare void @__cxa_guard_release(i64*) -// CHECK-STATIC-IA-DAG: declare void @_ZSt9terminatev() -// CHECK-STATIC-NODECL-IA-DAG: declare void @_ZSt9terminatev() -// CHECK-STATIC-IMPORT-IA-DAG: declare void @_ZSt9terminatev() -// CHECK-STATIC-EXPORT-IA-DAG: declare dllexport void @_ZSt9terminatev() +// CHECK-DYNAMIC-EXPORT-IA-DAG: declare dso_local dllexport void @_ZSt9terminatev() + +// CHECK-STATIC-IA-DAG: declare dso_local i32 @__cxa_thread_atexit(void (i8*)*, i8*, i8*) +// CHECK-STATIC-IA-DAG: declare dso_local i32 @__cxa_atexit(void (i8*)*, i8*, i8*) +// CHECK-STATIC-IA-DAG: declare dso_local i8* @__cxa_allocate_exception(i32) +// CHECK-STATIC-IA-DAG: declare dso_local void @__cxa_throw(i8*, i8*, i8*) +// CHECK-STATIC-DECL-IA-DAG: declare dso_local i32 @__cxa_guard_acquire(i64*) +// CHECK-STATIC-NODECL-IA-DAG: declare dso_local i32 @__cxa_guard_acquire(i64*) +// CHECK-STATIC-IMPORT-IA-DAG: declare dso_local i32 @__cxa_guard_acquire(i64*) +// CHECK-STATIC-EXPORT-IA-DAG: declare dso_local i32 @__cxa_guard_acquire(i64*) +// CHECK-IA-DAG: declare dso_local noalias i8* @_Znwj(i32) +// CHECK-STATIC-DECL-IA-DAG: declare dso_local void @__cxa_guard_release(i64*) +// CHECK-STATIC-NODECL-IA-DAG: declare dso_local void @__cxa_guard_release(i64*) +// CHECK-STATIC-IMPORT-IA-DAG: declare dso_local void @__cxa_guard_release(i64*) +// CHECK-STATIC-EXPORT-IA-DAG: declare dso_local void @__cxa_guard_release(i64*) +// CHECK-STATIC-IA-DAG: declare dso_local void @_ZSt9terminatev() +// CHECK-STATIC-NODECL-IA-DAG: declare dso_local void @_ZSt9terminatev() +// CHECK-STATIC-IMPORT-IA-DAG: declare dso_local void @_ZSt9terminatev() +// CHECK-STATIC-EXPORT-IA-DAG: declare dso_local dllexport void @_ZSt9terminatev() diff --git a/test/CodeGenCXX/sanitize-no-dtor-callback.cpp b/test/CodeGenCXX/sanitize-no-dtor-callback.cpp index 2c355766216df..afc5382eb4644 100644 --- a/test/CodeGenCXX/sanitize-no-dtor-callback.cpp +++ b/test/CodeGenCXX/sanitize-no-dtor-callback.cpp @@ -1,8 +1,9 @@ -// Test without the flag -fsanitize-memory-use-after-dtor, to ensure that +// Test with the flag -fno-sanitize-memory-use-after-dtor, to ensure that // instrumentation is not erroneously inserted -// RUN: %clang_cc1 -fsanitize=memory -triple=x86_64-pc-linux -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -fsanitize=memory -fno-sanitize-memory-use-after-dtor -triple=x86_64-pc-linux -emit-llvm -o - %s | FileCheck %s struct Simple { + int x; ~Simple() {} }; Simple s; @@ -10,6 +11,7 @@ Simple s; // CHECK-NOT: call void @__sanitizer_dtor_callback struct Inlined { + int x; inline ~Inlined() {} }; Inlined i; diff --git a/test/CodeGenCXX/sections.cpp b/test/CodeGenCXX/sections.cpp index c33871a97f567..899bdfa8b9b69 100644 --- a/test/CodeGenCXX/sections.cpp +++ b/test/CodeGenCXX/sections.cpp @@ -76,26 +76,26 @@ __declspec(allocate("long_section")) long long_var = 42; __declspec(allocate("short_section")) short short_var = 42; } -//CHECK: @D = global i32 1 -//CHECK: @a = global i32 1, section ".data" -//CHECK: @b = constant i32 1, section ".my_const" +//CHECK: @D = dso_local global i32 1 +//CHECK: @a = dso_local global i32 1, section ".data" +//CHECK: @b = dso_local constant i32 1, section ".my_const" //CHECK: @[[MYSTR:.*]] = {{.*}} unnamed_addr constant [11 x i8] c"my string!\00" -//CHECK: @s = global i8* getelementptr inbounds ([11 x i8], [11 x i8]* @[[MYSTR]], i32 0, i32 0), section ".data2" -//CHECK: @c = global i32 1, section ".my_seg" -//CHECK: @d = global i32 1, section ".data" -//CHECK: @e = global i32 0, section ".my_bss" -//CHECK: @f = global i32 0, section ".c" -//CHECK: @i = global i32 0 -//CHECK: @TEST1 = global i32 0 -//CHECK: @TEST2 = global i32 0, section ".bss1" -//CHECK: @TEST3 = global i32 0, section ".bss1" -//CHECK: @d2 = global i32 1, section ".data" -//CHECK: @b2 = constant i32 1, section ".my_const" -//CHECK: @unreferenced = constant i32 0, section "read_flag_section" -//CHECK: @referenced = constant i32 42, section "read_flag_section" -//CHECK: @implicitly_read_write = global i32 42, section "no_section_attributes" -//CHECK: @long_var = global i32 42, section "long_section" -//CHECK: @short_var = global i16 42, section "short_section" -//CHECK: define void @g() -//CHECK: define void @h() {{.*}} section ".my_code" -//CHECK: define void @h2() {{.*}} section ".my_code" +//CHECK: @s = dso_local global i8* getelementptr inbounds ([11 x i8], [11 x i8]* @[[MYSTR]], i32 0, i32 0), section ".data2" +//CHECK: @c = dso_local global i32 1, section ".my_seg" +//CHECK: @d = dso_local global i32 1, section ".data" +//CHECK: @e = dso_local global i32 0, section ".my_bss" +//CHECK: @f = dso_local global i32 0, section ".c" +//CHECK: @i = dso_local global i32 0 +//CHECK: @TEST1 = dso_local global i32 0 +//CHECK: @TEST2 = dso_local global i32 0, section ".bss1" +//CHECK: @TEST3 = dso_local global i32 0, section ".bss1" +//CHECK: @d2 = dso_local global i32 1, section ".data" +//CHECK: @b2 = dso_local constant i32 1, section ".my_const" +//CHECK: @unreferenced = dso_local constant i32 0, section "read_flag_section" +//CHECK: @referenced = dso_local constant i32 42, section "read_flag_section" +//CHECK: @implicitly_read_write = dso_local global i32 42, section "no_section_attributes" +//CHECK: @long_var = dso_local global i32 42, section "long_section" +//CHECK: @short_var = dso_local global i16 42, section "short_section" +//CHECK: define dso_local void @g() +//CHECK: define dso_local void @h() {{.*}} section ".my_code" +//CHECK: define dso_local void @h2() {{.*}} section ".my_code" diff --git a/test/CodeGenCXX/specialized-static-data-mem-init.cpp b/test/CodeGenCXX/specialized-static-data-mem-init.cpp index 68799624f26e6..d793242be1a0a 100644 --- a/test/CodeGenCXX/specialized-static-data-mem-init.cpp +++ b/test/CodeGenCXX/specialized-static-data-mem-init.cpp @@ -2,8 +2,8 @@ // rdar: // 8562966 // pr8409 -// CHECK: @_ZN1CIiE11needs_guardE = linkonce_odr global -// CHECK: @_ZGVN1CIiE11needs_guardE = linkonce_odr global +// CHECK: @_ZN1CIiE11needs_guardE = linkonce_odr {{(dso_local )?}}global +// CHECK: @_ZGVN1CIiE11needs_guardE = linkonce_odr {{(dso_local )?}}global struct K { diff --git a/test/CodeGenCXX/split-stacks.cpp b/test/CodeGenCXX/split-stacks.cpp index 76e1b79b8f1a9..2373bcc982f51 100644 --- a/test/CodeGenCXX/split-stacks.cpp +++ b/test/CodeGenCXX/split-stacks.cpp @@ -16,18 +16,18 @@ int nosplit() { return tnosplit<int>(); } -// CHECK-SEGSTK: define i32 @_Z3foov() [[SS:#[0-9]+]] { -// CHECK-SEGSTK: define i32 @_Z7nosplitv() [[NSS1:#[0-9]+]] { -// CHECK-SEGSTK: define linkonce_odr i32 @_Z8tnosplitIiEiv() [[NSS2:#[0-9]+]] comdat { +// CHECK-SEGSTK: define dso_local i32 @_Z3foov() [[SS:#[0-9]+]] { +// CHECK-SEGSTK: define dso_local i32 @_Z7nosplitv() [[NSS1:#[0-9]+]] { +// CHECK-SEGSTK: define linkonce_odr dso_local i32 @_Z8tnosplitIiEiv() [[NSS2:#[0-9]+]] comdat { // CHECK-SEGSTK-NOT: [[NSS1]] = { {{.*}} "split-stack" {{.*}} } // CHECK-SEGSTK-NOT: [[NSS2]] = { {{.*}} "split-stack" {{.*}} } // CHECK-SEGSTK: [[SS]] = { {{.*}} "split-stack" {{.*}} } // CHECK-SEGSTK-NOT: [[NSS1]] = { {{.*}} "split-stack" {{.*}} } // CHECK-SEGSTK-NOT: [[NSS2]] = { {{.*}} "split-stack" {{.*}} } -// CHECK-NOSEGSTK: define i32 @_Z3foov() [[NSS0:#[0-9]+]] { -// CHECK-NOSEGSTK: define i32 @_Z7nosplitv() [[NSS1:#[0-9]+]] { -// CHECK-NOSEGSTK: define linkonce_odr i32 @_Z8tnosplitIiEiv() [[NSS2:#[0-9]+]] comdat { +// CHECK-NOSEGSTK: define dso_local i32 @_Z3foov() [[NSS0:#[0-9]+]] { +// CHECK-NOSEGSTK: define dso_local i32 @_Z7nosplitv() [[NSS1:#[0-9]+]] { +// CHECK-NOSEGSTK: define linkonce_odr dso_local i32 @_Z8tnosplitIiEiv() [[NSS2:#[0-9]+]] comdat { // CHECK-NOSEGSTK-NOT: [[NSS1]] = { {{.*}} "split-stack" {{.*}} } // CHECK-NOSEGSTK-NOT: [[NSS2]] = { {{.*}} "split-stack" {{.*}} } // CHECK-NOSEGSTK-NOT: [[NSS3]] = { {{.*}} "split-stack" {{.*}} } diff --git a/test/CodeGenCXX/stack-reuse-exceptions.cpp b/test/CodeGenCXX/stack-reuse-exceptions.cpp new file mode 100644 index 0000000000000..de870c5305048 --- /dev/null +++ b/test/CodeGenCXX/stack-reuse-exceptions.cpp @@ -0,0 +1,189 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu %s -o - -emit-llvm -O1 \ +// RUN: -fexceptions -fcxx-exceptions | FileCheck %s +// +// We should emit lifetime.ends for these temporaries in both the 'exception' +// and 'normal' paths in functions. +// +// -O1 is necessary to make lifetime markers appear. + +struct Large { + int cs[32]; +}; + +Large getLarge(); + +// Used to ensure we emit invokes. +struct NontrivialDtor { + int i; + ~NontrivialDtor(); +}; + +// CHECK-LABEL: define void @_Z33cleanupsAreEmittedWithoutTryCatchv +void cleanupsAreEmittedWithoutTryCatch() { +// CHECK: %[[CLEAN:[^ ]+]] = bitcast %struct.NontrivialDtor* %{{[^ ]+}} to i8* +// CHECK: call void @llvm.lifetime.start.p0i8({{[^,]+}}, i8* nonnull %[[CLEAN]]) +// CHECK: %[[T1:[^ ]+]] = bitcast %struct.Large* %{{[^ ]+}} to i8* +// CHECK: call void @llvm.lifetime.start.p0i8({{[^,]+}}, i8* nonnull %[[T1]]) +// CHECK-NEXT: invoke void @_Z8getLargev +// CHECK-NEXT: to label %[[CONT:[^ ]+]] unwind label %[[LPAD:[^ ]+]] +// +// CHECK: [[CONT]]: +// CHECK: call void @llvm.lifetime.end.p0i8({{[^,]+}}, i8* nonnull %[[T1]]) +// CHECK: %[[T2:[^ ]+]] = bitcast %struct.Large* %{{[^ ]+}} to i8* +// CHECK: call void @llvm.lifetime.start.p0i8({{[^,]+}}, i8* nonnull %[[T2]]) +// CHECK-NEXT: invoke void @_Z8getLargev +// CHECK-NEXT: to label %[[CONT2:[^ ]+]] unwind label %[[LPAD2:.+]] +// +// CHECK: [[CONT2]]: +// CHECK: call void @llvm.lifetime.end.p0i8({{[^,]+}}, i8* nonnull %[[T2]]) +// CHECK: call void @llvm.lifetime.end.p0i8({{[^,]+}}, i8* nonnull %[[CLEAN]]) +// CHECK: ret void +// +// CHECK: [[LPAD]]: +// CHECK: call void @llvm.lifetime.end.p0i8({{[^,]+}}, i8* nonnull %[[T1]]) +// CHECK: br label %[[EHCLEANUP:.+]] +// +// CHECK: [[LPAD2]]: +// CHECK: call void @llvm.lifetime.end.p0i8({{[^,]+}}, i8* nonnull %[[T2]]) +// CHECK: br label %[[EHCLEANUP]] +// +// CHECK: [[EHCLEANUP]]: +// CHECK: call void @llvm.lifetime.end.p0i8({{[^,]+}}, i8* nonnull %[[CLEAN]]) + + NontrivialDtor clean; + + getLarge(); + getLarge(); +} + +// CHECK-LABEL: define void @_Z30cleanupsAreEmittedWithTryCatchv +void cleanupsAreEmittedWithTryCatch() { +// CHECK: %[[CLEAN:[^ ]+]] = bitcast %struct.NontrivialDtor* %{{[^ ]+}} to i8* +// CHECK: call void @llvm.lifetime.start.p0i8({{[^,]+}}, i8* nonnull %[[CLEAN]]) +// CHECK: %[[T1:[^ ]+]] = bitcast %struct.Large* %{{[^ ]+}} to i8* +// CHECK: call void @llvm.lifetime.start.p0i8({{[^,]+}}, i8* nonnull %[[T1]]) +// CHECK-NEXT: invoke void @_Z8getLargev +// CHECK-NEXT: to label %[[CONT:[^ ]+]] unwind label %[[LPAD:[^ ]+]] +// +// CHECK: [[CONT]]: +// CHECK: call void @llvm.lifetime.end.p0i8({{[^,]+}}, i8* nonnull %[[T1]]) +// CHECK: %[[T2:[^ ]+]] = bitcast %struct.Large* %{{[^ ]+}} to i8* +// CHECK: call void @llvm.lifetime.start.p0i8({{[^,]+}}, i8* nonnull %[[T2]]) +// CHECK-NEXT: invoke void @_Z8getLargev +// CHECK-NEXT: to label %[[CONT2:[^ ]+]] unwind label %[[LPAD2:.+]] +// +// CHECK: [[CONT2]]: +// CHECK: call void @llvm.lifetime.end.p0i8({{[^,]+}}, i8* nonnull %[[T2]]) +// CHECK: br label %[[TRY_CONT:.+]] +// +// CHECK: [[LPAD]]: +// CHECK: call void @llvm.lifetime.end.p0i8({{[^,]+}}, i8* nonnull %[[T1]]) +// CHECK: br label %[[CATCH:.+]] +// +// CHECK: [[LPAD2]]: +// CHECK: call void @llvm.lifetime.end.p0i8({{[^,]+}}, i8* nonnull %[[T2]]) +// CHECK: br label %[[CATCH]] +// +// CHECK: [[CATCH]]: +// CHECK-NOT: call void @llvm.lifetime +// CHECK: invoke void +// CHECK-NEXT: to label %[[TRY_CONT]] unwind label %[[OUTER_LPAD:.+]] +// +// CHECK: [[TRY_CONT]]: +// CHECK: %[[T_OUTER:[^ ]+]] = bitcast %struct.Large* %{{[^ ]+}} to i8* +// CHECK: call void @llvm.lifetime.start.p0i8({{[^,]+}}, i8* nonnull %[[T_OUTER]]) +// CHECK-NEXT: invoke void @_Z8getLargev +// CHECK-NEXT: to label %[[OUTER_CONT:[^ ]+]] unwind label %[[OUTER_LPAD2:.+]] +// +// CHECK: [[OUTER_CONT]]: +// CHECK: call void @llvm.lifetime.end.p0i8({{[^,]+}}, i8* nonnull %[[T_OUTER]]) +// CHECK: call void @llvm.lifetime.end.p0i8({{[^,]+}}, i8* nonnull %[[CLEAN]]) +// CHECK: ret void +// +// CHECK: [[OUTER_LPAD]]: +// CHECK-NOT: call void @llvm.lifetime +// CHECK: br label %[[EHCLEANUP:.+]] +// +// CHECK: [[OUTER_LPAD2]]: +// CHECK: call void @llvm.lifetime.end.p0i8({{[^,]+}}, i8* nonnull %[[T_OUTER]]) +// CHECK: br label %[[EHCLEANUP]] +// +// CHECK: [[EHCLEANUP]]: +// CHECK: call void @llvm.lifetime.end.p0i8({{[^,]+}}, i8* nonnull %[[CLEAN]]) + + NontrivialDtor clean; + + try { + getLarge(); + getLarge(); + } catch (...) {} + + getLarge(); +} + +// CHECK-LABEL: define void @_Z39cleanupInTryHappensBeforeCleanupInCatchv +void cleanupInTryHappensBeforeCleanupInCatch() { +// CHECK: %[[T1:[^ ]+]] = bitcast %struct.Large* %{{[^ ]+}} to i8* +// CHECK: call void @llvm.lifetime.start.p0i8({{[^,]+}}, i8* nonnull %[[T1]]) +// CHECK-NEXT: invoke void @_Z8getLargev +// CHECK-NEXT: to label %[[CONT:[^ ]+]] unwind label %[[LPAD:[^ ]+]] +// +// CHECK: [[CONT]]: +// CHECK: call void @llvm.lifetime.end.p0i8({{[^,]+}}, i8* nonnull %[[T1]]) +// CHECK: br label %[[TRY_CONT]] +// +// CHECK: [[LPAD]]: +// CHECK: call void @llvm.lifetime.end.p0i8({{[^,]+}}, i8* nonnull %[[T1]]) +// CHECK: br i1 {{[^,]+}}, label %[[CATCH_INT_MATCH:[^,]+]], label %[[CATCH_ALL:.+]] +// +// CHECK: [[CATCH_INT_MATCH]]: +// CHECK: %[[T2:[^ ]+]] = bitcast %struct.Large* %{{[^ ]+}} to i8* +// CHECK: call void @llvm.lifetime.start.p0i8({{[^,]+}}, i8* nonnull %[[T2]]) +// CHECK-NEXT: invoke void @_Z8getLargev +// CHECK-NEXT: to label %[[CATCH_INT_CONT:[^ ]+]] unwind label %[[CATCH_INT_LPAD:[^ ]+]] +// +// CHECK: [[CATCH_INT_CONT]]: +// CHECK: call void @llvm.lifetime.end.p0i8({{[^,]+}}, i8* nonnull %[[T2]]) +// CHECK: br label %[[TRY_CONT]] +// +// CHECK: [[TRY_CONT]]: +// CHECK: ret void +// +// CHECK: [[CATCH_ALL]]: +// CHECK: %[[T3:[^ ]+]] = bitcast %struct.Large* %{{[^ ]+}} to i8* +// CHECK: call void @llvm.lifetime.start.p0i8({{[^,]+}}, i8* nonnull %[[T3]]) +// CHECK-NEXT: invoke void @_Z8getLargev +// CHECK-NEXT: to label %[[CATCH_ALL_CONT:[^ ]+]] unwind label %[[CATCH_ALL_LPAD:[^ ]+]] +// +// CHECK: [[CATCH_ALL_CONT]]: +// CHECK: call void @llvm.lifetime.end.p0i8({{[^,]+}}, i8* nonnull %[[T3]]) +// CHECK: br label %[[TRY_CONT]] +// +// CHECK: [[CATCH_ALL_LPAD]]: +// CHECK: call void @llvm.lifetime.end.p0i8({{[^,]+}}, i8* nonnull %[[T3]]) +// +// CHECK: [[CATCH_INT_LPAD]]: +// CHECK: call void @llvm.lifetime.end.p0i8({{[^,]+}}, i8* nonnull %[[T2]]) +// CHECK-NOT: call void @llvm.lifetime + + try { + getLarge(); + } catch (const int &) { + getLarge(); + } catch (...) { + getLarge(); + } +} + +// FIXME: We don't currently emit lifetime markers for aggregate by-value +// temporaries (e.g. given a function `Large combine(Large, Large);` +// combine(getLarge(), getLarge()) "leaks" two `Large`s). We probably should. We +// also don't emit markers for things like: +// +// { +// Large L = getLarge(); +// combine(L, L); +// } +// +// Though this arguably isn't as bad, since we pass a pointer to `L` as one of +// the two args. diff --git a/test/CodeGenCXX/stack-reuse-miscompile.cpp b/test/CodeGenCXX/stack-reuse-miscompile.cpp index 3b860a573955a..4e824d94f510e 100644 --- a/test/CodeGenCXX/stack-reuse-miscompile.cpp +++ b/test/CodeGenCXX/stack-reuse-miscompile.cpp @@ -1,8 +1,4 @@ -// RUN: %clang_cc1 -triple armv7l-unknown-linux-gnueabihf -emit-llvm -O1 -disable-llvm-passes -std=c++03 %s -o - | FileCheck %s - -// This test should not to generate llvm.lifetime.start/llvm.lifetime.end for -// f function because all temporary objects in this function are used for the -// final result +// RUN: %clang_cc1 -triple armv7l-unknown-linux-gnueabihf -emit-llvm -O1 -disable-llvm-passes -std=c++03 %s -o - | FileCheck %s --implicit-check-not=llvm.lifetime class S { char *ptr; @@ -23,14 +19,36 @@ public: const char * f(S s) { +// It's essential that the lifetimes of all three T temporaries here are +// overlapping. They must all remain alive through the call to str(). +// // CHECK: [[T1:%.*]] = alloca %class.T, align 4 // CHECK: [[T2:%.*]] = alloca %class.T, align 4 // CHECK: [[T3:%.*]] = alloca %class.T, align 4 -// CHECK: [[T4:%.*]] = call %class.T* @_ZN1TC1EPKc(%class.T* [[T1]], i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0)) -// CHECK: [[T5:%.*]] = call %class.T* @_ZN1TC1E1S(%class.T* [[T2]], [2 x i32] %{{.*}}) -// CHECK: call void @_ZNK1T6concatERKS_(%class.T* sret [[T3]], %class.T* [[T1]], %class.T* dereferenceable(16) [[T2]]) -// CHECK: [[T6:%.*]] = call i8* @_ZNK1T3strEv(%class.T* [[T3]]) +// +// FIXME: We could defer starting the lifetime of the return object of concat +// until the call. +// CHECK: [[T1i8:%.*]] = bitcast %class.T* [[T1]] to i8* +// CHECK: call void @llvm.lifetime.start.p0i8(i64 16, i8* [[T1i8]]) +// +// CHECK: [[T2i8:%.*]] = bitcast %class.T* [[T2]] to i8* +// CHECK: call void @llvm.lifetime.start.p0i8(i64 16, i8* [[T2i8]]) +// CHECK: [[T4:%.*]] = call %class.T* @_ZN1TC1EPKc(%class.T* [[T2]], i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0)) +// +// CHECK: [[T3i8:%.*]] = bitcast %class.T* [[T3]] to i8* +// CHECK: call void @llvm.lifetime.start.p0i8(i64 16, i8* [[T3i8]]) +// CHECK: [[T5:%.*]] = call %class.T* @_ZN1TC1E1S(%class.T* [[T3]], [2 x i32] %{{.*}}) +// +// CHECK: call void @_ZNK1T6concatERKS_(%class.T* sret [[T1]], %class.T* [[T2]], %class.T* dereferenceable(16) [[T3]]) +// CHECK: [[T6:%.*]] = call i8* @_ZNK1T3strEv(%class.T* [[T1]]) +// +// CHECK: call void @llvm.lifetime.end.p0i8( +// CHECK: call void @llvm.lifetime.end.p0i8( +// CHECK: call void @llvm.lifetime.end.p0i8( // CHECK: ret i8* [[T6]] return T("[").concat(T(s)).str(); } + +// CHECK: declare {{.*}}llvm.lifetime.start +// CHECK: declare {{.*}}llvm.lifetime.end diff --git a/test/CodeGenCXX/strict-vtable-pointers.cpp b/test/CodeGenCXX/strict-vtable-pointers.cpp index c45e7a60fa8f3..098c779895067 100644 --- a/test/CodeGenCXX/strict-vtable-pointers.cpp +++ b/test/CodeGenCXX/strict-vtable-pointers.cpp @@ -5,7 +5,8 @@ // RUN: FileCheck --check-prefix=CHECK-LINK-REQ %s < %t.ll typedef __typeof__(sizeof(0)) size_t; -void *operator new(size_t, void*) throw(); +void *operator new(size_t, void *) throw(); +using uintptr_t = unsigned long long; struct NotTrivialDtor { ~NotTrivialDtor(); @@ -17,7 +18,7 @@ struct DynamicBase1 { }; struct DynamicDerived : DynamicBase1 { - void foo(); + void foo() override; }; struct DynamicBase2 { @@ -28,8 +29,8 @@ struct DynamicBase2 { }; struct DynamicDerivedMultiple : DynamicBase1, DynamicBase2 { - virtual void foo(); - virtual void bar(); + void foo() override; + void bar() override; }; struct StaticBase { @@ -47,13 +48,12 @@ struct DynamicFromVirtualStatic1 : virtual StaticBase { struct DynamicFromVirtualStatic2 : virtual StaticBase { }; -struct DynamicFrom2Virtuals : - DynamicFromVirtualStatic1, - DynamicFromVirtualStatic2 { +struct DynamicFrom2Virtuals : DynamicFromVirtualStatic1, + DynamicFromVirtualStatic2 { }; // CHECK-NEW-LABEL: define void @_Z12LocalObjectsv() -// CHECK-NEW-NOT: @llvm.invariant.group.barrier.p0i8( +// CHECK-NEW-NOT: @llvm.launder.invariant.group.p0i8( // CHECK-NEW-LABEL: {{^}}} void LocalObjects() { DynamicBase1 DB; @@ -81,20 +81,19 @@ void LocalObjects() { struct DynamicFromVirtualStatic1; // CHECK-CTORS-LABEL: define linkonce_odr void @_ZN25DynamicFromVirtualStatic1C1Ev -// CHECK-CTORS-NOT: @llvm.invariant.group.barrier.p0i8( +// CHECK-CTORS-NOT: @llvm.launder.invariant.group.p0i8( // CHECK-CTORS-LABEL: {{^}}} struct DynamicFrom2Virtuals; // CHECK-CTORS-LABEL: define linkonce_odr void @_ZN20DynamicFrom2VirtualsC1Ev -// CHECK-CTORS: call i8* @llvm.invariant.group.barrier.p0i8( +// CHECK-CTORS: call i8* @llvm.launder.invariant.group.p0i8( // CHECK-CTORS-LABEL: {{^}}} - // CHECK-NEW-LABEL: define void @_Z9Pointers1v() -// CHECK-NEW-NOT: @llvm.invariant.group.barrier.p0i8( +// CHECK-NEW-NOT: @llvm.launder.invariant.group.p0i8( // CHECK-NEW-LABEL: call void @_ZN12DynamicBase1C1Ev( -// CHECK-NEW: %[[THIS3:.*]] = call i8* @llvm.invariant.group.barrier.p0i8(i8* %[[THIS2:.*]]) +// CHECK-NEW: %[[THIS3:.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* %[[THIS2:.*]]) // CHECK-NEW: %[[THIS4:.*]] = bitcast i8* %[[THIS3]] to %[[DynamicDerived:.*]]* // CHECK-NEW: call void @_ZN14DynamicDerivedC1Ev(%[[DynamicDerived:.*]]* %[[THIS4]]) // CHECK-NEW-LABEL: {{^}}} @@ -109,9 +108,9 @@ void Pointers1() { // CHECK-NEW-LABEL: define void @_Z14HackingObjectsv() // CHECK-NEW: call void @_ZN12DynamicBase1C1Ev -// CHECK-NEW: call i8* @llvm.invariant.group.barrier.p0i8( +// CHECK-NEW: call i8* @llvm.launder.invariant.group.p0i8( // CHECK-NEW: call void @_ZN14DynamicDerivedC1Ev( -// CHECK-NEW: call i8* @llvm.invariant.group.barrier.p0i8( +// CHECK-NEW: call i8* @llvm.launder.invariant.group.p0i8( // CHECK-NEW: call void @_ZN12DynamicBase1C1Ev( // CHECK-NEW-LABEL: {{^}}} void HackingObjects() { @@ -131,16 +130,15 @@ void HackingObjects() { /*** Testing Constructors ***/ struct DynamicBase1; // CHECK-CTORS-LABEL: define linkonce_odr void @_ZN12DynamicBase1C2Ev( -// CHECK-CTORS-NOT: call i8* @llvm.invariant.group.barrier.p0i8( +// CHECK-CTORS-NOT: call i8* @llvm.launder.invariant.group.p0i8( // CHECK-CTORS-LABEL: {{^}}} - struct DynamicDerived; // CHECK-CTORS-LABEL: define linkonce_odr void @_ZN14DynamicDerivedC2Ev( // CHECK-CTORS: %[[THIS0:.*]] = load %[[DynamicDerived:.*]]*, %[[DynamicDerived]]** {{.*}} // CHECK-CTORS: %[[THIS1:.*]] = bitcast %[[DynamicDerived:.*]]* %[[THIS0]] to i8* -// CHECK-CTORS: %[[THIS2:.*]] = call i8* @llvm.invariant.group.barrier.p0i8(i8* %[[THIS1:.*]]) +// CHECK-CTORS: %[[THIS2:.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* %[[THIS1:.*]]) // CHECK-CTORS: %[[THIS3:.*]] = bitcast i8* %[[THIS2]] to %[[DynamicDerived]]* // CHECK-CTORS: %[[THIS4:.*]] = bitcast %[[DynamicDerived]]* %[[THIS3]] to %[[DynamicBase:.*]]* // CHECK-CTORS: call void @_ZN12DynamicBase1C2Ev(%[[DynamicBase]]* %[[THIS4]]) @@ -154,16 +152,15 @@ struct DynamicDerivedMultiple; // CHECK-CTORS: %[[THIS0:.*]] = load %[[CLASS:.*]]*, %[[CLASS]]** {{.*}} // CHECK-CTORS: %[[THIS1:.*]] = bitcast %[[CLASS:.*]]* %[[THIS0]] to i8* -// CHECK-CTORS: %[[THIS2:.*]] = call i8* @llvm.invariant.group.barrier.p0i8(i8* %[[THIS1]]) +// CHECK-CTORS: %[[THIS2:.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* %[[THIS1]]) // CHECK-CTORS: %[[THIS3:.*]] = bitcast i8* %[[THIS2]] to %[[CLASS]]* // CHECK-CTORS: %[[THIS4:.*]] = bitcast %[[CLASS]]* %[[THIS3]] to %[[BASE_CLASS:.*]]* // CHECK-CTORS: call void @_ZN12DynamicBase1C2Ev(%[[BASE_CLASS]]* %[[THIS4]]) -// CHECK-CTORS: call i8* @llvm.invariant.group.barrier.p0i8( +// CHECK-CTORS: call i8* @llvm.launder.invariant.group.p0i8( // CHECK-CTORS: call void @_ZN12DynamicBase2C2Ev( -// CHECK-CTORS-NOT: @llvm.invariant.group.barrier.p0i8 - +// CHECK-CTORS-NOT: @llvm.launder.invariant.group.p0i8 // CHECK-CTORS: %[[THIS10:.*]] = bitcast %struct.DynamicDerivedMultiple* %[[THIS0]] to i32 (...)*** // CHECK-CTORS: store {{.*}} @_ZTV22DynamicDerivedMultiple, i32 0, inrange i32 0, i32 2) {{.*}} %[[THIS10]] @@ -171,20 +168,20 @@ struct DynamicDerivedMultiple; // CHECK-CTORS: %[[THIS_ADD:.*]] = getelementptr inbounds i8, i8* %[[THIS11]], i64 16 // CHECK-CTORS: %[[THIS12:.*]] = bitcast i8* %[[THIS_ADD]] to i32 (...)*** - // CHECK-CTORS: store {{.*}} @_ZTV22DynamicDerivedMultiple, i32 0, inrange i32 1, i32 2) {{.*}} %[[THIS12]] // CHECK-CTORS-LABEL: {{^}}} struct DynamicFromStatic; // CHECK-CTORS-LABEL: define linkonce_odr void @_ZN17DynamicFromStaticC2Ev( -// CHECK-CTORS-NOT: @llvm.invariant.group.barrier.p0i8( +// CHECK-CTORS-NOT: @llvm.launder.invariant.group.p0i8( // CHECK-CTORS-LABEL: {{^}}} struct A { virtual void foo(); + int m; }; struct B : A { - virtual void foo(); + void foo() override; }; union U { @@ -206,15 +203,15 @@ void g2(A *a) { void UnionsBarriers(U *u) { // CHECK-NEW: call void @_Z9changeToBP1U( changeToB(u); - // CHECK-NEW: call i8* @llvm.invariant.group.barrier.p0i8(i8* + // CHECK-NEW: call i8* @llvm.launder.invariant.group.p0i8(i8* // CHECK-NEW: call void @_Z2g2P1A(%struct.A* g2(&u->b); - // CHECK-NEW: call void @_Z9changeToAP1U(%union.U* + // CHECK-NEW: call void @_Z9changeToAP1U(%union.U* changeToA(u); - // CHECK-NEW: call i8* @llvm.invariant.group.barrier.p0i8(i8* + // CHECK-NEW: call i8* @llvm.launder.invariant.group.p0i8(i8* // call void @_Z2g2P1A(%struct.A* %a) g2(&u->a); - // CHECK-NEW-NOT: call i8* @llvm.invariant.group.barrier.p0i8(i8* + // CHECK-NEW-NOT: call i8* @llvm.launder.invariant.group.p0i8(i8* } struct HoldingVirtuals { @@ -233,10 +230,10 @@ void take(AnotherEmpty &); // CHECK-NEW-LABEL: noBarriers void noBarriers(NoVptrs &noVptrs) { - // CHECK-NEW-NOT: call i8* @llvm.invariant.group.barrier.p0i8(i8* + // CHECK-NEW-NOT: call i8* @llvm.launder.invariant.group.p0i8(i8* // CHECK-NEW: 42 noVptrs.a += 42; - // CHECK-NEW-NOT: call i8* @llvm.invariant.group.barrier.p0i8(i8* + // CHECK-NEW-NOT: call i8* @llvm.launder.invariant.group.p0i8(i8* // CHECK-NEW: call void @_Z4takeR12AnotherEmpty( take(noVptrs.empty); } @@ -249,10 +246,10 @@ void take(HoldingVirtuals &); // CHECK-NEW-LABEL: define void @_Z15UnionsBarriers2R2U2 void UnionsBarriers2(U2 &u) { - // CHECK-NEW-NOT: call i8* @llvm.invariant.group.barrier.p0i8(i8* + // CHECK-NEW-NOT: call i8* @llvm.launder.invariant.group.p0i8(i8* // CHECK-NEW: 42 u.z += 42; - // CHECK-NEW: call i8* @llvm.invariant.group.barrier.p0i8(i8* + // CHECK-NEW: call i8* @llvm.launder.invariant.group.p0i8(i8* // CHECK-NEW: call void @_Z4takeR15HoldingVirtuals( take(u.h); } @@ -279,54 +276,318 @@ void take(VirtualInVBase &); void take(VirtualInheritance &); void UnionsBarrier3(U3 &u) { - // CHECK-NEW-NOT: call i8* @llvm.invariant.group.barrier.p0i8(i8* + // CHECK-NEW-NOT: call i8* @llvm.launder.invariant.group.p0i8(i8* // CHECK-NEW: 42 u.z += 42; - // CHECK-NEW: call i8* @llvm.invariant.group.barrier.p0i8(i8* + // CHECK-NEW: call i8* @llvm.launder.invariant.group.p0i8(i8* // CHECK-NEW: call void @_Z4takeR13VirtualInBase( take(u.v1); - // CHECK-NEW: call i8* @llvm.invariant.group.barrier.p0i8(i8* + // CHECK-NEW: call i8* @llvm.launder.invariant.group.p0i8(i8* // CHECK-NEW: call void @_Z4takeR13VirtualInBase( take(u.v2); - // CHECK-NEW: call i8* @llvm.invariant.group.barrier.p0i8(i8* + // CHECK-NEW: call i8* @llvm.launder.invariant.group.p0i8(i8* // CHECK-NEW: call void @_Z4takeR18VirtualInheritance( take(u.v3); } +// CHECK-NEW-LABEL: define void @_Z7comparev() +void compare() { + A *a = new A; + a->foo(); + // CHECK-NEW: call i8* @llvm.launder.invariant.group.p0i8(i8* + A *b = new (a) B; + + // CHECK-NEW: %[[a:.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* + // CHECK-NEW: %[[a2:.*]] = bitcast i8* %[[a]] to %struct.A* + // CHECK-NEW: %[[b:.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* + // CHECK-NEW: %[[b2:.*]] = bitcast i8* %[[b]] to %struct.A* + // CHECK-NEW: %cmp = icmp eq %struct.A* %[[a2]], %[[b2]] + if (a == b) + b->foo(); +} + +// CHECK-NEW-LABEL: compare2 +bool compare2(A *a, A *a2) { + // CHECK-NEW: %[[a:.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* + // CHECK-NEW: %[[a2:.*]] = bitcast i8* %[[a]] to %struct.A* + // CHECK-NEW: %[[b:.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* + // CHECK-NEW: %[[b2:.*]] = bitcast i8* %[[b]] to %struct.A* + // CHECK-NEW: %cmp = icmp ult %struct.A* %[[a2]], %[[b2]] + return a < a2; +} +// CHECK-NEW-LABEL: compareIntPointers +bool compareIntPointers(int *a, int *b) { + // CHECK-NEW-NOT: call i8* @llvm.strip.invariant.group + return a == b; +} + +struct HoldingOtherVirtuals { + B b; +}; + +// There is no need to add barriers for comparision of pointer to classes +// that are not dynamic. +// CHECK-NEW-LABEL: compare5 +bool compare5(HoldingOtherVirtuals *a, HoldingOtherVirtuals *b) { + // CHECK-NEW-NOT: call i8* @llvm.strip.invariant.group + return a == b; +} +// CHECK-NEW-LABEL: compareNull +bool compareNull(A *a) { + // CHECK-NEW-NOT: call i8* @llvm.strip.invariant.group + + if (a != nullptr) + return false; + if (!a) + return false; + return a == nullptr; +} + +struct X; +// We have to also introduce the barriers if comparing pointers to incomplete +// objects +// CHECK-NEW-LABEL: define zeroext i1 @_Z8compare4P1XS0_ +bool compare4(X *x, X *x2) { + // CHECK-NEW: %[[x:.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* + // CHECK-NEW: %[[xp:.*]] = bitcast i8* %[[x]] to %struct.X* + // CHECK-NEW: %[[x2:.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* + // CHECK-NEW: %[[x2p:.*]] = bitcast i8* %[[x2]] to %struct.X* + // CHECK-NEW: %cmp = icmp eq %struct.X* %[[xp]], %[[x2p]] + return x == x2; +} + +// CHECK-NEW-LABEL: define void @_Z7member1P20HoldingOtherVirtuals( +void member1(HoldingOtherVirtuals *p) { + + // CHECK-NEW-NOT: call i8* @llvm.strip.invariant.group.p0i8( + (void)p->b; +} + +// CHECK-NEW-LABEL: member2 +void member2(A *a) { + // CHECK-NEW: call i8* @llvm.strip.invariant.group.p0i8 + (void)a->m; +} + +// Check if from comparison of addresses of member we can't infer the equality +// of ap and bp. +// CHECK-NEW-LABEL: @_Z18testCompareMembersv( +void testCompareMembers() { + // CHECK-NEW: [[AP:%.*]] = alloca %struct.A* + // CHECK-NEW: [[APM:%.*]] = alloca i32* + // CHECK-NEW: [[BP:%.*]] = alloca %struct.B* + // CHECK-NEW: [[BPM:%.*]] = alloca i32* + + A *ap = new A; + // CHECK-NEW: call void %{{.*}}(%struct.A* %{{.*}}) + ap->foo(); + // CHECK-NEW: [[TMP7:%.*]] = load %struct.A*, %struct.A** [[AP]] + // CHECK-NEW: [[TMP8:%.*]] = bitcast %struct.A* [[TMP7]] to i8* + // CHECK-NEW: [[TMP9:%.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* [[TMP8]]) + // CHECK-NEW: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to %struct.A* + // CHECK-NEW: [[M:%.*]] = getelementptr inbounds [[STRUCT_A:%.*]], %struct.A* [[TMP10]], i32 0, i32 1 + // CHECK-NEW: store i32* [[M]], i32** [[APM]] + int *const apm = &ap->m; + + B *bp = new (ap) B; + + // CHECK-NEW: [[TMP20:%.*]] = load %struct.B*, %struct.B** [[BP]] + // CHECK-NEW: [[TMP21:%.*]] = bitcast %struct.B* [[TMP20]] to %struct.A* + // CHECK-NEW: [[TMP22:%.*]] = bitcast %struct.A* [[TMP21]] to i8* + // CHECK-NEW: [[TMP23:%.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* [[TMP22]]) + // CHECK-NEW: [[TMP24:%.*]] = bitcast i8* [[TMP23]] to %struct.A* + // CHECK-NEW: [[M4:%.*]] = getelementptr inbounds [[STRUCT_A]], %struct.A* [[TMP24]], i32 0, i32 1 + // CHECK-NEW: store i32* [[M4]], i32** [[BPM]] + int *const bpm = &bp->m; + + // CHECK-NEW: [[TMP25:%.*]] = load i32*, i32** [[APM]] + // CHECK-NEW: [[TMP26:%.*]] = load i32*, i32** [[BPM]] + // CHECK-NEW-NOT: strip.invariant.group + // CHECK-NEW-NOT: launder.invariant.group + // CHECK-NEW: [[CMP:%.*]] = icmp eq i32* [[TMP25]], [[TMP26]] + if (apm == bpm) { + bp->foo(); + } +} + +// CHECK-NEW-LABEL: define void @_Z9testCast1P1A(%struct.A* +void testCast1(A *a) { + // Here we get rid of dynamic info + // CHECK-NEW: call i8* @llvm.strip.invariant.group + auto *v = (void *)a; + + // CHECK-NEW: call i8* @llvm.strip.invariant.group + auto i2 = (uintptr_t)a; + (void)i2; + + // CHECK-NEW-NOT: @llvm.strip.invariant.group + // CHECK-NEW-NOT: @llvm.launder.invariant.group + + // The information is already stripped + auto i = (uintptr_t)v; +} + +struct Incomplete; +// CHECK-NEW-LABEL: define void @_Z9testCast2P10Incomplete(%struct.Incomplete* +void testCast2(Incomplete *I) { + // Here we get rid of potential dynamic info + // CHECK-NEW: call i8* @llvm.strip.invariant.group + auto *v = (void *)I; + + // CHECK-NEW: call i8* @llvm.strip.invariant.group + auto i2 = (uintptr_t)I; + (void)i2; + + // CHECK-NEW-NOT: @llvm.strip.invariant.group + // CHECK-NEW-NOT: @llvm.launder.invariant.group + + // The information is already stripped + auto i = (uintptr_t)v; +} + +// CHECK-NEW-LABEL: define void @_Z9testCast3y( +void testCast3(uintptr_t i) { + // CHECK-NEW-NOT: @llvm.strip.invariant.group + // CHECK-NEW: @llvm.launder.invariant.group + A *a3 = (A *)i; + (void)a3; + + auto *v2 = (void *)i; + + // CHECK-NEW: @llvm.launder.invariant.group + A *a2 = (A *)v2; + (void)a2; + + // CHECK-NEW-NOT: @llvm.launder.invariant.group + auto *v3 = (void *)i; + (void)v3; +} + +// CHECK-NEW-LABEL: define void @_Z9testCast4y( +void testCast4(uintptr_t i) { + // CHECK-NEW-NOT: @llvm.strip.invariant.group + // CHECK-NEW: @llvm.launder.invariant.group + auto *a3 = (Incomplete *)i; + (void)a3; + + // CHECK-NEW: @llvm.launder.invariant.group + auto *v2 = (void *)i; + // CHECK-NEW-NOT: @llvm.launder.invariant.group + auto *a2 = (Incomplete *)v2; + (void)a2; +} + +// CHECK-NEW-LABEL: define void @_Z9testCast5P1B( +void testCast5(B *b) { + // CHECK-NEW-NOT: @llvm.strip.invariant.group + // CHECK-NEW-NOT: @llvm.launder.invariant.group + A *a = b; + (void)a; + + auto *b2 = (B *)a; + (void)b2; +} + +// CHECK-NEW-LABEL: define void @_Z9testCast6P1A( +void testCast6(A *a) { + + // CHECK-NEW: @llvm.strip.invariant.group + auto *I = (Incomplete *)a; + (void)I; + // CHECK-NEW: @llvm.launder.invariant.group + auto *a2 = (A *)I; + (void)a2; + + // CHECK-NEW: @llvm.strip.invariant.group + auto *E = (Empty *)a; + (void)E; + + // CHECK-NEW: @llvm.launder.invariant.group + auto *a3 = (A *)E; + (void)a3; + + // CHECK-NEW-NOT: @llvm.strip.invariant.group + auto i = (uintptr_t)E; + (void)i; +} + +class Incomplete2; +// CHECK-NEW-LABEL: define void @_Z9testCast7P10Incomplete( +void testCast7(Incomplete *I) { + // CHECK-NEW-NOT: @llvm.strip.invariant.group + + // Incomplete2 could be dynamic where Incomplete may not be dynamic, thus + // launder is needed. We don't strip firstly because launder is sufficient. + + // CHECK-NEW: @llvm.launder.invariant.group + auto *I2 = (Incomplete2 *)I; + (void)I2; + // CHECK-NEW-LABEL: ret void +} + +template <typename Base> +struct PossiblyDerivingFromDynamicBase : Base { +}; + +// CHECK-NEW-LABEL: define void @_Z9testCast8P10Incomplete( +void testCast8(Incomplete *I) { + // CHECK-NEW-NOT: @llvm.strip.invariant.group + // CHECK-NEW: @llvm.launder.invariant.group + auto *P = (PossiblyDerivingFromDynamicBase<Incomplete> *)I; + (void)P; + + // CHECK-NEW: @llvm.launder.invariant.group + auto *P2 = (PossiblyDerivingFromDynamicBase<Empty> *)I; + (void)P2; + + // CHECK-NEW: @llvm.launder.invariant.group + auto *P3 = (PossiblyDerivingFromDynamicBase<A> *)I; + (void)P3; + + // CHECK-NEW-NOT: @llvm.launder.invariant.group + auto *a3 = (A *)P3; + + // CHECK-NEW-LABEL: ret void +} + +// CHECK-NEW-LABEL: define void @_Z9testCast9 +void testCast9(PossiblyDerivingFromDynamicBase<Incomplete> *P) { + // CHECK-NEW: @llvm.strip.invariant.group + auto *V = (void *)P; + + // CHECK-NEW-LABEL: ret void +} + /** DTORS **/ // CHECK-DTORS-LABEL: define linkonce_odr void @_ZN10StaticBaseD2Ev( -// CHECK-DTORS-NOT: call i8* @llvm.invariant.group.barrier.p0i8( +// CHECK-DTORS-NOT: call i8* @llvm.launder.invariant.group.p0i8( // CHECK-DTORS-LABEL: {{^}}} - // CHECK-DTORS-LABEL: define linkonce_odr void @_ZN25DynamicFromVirtualStatic2D2Ev( // CHECK-DTORS-NOT: invariant.barrier // CHECK-DTORS-LABEL: {{^}}} // CHECK-DTORS-LABEL: define linkonce_odr void @_ZN17DynamicFromStaticD2Ev -// CHECK-DTORS-NOT: call i8* @llvm.invariant.group.barrier.p0i8( +// CHECK-DTORS-NOT: call i8* @llvm.launder.invariant.group.p0i8( // CHECK-DTORS-LABEL: {{^}}} - // CHECK-DTORS-LABEL: define linkonce_odr void @_ZN22DynamicDerivedMultipleD2Ev( // CHECK-DTORS-LABEL: define linkonce_odr void @_ZN12DynamicBase2D2Ev( -// CHECK-DTORS: call i8* @llvm.invariant.group.barrier.p0i8( +// CHECK-DTORS: call i8* @llvm.launder.invariant.group.p0i8( // CHECK-DTORS-LABEL: {{^}}} // CHECK-DTORS-LABEL: define linkonce_odr void @_ZN12DynamicBase1D2Ev -// CHECK-DTORS: call i8* @llvm.invariant.group.barrier.p0i8( +// CHECK-DTORS: call i8* @llvm.launder.invariant.group.p0i8( // CHECK-DTORS-LABEL: {{^}}} // CHECK-DTORS-LABEL: define linkonce_odr void @_ZN14DynamicDerivedD2Ev -// CHECK-DTORS-NOT: call i8* @llvm.invariant.group.barrier.p0i8( +// CHECK-DTORS-NOT: call i8* @llvm.launder.invariant.group.p0i8( // CHECK-DTORS-LABEL: {{^}}} - // CHECK-LINK-REQ: !llvm.module.flags = !{![[FIRST:[0-9]+]], ![[SEC:[0-9]+]]{{.*}}} // CHECK-LINK-REQ: ![[FIRST]] = !{i32 1, !"StrictVTablePointers", i32 1} // CHECK-LINK-REQ: ![[SEC]] = !{i32 3, !"StrictVTablePointersRequirement", ![[META:.*]]} // CHECK-LINK-REQ: ![[META]] = !{!"StrictVTablePointers", i32 1} - diff --git a/test/CodeGenCXX/tail-padding.cpp b/test/CodeGenCXX/tail-padding.cpp new file mode 100644 index 0000000000000..b8b9e4ccf9a71 --- /dev/null +++ b/test/CodeGenCXX/tail-padding.cpp @@ -0,0 +1,34 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s + +// PR36992 +namespace Implicit { + struct A { char c; A(const A&); }; + struct B { int n; char c[3]; ~B(); }; + struct C : B, virtual A {}; + static_assert(sizeof(C) == sizeof(void*) + 8); + C f(C c) { return c; } + + // CHECK: define {{.*}} @_ZN8Implicit1CC1EOS0_ + // CHECK: call {{.*}} @_ZN8Implicit1AC2ERKS0_( + // Note: this must memcpy 7 bytes, not 8, to avoid trampling over the virtual base class. + // CHECK: call void @llvm.memcpy.p0i8.p0i8.i{{32|64}}(i8* {{.*}}, i8* {{.*}}, i{{32|64}} 7, i1 false) + // CHECK: store i32 {{.*}} @_ZTVN8Implicit1CE +} + +namespace InitWithinNVSize { + // This is the same as the previous test, except that the A base lies + // entirely within the nvsize of C. This makes it valid to copy at the + // full width. + struct A { char c; A(const A&); }; + struct B { int n; char c[3]; ~B(); }; + struct C : B, virtual A { char x; }; + static_assert(sizeof(C) > sizeof(void*) + 8); + C f(C c) { return c; } + + // CHECK: define {{.*}} @_ZN16InitWithinNVSize1CC1EOS0_ + // CHECK: call {{.*}} @_ZN16InitWithinNVSize1AC2ERKS0_( + // This copies over the 'C::x' member, but that's OK because we've not initialized it yet. + // CHECK: call void @llvm.memcpy.p0i8.p0i8.i{{32|64}}(i8* {{.*}}, i8* {{.*}}, i{{32|64}} 8, i1 false) + // CHECK: store i32 {{.*}} @_ZTVN16InitWithinNVSize1CE + // CHECK: store i8 +} diff --git a/test/CodeGenCXX/temporaries.cpp b/test/CodeGenCXX/temporaries.cpp index bad51ba353cd5..294ff29a8eabf 100644 --- a/test/CodeGenCXX/temporaries.cpp +++ b/test/CodeGenCXX/temporaries.cpp @@ -1,4 +1,6 @@ -// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 -std=c++11 | FileCheck %s +// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 -std=c++11 | FileCheck %s -check-prefixes=CHECK,NULL-INVALID,CHECK-CXX11 +// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 -std=c++17 | FileCheck %s -check-prefixes=CHECK,NULL-INVALID,CHECK-CXX17 +// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 -std=c++11 -fno-delete-null-pointer-checks | FileCheck %s -check-prefixes=CHECK,NULL-VALID,CHECK-CXX11 namespace PR16263 { const unsigned int n = 1234; @@ -45,7 +47,9 @@ namespace PR20227 { namespace BraceInit { typedef const int &CIR; CIR x = CIR{3}; - // CHECK: @_ZGRN9BraceInit1xE_ = internal constant i32 3 + // CHECK-CXX11: @_ZGRN9BraceInit1xE_ = internal constant i32 3 + // FIXME: This should still be emitted as 'constant' in C++17. + // CHECK-CXX17: @_ZGRN9BraceInit1xE_ = internal global i32 3 // CHECK: @_ZN9BraceInit1xE = constant i32* @_ZGRN9BraceInit1xE_ } @@ -198,20 +202,6 @@ B::B() f(); } -struct C { - C(); - - const B& b; -}; - -C::C() - // CHECK: call void @_ZN6PR50771BC1Ev - : b(B()) { - // CHECK: call void @_ZN6PR50771fEv - f(); - - // CHECK: call void @_ZN6PR50771BD1Ev -} } A f8() { @@ -347,7 +337,8 @@ namespace PR6648 { struct D; D& zed(B); void foobar() { - // CHECK: call nonnull %"struct.PR6648::D"* @_ZN6PR66483zedENS_1BE + // NULL-INVALID: call nonnull %"struct.PR6648::D"* @_ZN6PR66483zedENS_1BE + // NULL-VALID: call %"struct.PR6648::D"* @_ZN6PR66483zedENS_1BE zed(foo); } } @@ -817,15 +808,91 @@ namespace PR14130 { // CHECK: store {{.*}} @_ZGRN7PR141301vE_, {{.*}} @_ZN7PR141301vE } -namespace Ctor { - struct A { A(); ~A(); }; - void f(); - struct B { - A &&a; - B() : a{} { f(); } - } b; - // CHECK: define {{.*}}void @_ZN4Ctor1BC1Ev( - // CHECK: call void @_ZN4Ctor1AC1Ev( - // CHECK: call void @_ZN4Ctor1fEv( - // CHECK: call void @_ZN4Ctor1AD1Ev( +namespace Conditional { + struct A {}; + struct B : A { B(); ~B(); }; + struct C : A { C(); ~C(); }; + + void g(); + + // CHECK-LABEL: define {{.*}} @_ZN11Conditional1fEb( + void f(bool b) { + // CHECK: store i1 false, i1* %[[CLEANUP_B:.*]], + // CHECK: store i1 false, i1* %[[CLEANUP_C:.*]], + // CHECK: br i1 + // + // CHECK: call {{.*}} @_ZN11Conditional1BC1Ev( + // CHECK: store i1 true, i1* %[[CLEANUP_B]], + // CHECK: br label + // + // CHECK: call {{.*}} @_ZN11Conditional1CC1Ev( + // CHECK: store i1 true, i1* %[[CLEANUP_C]], + // CHECK: br label + A &&r = b ? static_cast<A&&>(B()) : static_cast<A&&>(C()); + + // CHECK: call {{.*}} @_ZN11Conditional1gEv( + g(); + + // CHECK: load {{.*}} %[[CLEANUP_C]] + // CHECK: br i1 + // CHECK: call {{.*}} @_ZN11Conditional1CD1Ev( + // CHECK: br label + + // CHECK: load {{.*}} %[[CLEANUP_B]] + // CHECK: br i1 + // CHECK: call {{.*}} @_ZN11Conditional1BD1Ev( + // CHECK: br label + } + + struct D { A &&a; }; + // CHECK-LABEL: define {{.*}} @_ZN11Conditional10f_indirectEb( + void f_indirect(bool b) { + // CHECK: store i1 false, i1* %[[CLEANUP_B:.*]], + // CHECK: store i1 false, i1* %[[CLEANUP_C:.*]], + // CHECK: br i1 + // + // CHECK: call {{.*}} @_ZN11Conditional1BC1Ev( + // CHECK: store i1 true, i1* %[[CLEANUP_B]], + // CHECK: br label + // + // CHECK: call {{.*}} @_ZN11Conditional1CC1Ev( + // CHECK: store i1 true, i1* %[[CLEANUP_C]], + // CHECK: br label + D d = b ? D{B()} : D{C()}; + + // In C++17, the expression D{...} directly initializes the 'd' object, so + // lifetime-extending the temporaries to the lifetime of the D object + // extends them past the call to g(). + // + // In C++14 and before, D is move-constructed from the result of the + // conditional expression, so no lifetime extension occurs. + + // CHECK-CXX17: call {{.*}} @_ZN11Conditional1gEv( + + // CHECK: load {{.*}} %[[CLEANUP_C]] + // CHECK: br i1 + // CHECK: call {{.*}} @_ZN11Conditional1CD1Ev( + // CHECK: br label + + // CHECK: load {{.*}} %[[CLEANUP_B]] + // CHECK: br i1 + // CHECK: call {{.*}} @_ZN11Conditional1BD1Ev( + // CHECK: br label + + // CHECK-CXX11: call {{.*}} @_ZN11Conditional1gEv( + g(); + } + + extern bool b; + // CHECK: load {{.*}} @_ZN11Conditional1b + // CHECK: br i1 + // + // CHECK: call {{.*}} @_ZN11Conditional1BC1Ev({{.*}} @_ZGRN11Conditional1rE_) + // CHECK: call {{.*}} @__cxa_atexit({{.*}} @_ZN11Conditional1BD1Ev {{.*}} @_ZGRN11Conditional1rE_, + // CHECK: br label + // + // CHECK: call {{.*}} @_ZN11Conditional1CC1Ev({{.*}} @_ZGRN11Conditional1rE0_) + // CHECK: call {{.*}} @__cxa_atexit({{.*}} @_ZN11Conditional1CD1Ev {{.*}} @_ZGRN11Conditional1rE0_, + // CHECK: br label + A &&r = b ? static_cast<A&&>(B()) : static_cast<A&&>(C()); } diff --git a/test/CodeGenCXX/trap-fnattr.cpp b/test/CodeGenCXX/trap-fnattr.cpp index b73ea432b7872..166bbadc84eb8 100644 --- a/test/CodeGenCXX/trap-fnattr.cpp +++ b/test/CodeGenCXX/trap-fnattr.cpp @@ -1,29 +1,29 @@ // RUN: %clang_cc1 -O0 -emit-llvm -ftrapv -ftrap-function=mytrap %s -o - | FileCheck %s -check-prefix=TRAPFUNC // RUN: %clang_cc1 -O0 -emit-llvm -ftrapv %s -o - | FileCheck %s -check-prefix=NOOPTION -// TRAPFUNC-LABEL: define void @{{_Z12test_builtinv|\"\\01\?test_builtin@@YAXXZ\"}} +// TRAPFUNC-LABEL: define {{(dso_local )?}}void @{{_Z12test_builtinv|\"\?test_builtin@@YAXXZ\"}} // TRAPFUNC: call void @llvm.trap() [[ATTR0:#[0-9]+]] -// NOOPTION-LABEL: define void @{{_Z12test_builtinv|\"\\01\?test_builtin@@YAXXZ\"}} +// NOOPTION-LABEL: define {{(dso_local )?}}void @{{_Z12test_builtinv|\"\?test_builtin@@YAXXZ\"}} // NOOPTION: call void @llvm.trap(){{$}} void test_builtin(void) { __builtin_trap(); } -// TRAPFUNC-LABEL: define {{.*}}i32 @{{_Z13test_noreturnv|\"\\01\?test_noreturn@@YAHXZ\"}} +// TRAPFUNC-LABEL: define {{.*}}i32 @{{_Z13test_noreturnv|\"\?test_noreturn@@YAHXZ\"}} // TRAPFUNC: call void @llvm.trap() [[ATTR0]] -// NOOPTION-LABEL: define {{.*}}i32 @{{_Z13test_noreturnv|\"\\01\?test_noreturn@@YAHXZ\"}} +// NOOPTION-LABEL: define {{.*}}i32 @{{_Z13test_noreturnv|\"\?test_noreturn@@YAHXZ\"}} // NOOPTION: call void @llvm.trap(){{$}} int test_noreturn(void) { } -// TRAPFUNC-LABEL: define {{.*}}i32 @{{_Z17test_add_overflowii|\"\\01\?test_add_overflow@@YAHHH@Z\"}} +// TRAPFUNC-LABEL: define {{.*}}i32 @{{_Z17test_add_overflowii|\"\?test_add_overflow@@YAHHH@Z\"}} // TRAPFUNC: call void @llvm.trap() [[ATTR1:#[0-9]+]] -// NOOPTION-LABEL: define {{.*}}i32 @{{_Z17test_add_overflowii|\"\\01\?test_add_overflow@@YAHHH@Z\"}} +// NOOPTION-LABEL: define {{.*}}i32 @{{_Z17test_add_overflowii|\"\?test_add_overflow@@YAHHH@Z\"}} // NOOPTION: call void @llvm.trap() [[ATTR2:#[0-9]+]] int test_add_overflow(int a, int b) { diff --git a/test/CodeGenCXX/trivial_abi.cpp b/test/CodeGenCXX/trivial_abi.cpp new file mode 100644 index 0000000000000..2cf07b22581a2 --- /dev/null +++ b/test/CodeGenCXX/trivial_abi.cpp @@ -0,0 +1,239 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios11 -std=c++11 -fcxx-exceptions -fexceptions -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios11 -std=c++11 -fcxx-exceptions -fexceptions -fclang-abi-compat=4.0 -emit-llvm -o - %s | FileCheck %s + +// CHECK: %[[STRUCT_SMALL:.*]] = type { i32* } +// CHECK: %[[STRUCT_LARGE:.*]] = type { i32*, [128 x i32] } +// CHECK: %[[STRUCT_TRIVIAL:.*]] = type { i32 } +// CHECK: %[[STRUCT_NONTRIVIAL:.*]] = type { i32 } + +struct __attribute__((trivial_abi)) Small { + int *p; + Small(); + ~Small(); + Small(const Small &) noexcept; + Small &operator=(const Small &); +}; + +struct __attribute__((trivial_abi)) Large { + int *p; + int a[128]; + Large(); + ~Large(); + Large(const Large &) noexcept; + Large &operator=(const Large &); +}; + +struct Trivial { + int a; +}; + +struct NonTrivial { + NonTrivial(); + ~NonTrivial(); + int a; +}; + +struct HasTrivial { + Small s; + Trivial m; +}; + +struct HasNonTrivial { + Small s; + NonTrivial m; +}; + +// CHECK: define void @_Z14testParamSmall5Small(i64 %[[A_COERCE:.*]]) +// CHECK: %[[A:.*]] = alloca %[[STRUCT_SMALL]], align 8 +// CHECK: %[[COERCE_DIVE:.*]] = getelementptr inbounds %[[STRUCT_SMALL]], %[[STRUCT_SMALL]]* %[[A]], i32 0, i32 0 +// CHECK: %[[COERCE_VAL_IP:.*]] = inttoptr i64 %[[A_COERCE]] to i32* +// CHECK: store i32* %[[COERCE_VAL_IP]], i32** %[[COERCE_DIVE]], align 8 +// CHECK: %[[CALL:.*]] = call %[[STRUCT_SMALL]]* @_ZN5SmallD1Ev(%[[STRUCT_SMALL]]* %[[A]]) +// CHECK: ret void +// CHECK: } + +void testParamSmall(Small a) noexcept { +} + +// CHECK: define i64 @_Z15testReturnSmallv() +// CHECK: %[[RETVAL:.*]] = alloca %[[STRUCT_SMALL:.*]], align 8 +// CHECK: %[[CALL:.*]] = call %[[STRUCT_SMALL]]* @_ZN5SmallC1Ev(%[[STRUCT_SMALL]]* %[[RETVAL]]) +// CHECK: %[[COERCE_DIVE:.*]] = getelementptr inbounds %[[STRUCT_SMALL]], %[[STRUCT_SMALL]]* %[[RETVAL]], i32 0, i32 0 +// CHECK: %[[V0:.*]] = load i32*, i32** %[[COERCE_DIVE]], align 8 +// CHECK: %[[COERCE_VAL_PI:.*]] = ptrtoint i32* %[[V0]] to i64 +// CHECK: ret i64 %[[COERCE_VAL_PI]] +// CHECK: } + +Small testReturnSmall() { + Small t; + return t; +} + +// CHECK: define void @_Z14testCallSmall0v() +// CHECK: %[[T:.*]] = alloca %[[STRUCT_SMALL:.*]], align 8 +// CHECK: %[[AGG_TMP:.*]] = alloca %[[STRUCT_SMALL]], align 8 +// CHECK: %[[CALL:.*]] = call %[[STRUCT_SMALL]]* @_ZN5SmallC1Ev(%[[STRUCT_SMALL]]* %[[T]]) +// CHECK: %[[CALL1:.*]] = call %[[STRUCT_SMALL]]* @_ZN5SmallC1ERKS_(%[[STRUCT_SMALL]]* %[[AGG_TMP]], %[[STRUCT_SMALL]]* dereferenceable(8) %[[T]]) +// CHECK: %[[COERCE_DIVE:.*]] = getelementptr inbounds %[[STRUCT_SMALL]], %[[STRUCT_SMALL]]* %[[AGG_TMP]], i32 0, i32 0 +// CHECK: %[[V0:.*]] = load i32*, i32** %[[COERCE_DIVE]], align 8 +// CHECK: %[[COERCE_VAL_PI:.*]] = ptrtoint i32* %[[V0]] to i64 +// CHECK: call void @_Z14testParamSmall5Small(i64 %[[COERCE_VAL_PI]]) +// CHECK: %[[CALL2:.*]] = call %[[STRUCT_SMALL]]* @_ZN5SmallD1Ev(%[[STRUCT_SMALL]]* %[[T]]) +// CHECK: ret void +// CHECK: } + +void testCallSmall0() { + Small t; + testParamSmall(t); +} + +// CHECK: define void @_Z14testCallSmall1v() +// CHECK: %[[AGG_TMP:.*]] = alloca %[[STRUCT_SMALL:.*]], align 8 +// CHECK: %[[CALL:.*]] = call i64 @_Z15testReturnSmallv() +// CHECK: %[[COERCE_DIVE:.*]] = getelementptr inbounds %[[STRUCT_SMALL]], %[[STRUCT_SMALL]]* %[[AGG_TMP]], i32 0, i32 0 +// CHECK: %[[COERCE_VAL_IP:.*]] = inttoptr i64 %[[CALL]] to i32* +// CHECK: store i32* %[[COERCE_VAL_IP]], i32** %[[COERCE_DIVE]], align 8 +// CHECK: %[[COERCE_DIVE1:.*]] = getelementptr inbounds %[[STRUCT_SMALL]], %[[STRUCT_SMALL]]* %[[AGG_TMP]], i32 0, i32 0 +// CHECK: %[[V0:.*]] = load i32*, i32** %[[COERCE_DIVE1]], align 8 +// CHECK: %[[COERCE_VAL_PI:.*]] = ptrtoint i32* %[[V0]] to i64 +// CHECK: call void @_Z14testParamSmall5Small(i64 %[[COERCE_VAL_PI]]) +// CHECK: ret void +// CHECK: } + +void testCallSmall1() { + testParamSmall(testReturnSmall()); +} + +// CHECK: define void @_Z16testIgnoredSmallv() +// CHECK: %[[AGG_TMP_ENSURED:.*]] = alloca %[[STRUCT_SMALL:.*]], align 8 +// CHECK: %[[CALL:.*]] = call i64 @_Z15testReturnSmallv() +// CHECK: %[[COERCE_DIVE:.*]] = getelementptr inbounds %[[STRUCT_SMALL]], %[[STRUCT_SMALL]]* %[[AGG_TMP_ENSURED]], i32 0, i32 0 +// CHECK: %[[COERCE_VAL_IP:.*]] = inttoptr i64 %[[CALL]] to i32* +// CHECK: store i32* %[[COERCE_VAL_IP]], i32** %[[COERCE_DIVE]], align 8 +// CHECK: %[[CALL1:.*]] = call %[[STRUCT_SMALL]]* @_ZN5SmallD1Ev(%[[STRUCT_SMALL]]* %[[AGG_TMP_ENSURED]]) +// CHECK: ret void +// CHECK: } + +void testIgnoredSmall() { + testReturnSmall(); +} + +// CHECK: define void @_Z14testParamLarge5Large(%[[STRUCT_LARGE:.*]]* %[[A:.*]]) +// CHECK: %[[CALL:.*]] = call %[[STRUCT_LARGE]]* @_ZN5LargeD1Ev(%[[STRUCT_LARGE]]* %[[A]]) +// CHECK: ret void +// CHECK: } + +void testParamLarge(Large a) noexcept { +} + +// CHECK: define void @_Z15testReturnLargev(%[[STRUCT_LARGE:.*]]* noalias sret %[[AGG_RESULT:.*]]) +// CHECK: %[[CALL:.*]] = call %[[STRUCT_LARGE]]* @_ZN5LargeC1Ev(%[[STRUCT_LARGE]]* %[[AGG_RESULT]]) +// CHECK: ret void +// CHECK: } + +Large testReturnLarge() { + Large t; + return t; +} + +// CHECK: define void @_Z14testCallLarge0v() +// CHECK: %[[T:.*]] = alloca %[[STRUCT_LARGE:.*]], align 8 +// CHECK: %[[AGG_TMP:.*]] = alloca %[[STRUCT_LARGE]], align 8 +// CHECK: %[[CALL:.*]] = call %[[STRUCT_LARGE]]* @_ZN5LargeC1Ev(%[[STRUCT_LARGE]]* %[[T]]) +// CHECK: %[[CALL1:.*]] = call %[[STRUCT_LARGE]]* @_ZN5LargeC1ERKS_(%[[STRUCT_LARGE]]* %[[AGG_TMP]], %[[STRUCT_LARGE]]* dereferenceable(520) %[[T]]) +// CHECK: call void @_Z14testParamLarge5Large(%[[STRUCT_LARGE]]* %[[AGG_TMP]]) +// CHECK: %[[CALL2:.*]] = call %[[STRUCT_LARGE]]* @_ZN5LargeD1Ev(%[[STRUCT_LARGE]]* %[[T]]) +// CHECK: ret void +// CHECK: } + +void testCallLarge0() { + Large t; + testParamLarge(t); +} + +// CHECK: define void @_Z14testCallLarge1v() +// CHECK: %[[AGG_TMP:.*]] = alloca %[[STRUCT_LARGE:.*]], align 8 +// CHECK: call void @_Z15testReturnLargev(%[[STRUCT_LARGE]]* sret %[[AGG_TMP]]) +// CHECK: call void @_Z14testParamLarge5Large(%[[STRUCT_LARGE]]* %[[AGG_TMP]]) +// CHECK: ret void +// CHECK: } + +void testCallLarge1() { + testParamLarge(testReturnLarge()); +} + +// CHECK: define void @_Z16testIgnoredLargev() +// CHECK: %[[AGG_TMP_ENSURED:.*]] = alloca %[[STRUCT_LARGE:.*]], align 8 +// CHECK: call void @_Z15testReturnLargev(%[[STRUCT_LARGE]]* sret %[[AGG_TMP_ENSURED]]) +// CHECK: %[[CALL:.*]] = call %[[STRUCT_LARGE]]* @_ZN5LargeD1Ev(%[[STRUCT_LARGE]]* %[[AGG_TMP_ENSURED]]) +// CHECK: ret void +// CHECK: } + +void testIgnoredLarge() { + testReturnLarge(); +} + +// CHECK: define i64 @_Z20testReturnHasTrivialv() +// CHECK: %[[RETVAL:.*]] = alloca %[[STRUCT_TRIVIAL:.*]], align 4 +// CHECK: %[[COERCE_DIVE:.*]] = getelementptr inbounds %[[STRUCT_TRIVIAL]], %[[STRUCT_TRIVIAL]]* %[[RETVAL]], i32 0, i32 0 +// CHECK: %[[V0:.*]] = load i32, i32* %[[COERCE_DIVE]], align 4 +// CHECK: %[[COERCE_VAL_II:.*]] = zext i32 %[[V0]] to i64 +// CHECK: ret i64 %[[COERCE_VAL_II]] +// CHECK: } + +Trivial testReturnHasTrivial() { + Trivial t; + return t; +} + +// CHECK: define void @_Z23testReturnHasNonTrivialv(%[[STRUCT_NONTRIVIAL:.*]]* noalias sret %[[AGG_RESULT:.*]]) +// CHECK: %[[CALL:.*]] = call %[[STRUCT_NONTRIVIAL]]* @_ZN10NonTrivialC1Ev(%[[STRUCT_NONTRIVIAL]]* %[[AGG_RESULT]]) +// CHECK: ret void +// CHECK: } + +NonTrivial testReturnHasNonTrivial() { + NonTrivial t; + return t; +} + +// CHECK: define void @_Z18testExceptionSmallv() +// CHECK: %[[AGG_TMP:.*]] = alloca %[[STRUCT_SMALL]], align 8 +// CHECK: %[[AGG_TMP1:.*]] = alloca %[[STRUCT_SMALL]], align 8 +// CHECK: call %[[STRUCT_SMALL]]* @_ZN5SmallC1Ev(%[[STRUCT_SMALL]]* %[[AGG_TMP]]) +// CHECK: invoke %[[STRUCT_SMALL]]* @_ZN5SmallC1Ev(%[[STRUCT_SMALL]]* %[[AGG_TMP1]]) + +// CHECK: call void @_Z20calleeExceptionSmall5SmallS_(i64 %{{.*}}, i64 %{{.*}}) +// CHECK-NEXT: ret void + +// CHECK: landingpad { i8*, i32 } +// CHECK: call %[[STRUCT_SMALL]]* @_ZN5SmallD1Ev(%[[STRUCT_SMALL]]* %[[AGG_TMP]]) +// CHECK: br + +// CHECK: resume { i8*, i32 } + +void calleeExceptionSmall(Small, Small); + +void testExceptionSmall() { + calleeExceptionSmall(Small(), Small()); +} + +// CHECK: define void @_Z18testExceptionLargev() +// CHECK: %[[AGG_TMP:.*]] = alloca %[[STRUCT_LARGE]], align 8 +// CHECK: %[[AGG_TMP1:.*]] = alloca %[[STRUCT_LARGE]], align 8 +// CHECK: call %[[STRUCT_LARGE]]* @_ZN5LargeC1Ev(%[[STRUCT_LARGE]]* %[[AGG_TMP]]) +// CHECK: invoke %[[STRUCT_LARGE]]* @_ZN5LargeC1Ev(%[[STRUCT_LARGE]]* %[[AGG_TMP1]]) + +// CHECK: call void @_Z20calleeExceptionLarge5LargeS_(%[[STRUCT_LARGE]]* %[[AGG_TMP]], %[[STRUCT_LARGE]]* %[[AGG_TMP1]]) +// CHECK-NEXT: ret void + +// CHECK: landingpad { i8*, i32 } +// CHECK: call %[[STRUCT_LARGE]]* @_ZN5LargeD1Ev(%[[STRUCT_LARGE]]* %[[AGG_TMP]]) +// CHECK: br + +// CHECK: resume { i8*, i32 } + +void calleeExceptionLarge(Large, Large); + +void testExceptionLarge() { + calleeExceptionLarge(Large(), Large()); +} diff --git a/test/CodeGenCXX/type-metadata-memfun.cpp b/test/CodeGenCXX/type-metadata-memfun.cpp new file mode 100644 index 0000000000000..2ff574e7da427 --- /dev/null +++ b/test/CodeGenCXX/type-metadata-memfun.cpp @@ -0,0 +1,31 @@ +// RUN: %clang_cc1 -flto -flto-unit -triple x86_64-unknown-linux -fvisibility hidden -emit-llvm -o - %s | FileCheck %s + +struct S1 { + S1(); + ~S1(); + virtual void vf(); + void f(); + void fdecl(); +}; + +struct [[clang::lto_visibility_public]] S2 { + void f(); +}; + +// CHECK-NOT: declare{{.*}}!type +// CHECK-NOT: define{{.*}}!type + +S1::S1() {} +S1::~S1() {} +void S1::vf() {} +// CHECK: define hidden void @_ZN2S11fEv{{.*}} !type [[S2F:![0-9]+]] +void S1::f() { + fdecl(); +} + +void S2::f() {} + +// CHECK-NOT: declare{{.*}}!type +// CHECK-NOT: define{{.*}}!type + +// CHECK: [[S2F]] = !{i64 0, !"_ZTSM2S1FvvE"} diff --git a/test/CodeGenCXX/type-metadata.cpp b/test/CodeGenCXX/type-metadata.cpp index 6821e36240934..8e3e4bd182fe1 100644 --- a/test/CodeGenCXX/type-metadata.cpp +++ b/test/CodeGenCXX/type-metadata.cpp @@ -14,16 +14,25 @@ // ITANIUM: @_ZTV1A = {{[^!]*}}, !type [[A16:![0-9]+]] // ITANIUM-DIAG-SAME: !type [[ALL16:![0-9]+]] +// ITANIUM-SAME: !type [[AF16:![0-9]+]] // ITANIUM: @_ZTV1B = {{[^!]*}}, !type [[A32:![0-9]+]] // ITANIUM-DIAG-SAME: !type [[ALL32:![0-9]+]] +// ITANIUM-SAME: !type [[AF32:![0-9]+]] +// ITANIUM-SAME: !type [[AF40:![0-9]+]] +// ITANIUM-SAME: !type [[AF48:![0-9]+]] // ITANIUM-SAME: !type [[B32:![0-9]+]] // ITANIUM-DIAG-SAME: !type [[ALL32]] +// ITANIUM-SAME: !type [[BF32:![0-9]+]] +// ITANIUM-SAME: !type [[BF40:![0-9]+]] +// ITANIUM-SAME: !type [[BF48:![0-9]+]] // ITANIUM: @_ZTV1C = {{[^!]*}}, !type [[A32]] // ITANIUM-DIAG-SAME: !type [[ALL32]] +// ITANIUM-SAME: !type [[AF32]] // ITANIUM-SAME: !type [[C32:![0-9]+]] // ITANIUM-DIAG-SAME: !type [[ALL32]] +// ITANIUM-SAME: !type [[CF32:![0-9]+]] // DIAG: @[[SRC:.*]] = private unnamed_addr constant [{{.*}} x i8] c"{{.*}}type-metadata.cpp\00", align 1 // DIAG: @[[TYPE:.*]] = private unnamed_addr constant { i16, i16, [4 x i8] } { i16 -1, i16 0, [4 x i8] c"'A'\00" } @@ -31,12 +40,24 @@ // ITANIUM: @_ZTVN12_GLOBAL__N_11DE = {{[^!]*}}, !type [[A32]] // ITANIUM-DIAG-SAME: !type [[ALL32]] +// ITANIUM-SAME: !type [[AF32]] +// ITANIUM-SAME: !type [[AF40]] +// ITANIUM-SAME: !type [[AF48]] // ITANIUM-SAME: !type [[B32]] // ITANIUM-DIAG-SAME: !type [[ALL32]] +// ITANIUM-SAME: !type [[BF32]] +// ITANIUM-SAME: !type [[BF40]] +// ITANIUM-SAME: !type [[BF48]] // ITANIUM-SAME: !type [[C88:![0-9]+]] // ITANIUM-DIAG-SAME: !type [[ALL88:![0-9]+]] +// ITANIUM-SAME: !type [[CF32]] +// ITANIUM-SAME: !type [[CF40:![0-9]+]] +// ITANIUM-SAME: !type [[CF48:![0-9]+]] // ITANIUM-SAME: !type [[D32:![0-9]+]] // ITANIUM-DIAG-SAME: !type [[ALL32]] +// ITANIUM-SAME: !type [[DF32:![0-9]+]] +// ITANIUM-SAME: !type [[DF40:![0-9]+]] +// ITANIUM-SAME: !type [[DF48:![0-9]+]] // ITANIUM: @_ZTCN12_GLOBAL__N_11DE0_1B = {{[^!]*}}, !type [[A32]] // ITANIUM-DIAG-SAME: !type [[ALL32]] @@ -45,21 +66,25 @@ // ITANIUM: @_ZTCN12_GLOBAL__N_11DE8_1C = {{[^!]*}}, !type [[A64:![0-9]+]] // ITANIUM-DIAG-SAME: !type [[ALL64:![0-9]+]] +// ITANIUM-SAME: !type [[AF64:![0-9]+]] // ITANIUM-SAME: !type [[C32]] // ITANIUM-DIAG-SAME: !type [[ALL32]] +// ITANIUM-SAME: !type [[CF64:![0-9]+]] // ITANIUM: @_ZTVZ3foovE2FA = {{[^!]*}}, !type [[A16]] // ITANIUM-DIAG-SAME: !type [[ALL16]] +// ITANIUM-SAME: !type [[AF16]] // ITANIUM-SAME: !type [[FA16:![0-9]+]] // ITANIUM-DIAG-SAME: !type [[ALL16]] +// ITANIUM-SAME: !type [[FAF16:![0-9]+]] -// MS: comdat($"\01??_7A@@6B@"), !type [[A8:![0-9]+]] -// MS: comdat($"\01??_7B@@6B0@@"), !type [[B8:![0-9]+]] -// MS: comdat($"\01??_7B@@6BA@@@"), !type [[A8]] -// MS: comdat($"\01??_7C@@6B@"), !type [[A8]] -// MS: comdat($"\01??_7D@?A@@6BB@@@"), !type [[B8]], !type [[D8:![0-9]+]] -// MS: comdat($"\01??_7D@?A@@6BA@@@"), !type [[A8]] -// MS: comdat($"\01??_7FA@?1??foo@@YAXXZ@6B@"), !type [[A8]], !type [[FA8:![0-9]+]] +// MS: comdat($"??_7A@@6B@"), !type [[A8:![0-9]+]] +// MS: comdat($"??_7B@@6B0@@"), !type [[B8:![0-9]+]] +// MS: comdat($"??_7B@@6BA@@@"), !type [[A8]] +// MS: comdat($"??_7C@@6B@"), !type [[A8]] +// MS: comdat($"??_7D@?A@@6BB@@@"), !type [[B8]], !type [[D8:![0-9]+]] +// MS: comdat($"??_7D@?A@@6BA@@@"), !type [[A8]] +// MS: comdat($"??_7FA@?1??foo@@YAXXZ@6B@"), !type [[A8]], !type [[FA8:![0-9]+]] struct A { A(); @@ -104,7 +129,7 @@ void D::h() { } // ITANIUM: define hidden void @_Z2afP1A -// MS: define void @"\01?af@@YAXPEAUA@@@Z" +// MS: define dso_local void @"?af@@YAXPEAUA@@@Z" void af(A *a) { // TT-ITANIUM: [[P:%[^ ]*]] = call i1 @llvm.type.test(i8* [[VT:%[^ ]*]], metadata !"_ZTS1A") // TT-MS: [[P:%[^ ]*]] = call i1 @llvm.type.test(i8* [[VT:%[^ ]*]], metadata !"?AUA@@") @@ -136,7 +161,7 @@ void af(A *a) { } // ITANIUM: define internal void @_Z3df1PN12_GLOBAL__N_11DE -// MS: define internal void @"\01?df1@@YAXPEAUD@?A@@@Z" +// MS: define internal void @"?df1@@YAXPEAUD@?A@@@Z" void df1(D *d) { // TT-ITANIUM: {{%[^ ]*}} = call i1 @llvm.type.test(i8* {{%[^ ]*}}, metadata ![[DTYPE:[0-9]+]]) // TT-MS: {{%[^ ]*}} = call i1 @llvm.type.test(i8* {{%[^ ]*}}, metadata !"?AUA@@") @@ -146,7 +171,7 @@ void df1(D *d) { } // ITANIUM: define internal void @_Z3dg1PN12_GLOBAL__N_11DE -// MS: define internal void @"\01?dg1@@YAXPEAUD@?A@@@Z" +// MS: define internal void @"?dg1@@YAXPEAUD@?A@@@Z" void dg1(D *d) { // TT-ITANIUM: {{%[^ ]*}} = call i1 @llvm.type.test(i8* {{%[^ ]*}}, metadata !"_ZTS1B") // TT-MS: {{%[^ ]*}} = call i1 @llvm.type.test(i8* {{%[^ ]*}}, metadata !"?AUB@@") @@ -156,7 +181,7 @@ void dg1(D *d) { } // ITANIUM: define internal void @_Z3dh1PN12_GLOBAL__N_11DE -// MS: define internal void @"\01?dh1@@YAXPEAUD@?A@@@Z" +// MS: define internal void @"?dh1@@YAXPEAUD@?A@@@Z" void dh1(D *d) { // TT-ITANIUM: {{%[^ ]*}} = call i1 @llvm.type.test(i8* {{%[^ ]*}}, metadata ![[DTYPE]]) // TT-MS: {{%[^ ]*}} = call i1 @llvm.type.test(i8* {{%[^ ]*}}, metadata ![[DTYPE:[0-9]+]]) @@ -166,7 +191,7 @@ void dh1(D *d) { } // ITANIUM: define internal void @_Z3df2PN12_GLOBAL__N_11DE -// MS: define internal void @"\01?df2@@YAXPEAUD@?A@@@Z" +// MS: define internal void @"?df2@@YAXPEAUD@?A@@@Z" __attribute__((no_sanitize("cfi"))) void df2(D *d) { // CFI-NVT-NOT: call i1 @llvm.type.test @@ -176,7 +201,7 @@ void df2(D *d) { } // ITANIUM: define internal void @_Z3df3PN12_GLOBAL__N_11DE -// MS: define internal void @"\01?df3@@YAXPEAUD@?A@@@Z" +// MS: define internal void @"?df3@@YAXPEAUD@?A@@@Z" __attribute__((no_sanitize("address"))) __attribute__((no_sanitize("cfi-vcall"))) void df3(D *d) { // CFI-NVT-NOT: call i1 @llvm.type.test @@ -214,7 +239,7 @@ struct D : C { }; // ITANIUM: define hidden void @_ZN5test21fEPNS_1DE -// MS: define void @"\01?f@test2@@YAXPEAUD@1@@Z" +// MS: define dso_local void @"?f@test2@@YAXPEAUD@1@@Z" void f(D *d) { // TT-ITANIUM: {{%[^ ]*}} = call i1 @llvm.type.test(i8* {{%[^ ]*}}, metadata !"_ZTSN5test21DE") // TT-MS: {{%[^ ]*}} = call i1 @llvm.type.test(i8* {{%[^ ]*}}, metadata !"?AUA@test2@@") @@ -227,18 +252,36 @@ void f(D *d) { // ITANIUM: [[A16]] = !{i64 16, !"_ZTS1A"} // ITANIUM-DIAG: [[ALL16]] = !{i64 16, !"all-vtables"} +// ITANIUM: [[AF16]] = !{i64 16, !"_ZTSM1AFvvE.virtual"} // ITANIUM: [[A32]] = !{i64 32, !"_ZTS1A"} // ITANIUM-DIAG: [[ALL32]] = !{i64 32, !"all-vtables"} +// ITANIUM: [[AF32]] = !{i64 32, !"_ZTSM1AFvvE.virtual"} +// ITANIUM: [[AF40]] = !{i64 40, !"_ZTSM1AFvvE.virtual"} +// ITANIUM: [[AF48]] = !{i64 48, !"_ZTSM1AFvvE.virtual"} // ITANIUM: [[B32]] = !{i64 32, !"_ZTS1B"} +// ITANIUM: [[BF32]] = !{i64 32, !"_ZTSM1BFvvE.virtual"} +// ITANIUM: [[BF40]] = !{i64 40, !"_ZTSM1BFvvE.virtual"} +// ITANIUM: [[BF48]] = !{i64 48, !"_ZTSM1BFvvE.virtual"} // ITANIUM: [[C32]] = !{i64 32, !"_ZTS1C"} +// ITANIUM: [[CF32]] = !{i64 32, !"_ZTSM1CFvvE.virtual"} // ITANIUM: [[C88]] = !{i64 88, !"_ZTS1C"} // ITANIUM-DIAG: [[ALL88]] = !{i64 88, !"all-vtables"} +// ITANIUM: [[CF40]] = !{i64 40, !"_ZTSM1CFvvE.virtual"} +// ITANIUM: [[CF48]] = !{i64 48, !"_ZTSM1CFvvE.virtual"} // ITANIUM: [[D32]] = !{i64 32, [[D_ID:![0-9]+]]} // ITANIUM: [[D_ID]] = distinct !{} +// ITANIUM: [[DF32]] = !{i64 32, [[DF_ID:![0-9]+]]} +// ITANIUM: [[DF_ID]] = distinct !{} +// ITANIUM: [[DF40]] = !{i64 40, [[DF_ID]]} +// ITANIUM: [[DF48]] = !{i64 48, [[DF_ID]]} // ITANIUM: [[A64]] = !{i64 64, !"_ZTS1A"} // ITANIUM-DIAG: [[ALL64]] = !{i64 64, !"all-vtables"} +// ITANIUM: [[AF64]] = !{i64 64, !"_ZTSM1AFvvE.virtual"} +// ITANIUM: [[CF64]] = !{i64 64, !"_ZTSM1CFvvE.virtual"} // ITANIUM: [[FA16]] = !{i64 16, [[FA_ID:![0-9]+]]} // ITANIUM: [[FA_ID]] = distinct !{} +// ITANIUM: [[FAF16]] = !{i64 16, [[FAF_ID:![0-9]+]]} +// ITANIUM: [[FAF_ID]] = distinct !{} // MS: [[A8]] = !{i64 8, !"?AUA@@"} // MS: [[B8]] = !{i64 8, !"?AUB@@"} diff --git a/test/CodeGenCXX/ubsan-ctor-srcloc.cpp b/test/CodeGenCXX/ubsan-ctor-srcloc.cpp new file mode 100644 index 0000000000000..da27a668cf625 --- /dev/null +++ b/test/CodeGenCXX/ubsan-ctor-srcloc.cpp @@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-linux -emit-llvm -fsanitize=alignment -fblocks %s -o %t.ll +// RUN: FileCheck -check-prefix=ZEROINIT < %t.ll %s +// RUN: FileCheck -check-prefix=SRCLOC < %t.ll %s +// ZEROINIT-NOT: @{{.+}} = private unnamed_addr global {{.+}} zeroinitializer + +struct A { + A(int); + int k; +}; + +struct B : A { + B(); + B(const B &); +// SRCLOC-DAG: @{{.+}} = private unnamed_addr global {{.+}} @.src, i32 [[@LINE+1]], i32 12 } + using A::A; + void f() const; +}; + +// SRCLOC-DAG: @{{.+}} = private unnamed_addr global {{.+}} @.src, i32 [[@LINE+1]], i32 10 } +B::B() : A(1) {} + +void foo() { + B b(2); +// SRCLOC-DAG: @{{.+}} = private unnamed_addr global {{.+}} @.src, i32 [[@LINE+1]], i32 5 } + ^{b.f();}(); +} diff --git a/test/CodeGenCXX/ubsan-devirtualized-calls.cpp b/test/CodeGenCXX/ubsan-devirtualized-calls.cpp index f4ccdbf6474a3..1510a4a08dd07 100644 --- a/test/CodeGenCXX/ubsan-devirtualized-calls.cpp +++ b/test/CodeGenCXX/ubsan-devirtualized-calls.cpp @@ -32,7 +32,7 @@ struct Derived4 final : Base1 { // CHECK: [[UBSAN_TI_DERIVED4_1:@[0-9]+]] = private unnamed_addr global {{.*}} i8* bitcast {{.*}} @_ZTI8Derived4 to i8* // CHECK: [[UBSAN_TI_DERIVED4_2:@[0-9]+]] = private unnamed_addr global {{.*}} i8* bitcast {{.*}} @_ZTI8Derived4 to i8* -// CHECK-LABEL: define void @_Z2t1v +// CHECK-LABEL: define {{(dso_local )?}}void @_Z2t1v void t1() { Derived1 d1; static_cast<Base1 *>(&d1)->f1(); //< Devirt Base1::f1 to Derived1::f1. @@ -40,7 +40,7 @@ void t1() { // CHECK-NEXT: call void @__ubsan_handle_dynamic_type_cache{{[_a-z]*}}({{.*}} [[UBSAN_TI_DERIVED1_1]] {{.*}}, i{{[0-9]+}} %[[D1]] } -// CHECK-LABEL: define void @_Z2t2v +// CHECK-LABEL: define {{(dso_local )?}}void @_Z2t2v void t2() { Derived2 d2; static_cast<Base1 *>(&d2)->f1(); //< Devirt Base1::f1 to Derived2::f1. @@ -48,7 +48,7 @@ void t2() { // CHECK-NEXT: call void @__ubsan_handle_dynamic_type_cache{{[_a-z]*}}({{.*}} [[UBSAN_TI_DERIVED2_1]] {{.*}}, i{{[0-9]+}} %[[D2_1]] } -// CHECK-LABEL: define void @_Z2t3v +// CHECK-LABEL: define {{(dso_local )?}}void @_Z2t3v void t3() { Derived2 d2; static_cast<Base2 *>(&d2)->f1(); //< Devirt Base2::f1 to Derived2::f1. @@ -56,7 +56,7 @@ void t3() { // CHECK-NEXT: call void @__ubsan_handle_dynamic_type_cache{{[_a-z]*}}({{.*}} [[UBSAN_TI_DERIVED2_2]] {{.*}}, i{{[0-9]+}} %[[D2_2]] } -// CHECK-LABEL: define void @_Z2t4v +// CHECK-LABEL: define {{(dso_local )?}}void @_Z2t4v void t4() { Base1 p; Derived3 *badp = static_cast<Derived3 *>(&p); //< Check that &p isa Derived3. @@ -73,7 +73,7 @@ void t4() { // CHECK-NEXT: call void @__ubsan_handle_dynamic_type_cache{{[_a-z]*}}({{.*}} [[UBSAN_TI_BASE1]] {{.*}}, i{{[0-9]+}} %[[BADP1]] } -// CHECK-LABEL: define void @_Z2t5v +// CHECK-LABEL: define {{(dso_local )?}}void @_Z2t5v void t5() { Base1 p; Derived4 *badp = static_cast<Derived4 *>(&p); //< Check that &p isa Derived4. diff --git a/test/CodeGenCXX/ubsan-function-noexcept.cpp b/test/CodeGenCXX/ubsan-function-noexcept.cpp new file mode 100644 index 0000000000000..45c2764add7dc --- /dev/null +++ b/test/CodeGenCXX/ubsan-function-noexcept.cpp @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -std=c++17 -fsanitize=function -emit-llvm -triple x86_64-linux-gnu %s -o - | FileCheck %s + +// Check that typeinfo recorded in function prolog doesn't have "Do" noexcept +// qualifier in its mangled name. +// CHECK: @[[RTTI:[0-9]+]] = private constant i8* bitcast ({ i8*, i8* }* @_ZTIFvvE to i8*) +// CHECK: define void @_Z1fv() #{{.*}} prologue <{ i32, i32 }> <{ i32 {{.*}}, i32 trunc (i64 sub (i64 ptrtoint (i8** @[[RTTI]] to i64), i64 ptrtoint (void ()* @_Z1fv to i64)) to i32) }> +void f() noexcept {} + +// CHECK: define void @_Z1gPDoFvvE +void g(void (*p)() noexcept) { + // Check that reference typeinfo at call site doesn't have "Do" noexcept + // qualifier in its mangled name, either. + // CHECK: icmp eq i8* %{{.*}}, bitcast ({ i8*, i8* }* @_ZTIFvvE to i8*), !nosanitize + p(); +} diff --git a/test/CodeGenCXX/ubsan-vtable-checks.cpp b/test/CodeGenCXX/ubsan-vtable-checks.cpp index 090707c29d746..ec4a21a2b2b42 100644 --- a/test/CodeGenCXX/ubsan-vtable-checks.cpp +++ b/test/CodeGenCXX/ubsan-vtable-checks.cpp @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-linux -emit-llvm -fsanitize=null %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NULL --check-prefix=ITANIUM // RUN: %clang_cc1 -std=c++11 -triple x86_64-windows -emit-llvm -fsanitize=null %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NULL --check-prefix=MSABI // RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-linux -emit-llvm -fsanitize=null,vptr %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-VPTR --check-prefix=ITANIUM -// RUN: %clang_cc1 -std=c++11 -triple x86_64-windows -emit-llvm -fsanitize=null,vptr %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-VPTR --check-prefix=MSABI +// RUN: %clang_cc1 -std=c++11 -triple x86_64-windows -emit-llvm -fsanitize=null,vptr %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-VPTR --check-prefix=MSABI --check-prefix=CHECK-VPTR-MS struct T { virtual ~T() {} virtual int v() { return 1; } @@ -14,8 +14,10 @@ struct U : T { U::~U() {} +// CHECK-VPTR-MS: @__ubsan_vptr_type_cache = external dso_local + // ITANIUM: define i32 @_Z5get_vP1T -// MSABI: define i32 @"\01?get_v +// MSABI: define dso_local i32 @"?get_v int get_v(T* t) { // First, we check that vtable is not loaded before a type check. // CHECK-NULL-NOT: load {{.*}} (%struct.T*{{.*}})**, {{.*}} (%struct.T*{{.*}})*** @@ -28,7 +30,7 @@ int get_v(T* t) { } // ITANIUM: define void @_Z9delete_itP1T -// MSABI: define void @"\01?delete_it +// MSABI: define dso_local void @"?delete_it void delete_it(T *t) { // First, we check that vtable is not loaded before a type check. // CHECK-VPTR-NOT: load {{.*}} (%struct.T*{{.*}})**, {{.*}} (%struct.T*{{.*}})*** @@ -40,7 +42,7 @@ void delete_it(T *t) { } // ITANIUM: define %struct.U* @_Z7dyncastP1T -// MSABI: define %struct.U* @"\01?dyncast +// MSABI: define dso_local %struct.U* @"?dyncast U* dyncast(T *t) { // First, we check that dynamic_cast is not called before a type check. // CHECK-VPTR-NOT: call i8* @__{{dynamic_cast|RTDynamicCast}} diff --git a/test/CodeGenCXX/unaligned-member-qualifier.cpp b/test/CodeGenCXX/unaligned-member-qualifier.cpp index 0d326a6668307..57cfbd9e2c212 100644 --- a/test/CodeGenCXX/unaligned-member-qualifier.cpp +++ b/test/CodeGenCXX/unaligned-member-qualifier.cpp @@ -8,13 +8,13 @@ struct A { }; void A::foo() __unaligned {} -// CHECK: define [[THISCALL:(x86_thiscallcc )?]]void @_ZNU11__unaligned1A3fooEv( +// CHECK: define {{(dso_local )?}}[[THISCALL:(x86_thiscallcc )?]]void @_ZNU11__unaligned1A3fooEv( void A::foo() const __unaligned {} -// CHECK: define [[THISCALL]]void @_ZNU11__unalignedK1A3fooEv( +// CHECK: define {{(dso_local )?}}[[THISCALL]]void @_ZNU11__unalignedK1A3fooEv( void A::foo() volatile __unaligned {} -// CHECK: define [[THISCALL]]void @_ZNU11__unalignedV1A3fooEv( +// CHECK: define {{(dso_local )?}}[[THISCALL]]void @_ZNU11__unalignedV1A3fooEv( void A::foo() const volatile __unaligned {} -// CHECK: define [[THISCALL]]void @_ZNU11__unalignedVK1A3fooEv( +// CHECK: define {{(dso_local )?}}[[THISCALL]]void @_ZNU11__unalignedVK1A3fooEv( diff --git a/test/CodeGenCXX/uncopyable-args.cpp b/test/CodeGenCXX/uncopyable-args.cpp index 66d67e4a34d56..baada1ccdfdf9 100644 --- a/test/CodeGenCXX/uncopyable-args.cpp +++ b/test/CodeGenCXX/uncopyable-args.cpp @@ -19,7 +19,7 @@ void bar() { // CHECK: call void @_ZN7trivial3fooENS_1AE(i8* %{{.*}}) // CHECK-LABEL: declare void @_ZN7trivial3fooENS_1AE(i8*) -// WIN64-LABEL: declare void @"\01?foo@trivial@@YAXUA@1@@Z"(i64) +// WIN64-LABEL: declare dso_local void @"?foo@trivial@@YAXUA@1@@Z"(i64) } namespace default_ctor { @@ -40,7 +40,7 @@ void bar() { // CHECK: call void @_ZN12default_ctor3fooENS_1AE(i8* %{{.*}}) // CHECK-LABEL: declare void @_ZN12default_ctor3fooENS_1AE(i8*) -// WIN64-LABEL: declare void @"\01?foo@default_ctor@@YAXUA@1@@Z"(i64) +// WIN64-LABEL: declare dso_local void @"?foo@default_ctor@@YAXUA@1@@Z"(i64) } namespace move_ctor { @@ -63,7 +63,7 @@ void bar() { // NEWABI-LABEL: declare void @_ZN9move_ctor3fooENS_1AE(%"struct.move_ctor::A"*) // OLDABI-LABEL: declare void @_ZN9move_ctor3fooENS_1AE(i8*) -// WIN64-LABEL: declare void @"\01?foo@move_ctor@@YAXUA@1@@Z"(%"struct.move_ctor::A"*) +// WIN64-LABEL: declare dso_local void @"?foo@move_ctor@@YAXUA@1@@Z"(%"struct.move_ctor::A"*) } namespace all_deleted { @@ -85,7 +85,7 @@ void bar() { // NEWABI-LABEL: declare void @_ZN11all_deleted3fooENS_1AE(%"struct.all_deleted::A"*) // OLDABI-LABEL: declare void @_ZN11all_deleted3fooENS_1AE(i8*) -// WIN64-LABEL: declare void @"\01?foo@all_deleted@@YAXUA@1@@Z"(%"struct.all_deleted::A"*) +// WIN64-LABEL: declare dso_local void @"?foo@all_deleted@@YAXUA@1@@Z"(%"struct.all_deleted::A"*) } namespace implicitly_deleted { @@ -107,8 +107,8 @@ void bar() { // OLDABI-LABEL: declare void @_ZN18implicitly_deleted3fooENS_1AE(i8*) // In MSVC 2013, the copy ctor is not deleted by a move assignment. In MSVC 2015, it is. -// WIN64-18-LABEL: declare void @"\01?foo@implicitly_deleted@@YAXUA@1@@Z"(i64 -// WIN64-19-LABEL: declare void @"\01?foo@implicitly_deleted@@YAXUA@1@@Z"(%"struct.implicitly_deleted::A"*) +// WIN64-18-LABEL: declare dso_local void @"?foo@implicitly_deleted@@YAXUA@1@@Z"(i64 +// WIN64-19-LABEL: declare dso_local void @"?foo@implicitly_deleted@@YAXUA@1@@Z"(%"struct.implicitly_deleted::A"*) } namespace one_deleted { @@ -129,7 +129,7 @@ void bar() { // NEWABI-LABEL: declare void @_ZN11one_deleted3fooENS_1AE(%"struct.one_deleted::A"*) // OLDABI-LABEL: declare void @_ZN11one_deleted3fooENS_1AE(i8*) -// WIN64-LABEL: declare void @"\01?foo@one_deleted@@YAXUA@1@@Z"(%"struct.one_deleted::A"*) +// WIN64-LABEL: declare dso_local void @"?foo@one_deleted@@YAXUA@1@@Z"(%"struct.one_deleted::A"*) } namespace copy_defaulted { @@ -149,7 +149,7 @@ void bar() { // CHECK: call void @_ZN14copy_defaulted3fooENS_1AE(i8* %{{.*}}) // CHECK-LABEL: declare void @_ZN14copy_defaulted3fooENS_1AE(i8*) -// WIN64-LABEL: declare void @"\01?foo@copy_defaulted@@YAXUA@1@@Z"(i64) +// WIN64-LABEL: declare dso_local void @"?foo@copy_defaulted@@YAXUA@1@@Z"(i64) } namespace move_defaulted { @@ -169,7 +169,7 @@ void bar() { // CHECK: call void @_ZN14move_defaulted3fooENS_1AE(i8* %{{.*}}) // CHECK-LABEL: declare void @_ZN14move_defaulted3fooENS_1AE(i8*) -// WIN64-LABEL: declare void @"\01?foo@move_defaulted@@YAXUA@1@@Z"(%"struct.move_defaulted::A"*) +// WIN64-LABEL: declare dso_local void @"?foo@move_defaulted@@YAXUA@1@@Z"(%"struct.move_defaulted::A"*) } namespace trivial_defaulted { @@ -188,7 +188,7 @@ void bar() { // CHECK: call void @_ZN17trivial_defaulted3fooENS_1AE(i8* %{{.*}}) // CHECK-LABEL: declare void @_ZN17trivial_defaulted3fooENS_1AE(i8*) -// WIN64-LABEL: declare void @"\01?foo@trivial_defaulted@@YAXUA@1@@Z"(i64) +// WIN64-LABEL: declare dso_local void @"?foo@trivial_defaulted@@YAXUA@1@@Z"(i64) } namespace two_copy_ctors { @@ -211,7 +211,7 @@ void bar() { // NEWABI-LABEL: declare void @_ZN14two_copy_ctors3fooENS_1BE(%"struct.two_copy_ctors::B"*) // OLDABI-LABEL: declare void @_ZN14two_copy_ctors3fooENS_1BE(%"struct.two_copy_ctors::B"* byval -// WIN64-LABEL: declare void @"\01?foo@two_copy_ctors@@YAXUB@1@@Z"(%"struct.two_copy_ctors::B"*) +// WIN64-LABEL: declare dso_local void @"?foo@two_copy_ctors@@YAXUB@1@@Z"(%"struct.two_copy_ctors::B"*) } namespace definition_only { @@ -223,7 +223,7 @@ struct A { void *foo(A a) { return a.p; } // NEWABI-LABEL: define i8* @_ZN15definition_only3fooENS_1AE(%"struct.definition_only::A"* // OLDABI-LABEL: define i8* @_ZN15definition_only3fooENS_1AE(i8* -// WIN64-LABEL: define i8* @"\01?foo@definition_only@@YAPEAXUA@1@@Z"(%"struct.definition_only::A"* +// WIN64-LABEL: define dso_local i8* @"?foo@definition_only@@YAPEAXUA@1@@Z"(%"struct.definition_only::A"* } namespace deleted_by_member { @@ -239,7 +239,7 @@ struct A { void *foo(A a) { return a.b.p; } // NEWABI-LABEL: define i8* @_ZN17deleted_by_member3fooENS_1AE(%"struct.deleted_by_member::A"* // OLDABI-LABEL: define i8* @_ZN17deleted_by_member3fooENS_1AE(i8* -// WIN64-LABEL: define i8* @"\01?foo@deleted_by_member@@YAPEAXUA@1@@Z"(%"struct.deleted_by_member::A"* +// WIN64-LABEL: define dso_local i8* @"?foo@deleted_by_member@@YAPEAXUA@1@@Z"(%"struct.deleted_by_member::A"* } namespace deleted_by_base { @@ -254,7 +254,7 @@ struct A : B { void *foo(A a) { return a.p; } // NEWABI-LABEL: define i8* @_ZN15deleted_by_base3fooENS_1AE(%"struct.deleted_by_base::A"* // OLDABI-LABEL: define i8* @_ZN15deleted_by_base3fooENS_1AE(i8* -// WIN64-LABEL: define i8* @"\01?foo@deleted_by_base@@YAPEAXUA@1@@Z"(%"struct.deleted_by_base::A"* +// WIN64-LABEL: define dso_local i8* @"?foo@deleted_by_base@@YAPEAXUA@1@@Z"(%"struct.deleted_by_base::A"* } namespace deleted_by_member_copy { @@ -270,7 +270,7 @@ struct A { void *foo(A a) { return a.b.p; } // NEWABI-LABEL: define i8* @_ZN22deleted_by_member_copy3fooENS_1AE(%"struct.deleted_by_member_copy::A"* // OLDABI-LABEL: define i8* @_ZN22deleted_by_member_copy3fooENS_1AE(i8* -// WIN64-LABEL: define i8* @"\01?foo@deleted_by_member_copy@@YAPEAXUA@1@@Z"(%"struct.deleted_by_member_copy::A"* +// WIN64-LABEL: define dso_local i8* @"?foo@deleted_by_member_copy@@YAPEAXUA@1@@Z"(%"struct.deleted_by_member_copy::A"* } namespace deleted_by_base_copy { @@ -285,7 +285,7 @@ struct A : B { void *foo(A a) { return a.p; } // NEWABI-LABEL: define i8* @_ZN20deleted_by_base_copy3fooENS_1AE(%"struct.deleted_by_base_copy::A"* // OLDABI-LABEL: define i8* @_ZN20deleted_by_base_copy3fooENS_1AE(i8* -// WIN64-LABEL: define i8* @"\01?foo@deleted_by_base_copy@@YAPEAXUA@1@@Z"(%"struct.deleted_by_base_copy::A"* +// WIN64-LABEL: define dso_local i8* @"?foo@deleted_by_base_copy@@YAPEAXUA@1@@Z"(%"struct.deleted_by_base_copy::A"* } namespace explicit_delete { @@ -296,7 +296,7 @@ struct A { }; // NEWABI-LABEL: define i8* @_ZN15explicit_delete3fooENS_1AE(%"struct.explicit_delete::A"* // OLDABI-LABEL: define i8* @_ZN15explicit_delete3fooENS_1AE(i8* -// WIN64-LABEL: define i8* @"\01?foo@explicit_delete@@YAPEAXUA@1@@Z"(%"struct.explicit_delete::A"* +// WIN64-LABEL: define dso_local i8* @"?foo@explicit_delete@@YAPEAXUA@1@@Z"(%"struct.explicit_delete::A"* void *foo(A a) { return a.p; } } @@ -309,7 +309,7 @@ struct A { }; // NEWABI-LABEL: define {{.*}} @_ZN28implicitly_deleted_copy_ctor3fooENS_1AE(%"struct.implicitly_deleted_copy_ctor::A"* // OLDABI-LABEL: define {{.*}} @_ZN28implicitly_deleted_copy_ctor3fooENS_1AE(i32* -// WIN64-LABEL: define {{.*}} @"\01?foo@implicitly_deleted_copy_ctor@@YAAEAHUA@1@@Z"(%"struct.implicitly_deleted_copy_ctor::A"* +// WIN64-LABEL: define {{.*}} @"?foo@implicitly_deleted_copy_ctor@@YAAEAHUA@1@@Z"(%"struct.implicitly_deleted_copy_ctor::A"* int &foo(A a) { return a.ref; } struct B { @@ -319,7 +319,7 @@ struct B { }; int &foo(B b) { return b.ref; } // CHECK-LABEL: define {{.*}} @_ZN28implicitly_deleted_copy_ctor3fooENS_1BE(i32* -// WIN64-LABEL: define {{.*}} @"\01?foo@implicitly_deleted_copy_ctor@@YAAEAHUB@1@@Z"(i64 +// WIN64-LABEL: define {{.*}} @"?foo@implicitly_deleted_copy_ctor@@YAAEAHUB@1@@Z"(i64 struct X { X(const X&); }; struct Y { Y(const Y&) = default; }; @@ -332,7 +332,7 @@ union C { }; int foo(C c) { return c.n; } // CHECK-LABEL: define {{.*}} @_ZN28implicitly_deleted_copy_ctor3fooENS_1CE(%"union.implicitly_deleted_copy_ctor::C"* -// WIN64-LABEL: define {{.*}} @"\01?foo@implicitly_deleted_copy_ctor@@YAHTC@1@@Z"(%"union.implicitly_deleted_copy_ctor::C"* +// WIN64-LABEL: define {{.*}} @"?foo@implicitly_deleted_copy_ctor@@YAHTC@1@@Z"(%"union.implicitly_deleted_copy_ctor::C"* struct D { D &operator=(const D&); @@ -344,7 +344,7 @@ struct D { }; int foo(D d) { return d.n; } // CHECK-LABEL: define {{.*}} @_ZN28implicitly_deleted_copy_ctor3fooENS_1DE(%"struct.implicitly_deleted_copy_ctor::D"* -// WIN64-LABEL: define {{.*}} @"\01?foo@implicitly_deleted_copy_ctor@@YAHUD@1@@Z"(%"struct.implicitly_deleted_copy_ctor::D"* +// WIN64-LABEL: define {{.*}} @"?foo@implicitly_deleted_copy_ctor@@YAHUD@1@@Z"(%"struct.implicitly_deleted_copy_ctor::D"* union E { // Passed direct: has non-deleted trivial copy ctor. @@ -354,7 +354,7 @@ union E { }; int foo(E e) { return e.n; } // CHECK-LABEL: define {{.*}} @_ZN28implicitly_deleted_copy_ctor3fooENS_1EE(i32 -// WIN64-LABEL: define {{.*}} @"\01?foo@implicitly_deleted_copy_ctor@@YAHTE@1@@Z"(i32 +// WIN64-LABEL: define {{.*}} @"?foo@implicitly_deleted_copy_ctor@@YAHTE@1@@Z"(i32 struct F { // Passed direct: has non-deleted trivial copy ctor. @@ -366,5 +366,5 @@ struct F { }; int foo(F f) { return f.n; } // CHECK-LABEL: define {{.*}} @_ZN28implicitly_deleted_copy_ctor3fooENS_1FE(i32 -// WIN64-LABEL: define {{.*}} @"\01?foo@implicitly_deleted_copy_ctor@@YAHUF@1@@Z"(i32 +// WIN64-LABEL: define {{.*}} @"?foo@implicitly_deleted_copy_ctor@@YAHUF@1@@Z"(i32 } diff --git a/test/CodeGenCXX/value-init.cpp b/test/CodeGenCXX/value-init.cpp index fc4e0d3a55e02..8d76fc534611c 100644 --- a/test/CodeGenCXX/value-init.cpp +++ b/test/CodeGenCXX/value-init.cpp @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-CXX98 +// RUN: %clang_cc1 -std=c++17 %s -triple x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-CXX17 struct A { virtual ~A(); @@ -114,13 +115,15 @@ void f() { // CHECK: call void @llvm.memset.p0i8.i64 // CHECK-NOT: call void @llvm.memset.p0i8.i64 - // CHECK: call void @_ZN6PR98015Test2C1Ev + // CHECK-CXX98: call void @_ZN6PR98015Test2C1Ev + // CHECK-CXX17: call void @_ZN6PR98014TestC1Ev // CHECK-NOT: call void @_ZN6PR98015Test2C1Ev Test2 empty2[3] = {}; // CHECK: call void @llvm.memset.p0i8.i64 // CHECK-NOT: call void @llvm.memset.p0i8.i64 - // CHECK: call void @_ZN6PR98015Test3C1Ev + // CHECK-CXX98: call void @_ZN6PR98015Test3C1Ev + // CHECK-CXX17: call void @_ZN6PR98014TestC2Ev // CHECK-NOT: call void @llvm.memset.p0i8.i64 // CHECK-NOT: call void @_ZN6PR98015Test3C1Ev Test3 empty3[3] = {}; @@ -222,7 +225,7 @@ namespace test6 { // CHECK: [[CUR:%.*]] = phi [20 x [[A]]]* [ [[BEGIN]], {{%.*}} ], [ [[NEXT:%.*]], {{%.*}} ] // Inner loop. - // CHECK-NEXT: [[IBEGIN:%.*]] = getelementptr inbounds [20 x [[A]]], [20 x [[A]]]* [[CUR]], i32 0, i32 0 + // CHECK-NEXT: [[IBEGIN:%.*]] = getelementptr inbounds [20 x [[A]]], [20 x [[A]]]* [[CUR]], i{{32|64}} 0, i{{32|64}} 0 // CHECK-NEXT: [[IEND:%.*]] = getelementptr inbounds [[A]], [[A]]* [[IBEGIN]], i64 20 // CHECK-NEXT: br label // CHECK: [[ICUR:%.*]] = phi [[A]]* [ [[IBEGIN]], {{%.*}} ], [ [[INEXT:%.*]], {{%.*}} ] @@ -244,7 +247,7 @@ namespace PR11124 { struct C : B { C(); }; C::C() : A(3), B() {} // CHECK-LABEL: define void @_ZN7PR111241CC1Ev - // CHECK: call void @llvm.memset.p0i8.i64(i8* {{.*}}, i8 0, i64 12, i32 8, i1 false) + // CHECK: call void @llvm.memset.p0i8.i64(i8* align 8 {{.*}}, i8 0, i64 12, i1 false) // CHECK-NEXT: call void @_ZN7PR111241BC2Ev // Make sure C::C doesn't overwrite parts of A while it is zero-initializing B @@ -252,7 +255,7 @@ namespace PR11124 { struct C2 : B2 { C2(); }; C2::C2() : A(3), B2() {} // CHECK-LABEL: define void @_ZN7PR111242C2C1Ev - // CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %{{.*}}, i8* {{.*}}, i64 16, i32 8, i1 false) + // CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %{{.*}}, i8* align 8 {{.*}}, i64 16, i1 false) // CHECK-NEXT: call void @_ZN7PR111242B2C2Ev } @@ -327,3 +330,12 @@ int explicitly_defaulted() { // CHECK: call void @llvm.memset.p0i8.i64 // CHECK-NEXT: call void @_ZN8zeroinit2X2IiEC2Ev // CHECK-NEXT: ret void + +#if __cplusplus >= 201103L +namespace transparent_init_list { + struct optional_assign_base {}; + struct optional_data_dtor_base { char dummy_[24]; }; + struct optional : optional_data_dtor_base, optional_assign_base {}; + optional f(optional a) { return {optional(a)}; } +} +#endif diff --git a/test/CodeGenCXX/vararg-non-pod-ms-compat.cpp b/test/CodeGenCXX/vararg-non-pod-ms-compat.cpp index 64b1c525a614f..8f413021b3d0c 100644 --- a/test/CodeGenCXX/vararg-non-pod-ms-compat.cpp +++ b/test/CodeGenCXX/vararg-non-pod-ms-compat.cpp @@ -10,17 +10,17 @@ struct X { void vararg(...); void test(X x) { - // CHECK-LABEL: define void @"\01?test@@YAXUX@@@Z" + // CHECK-LABEL: define dso_local void @"?test@@YAXUX@@@Z" // X86: %[[argmem:[^ ]*]] = alloca inalloca <{ %struct.X }> - // X86: call void (<{ %struct.X }>*, ...) bitcast (void (...)* @"\01?vararg@@YAXZZ" to void (<{ %struct.X }>*, ...)*)(<{ %struct.X }>* inalloca %[[argmem]]) + // X86: call void (<{ %struct.X }>*, ...) bitcast (void (...)* @"?vararg@@YAXZZ" to void (<{ %struct.X }>*, ...)*)(<{ %struct.X }>* inalloca %[[argmem]]) // X64: alloca %struct.X // X64: %[[agg:[^ ]*]] = alloca %struct.X // X64: %[[valptr:[^ ]*]] = getelementptr inbounds %struct.X, %struct.X* %[[agg]], i32 0, i32 0 // X64: %[[val:[^ ]*]] = load i32, i32* %[[valptr]] - // X64: call void (...) @"\01?vararg@@YAXZZ"(i32 %[[val]]) + // X64: call void (...) @"?vararg@@YAXZZ"(i32 %[[val]]) // CHECK-NOT: llvm.trap vararg(x); diff --git a/test/CodeGenCXX/varargs.cpp b/test/CodeGenCXX/varargs.cpp index e0165994d013f..1f82d6098269e 100644 --- a/test/CodeGenCXX/varargs.cpp +++ b/test/CodeGenCXX/varargs.cpp @@ -35,7 +35,7 @@ namespace test1 { // CHECK-NEXT: [[TMP:%.*]] = alloca [[A]], align 4 // CHECK-NEXT: [[T0:%.*]] = bitcast [[A]]* [[TMP]] to i8* // CHECK-NEXT: [[T1:%.*]] = bitcast [[A]]* [[X]] to i8* - // CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[T0]], i8* [[T1]], i64 8, i32 4, i1 false) + // CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 [[T0]], i8* align 4 [[T1]], i64 8, i1 false) // CHECK-NEXT: [[T0:%.*]] = bitcast [[A]]* [[TMP]] to i64* // CHECK-NEXT: [[T1:%.*]] = load i64, i64* [[T0]], align 4 // CHECK-NEXT: call void (...) @_ZN5test13fooEz(i64 [[T1]]) diff --git a/test/CodeGenCXX/virt-template-vtable.cpp b/test/CodeGenCXX/virt-template-vtable.cpp index a71db48a79a04..66d2332ca3341 100644 --- a/test/CodeGenCXX/virt-template-vtable.cpp +++ b/test/CodeGenCXX/virt-template-vtable.cpp @@ -16,10 +16,10 @@ extern template class A<short>; template class A<short>; -// CHECK: @_ZTV1B = linkonce_odr unnamed_addr constant -// CHECK: @_ZTV1AIlE = weak_odr unnamed_addr constant -// CHECK: @_ZTV1AIsE = weak_odr unnamed_addr constant -// CHECK: @_ZTV1AIiE = linkonce_odr unnamed_addr constant +// CHECK: @_ZTV1B = linkonce_odr {{(dso_local )?}}unnamed_addr constant +// CHECK: @_ZTV1AIlE = weak_odr {{(dso_local )?}}unnamed_addr constant +// CHECK: @_ZTV1AIsE = weak_odr {{(dso_local )?}}unnamed_addr constant +// CHECK: @_ZTV1AIiE = linkonce_odr {{(dso_local )?}}unnamed_addr constant template<class T> struct C { virtual void c() {} diff --git a/test/CodeGenCXX/virtual-base-cast.cpp b/test/CodeGenCXX/virtual-base-cast.cpp index b2f2b4f2b3192..d3a799933db48 100644 --- a/test/CodeGenCXX/virtual-base-cast.cpp +++ b/test/CodeGenCXX/virtual-base-cast.cpp @@ -18,7 +18,7 @@ A* a() { return x; } // CHECK: load i32, i32* [[CASTVBASEOFFSETPTRA]] // CHECK: } -// MSVC: @"\01?a@@YAPAUA@@XZ"() [[NUW:#[0-9]+]] { +// MSVC: @"?a@@YAPAUA@@XZ"() [[NUW:#[0-9]+]] { // MSVC: %[[vbptr_off:.*]] = getelementptr inbounds i8, i8* {{.*}}, i32 0 // MSVC: %[[vbptr:.*]] = bitcast i8* %[[vbptr_off]] to i32** // MSVC: %[[vbtable:.*]] = load i32*, i32** %[[vbptr]] @@ -35,7 +35,7 @@ B* b() { return x; } // CHECK: } // Same as 'a' except we use a different vbtable offset. -// MSVC: @"\01?b@@YAPAUB@@XZ"() [[NUW:#[0-9]+]] { +// MSVC: @"?b@@YAPAUB@@XZ"() [[NUW:#[0-9]+]] { // MSVC: %[[vbptr_off:.*]] = getelementptr inbounds i8, i8* {{.*}}, i32 0 // MSVC: %[[vbptr:.*]] = bitcast i8* %[[vbptr_off]] to i32** // MSVC: %[[vbtable:.*]] = load i32*, i32** %[[vbptr]] @@ -54,7 +54,7 @@ BB* c() { return x; } // CHECK: } // Same as 'a' except we use a different vbtable offset. -// MSVC: @"\01?c@@YAPAUBB@@XZ"() [[NUW:#[0-9]+]] { +// MSVC: @"?c@@YAPAUBB@@XZ"() [[NUW:#[0-9]+]] { // MSVC: %[[vbptr_off:.*]] = getelementptr inbounds i8, i8* {{.*}}, i32 0 // MSVC: %[[vbptr:.*]] = bitcast i8* %[[vbptr_off]] to i32** // MSVC: %[[vbtable:.*]] = load i32*, i32** %[[vbptr]] @@ -73,7 +73,7 @@ BB* d() { return y; } // Same as 'c' except the vbptr offset is 4, changing the initial GEP and the // final add. -// MSVC: @"\01?d@@YAPAUBB@@XZ"() [[NUW:#[0-9]+]] { +// MSVC: @"?d@@YAPAUBB@@XZ"() [[NUW:#[0-9]+]] { // MSVC: %[[vbptr_off:.*]] = getelementptr inbounds i8, i8* {{.*}}, i32 4 // MSVC: %[[vbptr:.*]] = bitcast i8* %[[vbptr_off]] to i32** // MSVC: %[[vbtable:.*]] = load i32*, i32** %[[vbptr]] diff --git a/test/CodeGenCXX/virtual-base-ctor.cpp b/test/CodeGenCXX/virtual-base-ctor.cpp index 8c8c310421dc5..e32296f1641f6 100644 --- a/test/CodeGenCXX/virtual-base-ctor.cpp +++ b/test/CodeGenCXX/virtual-base-ctor.cpp @@ -8,4 +8,4 @@ struct A { int a; A() { y = ((size_t)this - (size_t)&x) / sizeof(void*); } }; struct B : virtual A { void* x; }; B x; -// CHECK: @y = local_unnamed_addr global i8 2 +// CHECK: @y = {{(dso_local )?}}local_unnamed_addr global i8 2 diff --git a/test/CodeGenCXX/virtual-bases.cpp b/test/CodeGenCXX/virtual-bases.cpp index e9c568c31b488..259b1c157b1e6 100644 --- a/test/CodeGenCXX/virtual-bases.cpp +++ b/test/CodeGenCXX/virtual-bases.cpp @@ -4,7 +4,7 @@ struct A { A(); }; -// CHECK: @_ZN1AC1Ev = alias {{.*}} @_ZN1AC2Ev +// CHECK: @_ZN1AC1Ev = unnamed_addr alias {{.*}} @_ZN1AC2Ev // CHECK-LABEL: define void @_ZN1AC2Ev(%struct.A* %this) unnamed_addr A::A() { } @@ -46,3 +46,37 @@ struct D : B, C { D::D() { } } + +namespace virtualBaseAlignment { + +// Check that the store to B::x in the base constructor has an 8-byte alignment. + +// CHECK: define linkonce_odr void @_ZN20virtualBaseAlignment1BC1Ev(%[[STRUCT_B:.*]]* %[[THIS:.*]]) +// CHECK: %[[THIS_ADDR:.*]] = alloca %[[STRUCT_B]]*, align 8 +// CHECK: store %[[STRUCT_B]]* %[[THIS]], %[[STRUCT_B]]** %[[THIS_ADDR]], align 8 +// CHECK: %[[THIS1:.*]] = load %[[STRUCT_B]]*, %[[STRUCT_B]]** %[[THIS_ADDR]], align 8 +// CHECK: %[[X:.*]] = getelementptr inbounds %[[STRUCT_B]], %[[STRUCT_B]]* %[[THIS1]], i32 0, i32 2 +// CHECK: store i32 123, i32* %[[X]], align 16 + +// CHECK: define linkonce_odr void @_ZN20virtualBaseAlignment1BC2Ev(%[[STRUCT_B]]* %[[THIS:.*]], i8** %{{.*}}) +// CHECK: %[[THIS_ADDR:.*]] = alloca %[[STRUCT_B]]*, align 8 +// CHECK: store %[[STRUCT_B]]* %[[THIS]], %[[STRUCT_B]]** %[[THIS_ADDR]], align 8 +// CHECK: %[[THIS1:.*]] = load %[[STRUCT_B]]*, %[[STRUCT_B]]** %[[THIS_ADDR]], align 8 +// CHECK: %[[X:.*]] = getelementptr inbounds %[[STRUCT_B]], %[[STRUCT_B]]* %[[THIS1]], i32 0, i32 2 +// CHECK: store i32 123, i32* %[[X]], align 8 + +struct A { + __attribute__((aligned(16))) double data1; +}; + +struct B : public virtual A { + B() : x(123) {} + double a; + int x; +}; + +struct C : public virtual B {}; + +void test() { B b; C c; } + +} diff --git a/test/CodeGenCXX/virtual-destructor-calls.cpp b/test/CodeGenCXX/virtual-destructor-calls.cpp index 2e63daac31de2..10d82367fde82 100644 --- a/test/CodeGenCXX/virtual-destructor-calls.cpp +++ b/test/CodeGenCXX/virtual-destructor-calls.cpp @@ -14,11 +14,11 @@ struct B : A { }; // Complete dtor: just an alias because there are no virtual bases. -// CHECK: @_ZN1BD1Ev = alias {{.*}} @_ZN1BD2Ev +// CHECK: @_ZN1BD1Ev = unnamed_addr alias {{.*}} @_ZN1BD2Ev // (aliases from C) -// CHECK: @_ZN1CD2Ev = alias {{.*}}, bitcast {{.*}} @_ZN1BD2Ev -// CHECK: @_ZN1CD1Ev = alias {{.*}} @_ZN1CD2Ev +// CHECK: @_ZN1CD2Ev = unnamed_addr alias {{.*}}, bitcast {{.*}} @_ZN1BD2Ev +// CHECK: @_ZN1CD1Ev = unnamed_addr alias {{.*}} @_ZN1CD2Ev // Base dtor: actually calls A's base dtor. // CHECK-LABEL: define void @_ZN1BD2Ev(%struct.B* %this) unnamed_addr diff --git a/test/CodeGenCXX/virtual-function-attrs.cpp b/test/CodeGenCXX/virtual-function-attrs.cpp index 3a9a1a28ddf44..873412d47545f 100644 --- a/test/CodeGenCXX/virtual-function-attrs.cpp +++ b/test/CodeGenCXX/virtual-function-attrs.cpp @@ -8,7 +8,7 @@ class A { void A::f() {} -// CHECK: define [[CC:(x86_thiscallcc )?]]void @_ZN1A1fEv({{.*}}) unnamed_addr -// CHECK: declare [[CC]]void @_ZN1A1gEv({{.*}}) unnamed_addr +// CHECK: define {{(dso_local )?}}[[CC:(x86_thiscallcc )?]]void @_ZN1A1fEv({{.*}}) unnamed_addr +// CHECK: declare {{(dso_local )?}}[[CC]]void @_ZN1A1gEv({{.*}}) unnamed_addr // CHECK: declare {{.*}} @_ZN1AD1Ev({{.*}}) unnamed_addr -// CHECK: declare [[CC]]void @_ZN1AD0Ev({{.*}}) unnamed_addr +// CHECK: declare {{(dso_local )?}}[[CC]]void @_ZN1AD0Ev({{.*}}) unnamed_addr diff --git a/test/CodeGenCXX/virtual-function-calls.cpp b/test/CodeGenCXX/virtual-function-calls.cpp index 22944d94ca883..61b2fbad7a3aa 100644 --- a/test/CodeGenCXX/virtual-function-calls.cpp +++ b/test/CodeGenCXX/virtual-function-calls.cpp @@ -44,7 +44,7 @@ namespace VirtualNoreturn { }; // CHECK-LABEL: @_ZN15VirtualNoreturn1f - // CHECK-INVARIANT-LABEL: define void @_ZN15VirtualNoreturn1f + // CHECK-INVARIANT-LABEL: define {{(dso_local )?}}void @_ZN15VirtualNoreturn1f void f(A *p) { p->f(); // CHECK: call {{.*}}void %{{[^#]*$}} diff --git a/test/CodeGenCXX/visibility-pr36810.cpp b/test/CodeGenCXX/visibility-pr36810.cpp new file mode 100644 index 0000000000000..5df1df6851368 --- /dev/null +++ b/test/CodeGenCXX/visibility-pr36810.cpp @@ -0,0 +1,23 @@ +// RUN: %clang_cc1 -triple x86_64-apple-macosx -std=c++11 -fvisibility hidden -emit-llvm -o - %s -O2 -disable-llvm-passes | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-macosx -DUNDEF_G -std=c++11 -fvisibility hidden -emit-llvm -o - %s -O2 -disable-llvm-passes | FileCheck %s + +namespace std { +template <class> +class __attribute__((__type_visibility__("default"))) shared_ptr { + template <class> friend class shared_ptr; +}; +} +struct dict; +#ifndef UNDEF_G +std::shared_ptr<dict> g; +#endif +class __attribute__((visibility("default"))) Bar; +template <class = std::shared_ptr<Bar>> +class __attribute__((visibility("default"))) i { + std::shared_ptr<int> foo() const; +}; + +// CHECK: define void @_ZNK1iISt10shared_ptrI3BarEE3fooEv +template <> std::shared_ptr<int> i<>::foo() const { + return std::shared_ptr<int>(); +} diff --git a/test/CodeGenCXX/vla-consruct.cpp b/test/CodeGenCXX/vla-consruct.cpp index fd8314a5d7160..87191fe99da7b 100644 --- a/test/CodeGenCXX/vla-consruct.cpp +++ b/test/CodeGenCXX/vla-consruct.cpp @@ -21,6 +21,8 @@ void test(int n) { // CHECK: define void {{.*test.*}}(i32 [[n:%.+]]) # // CHECK: [[n_addr:%.+]] = alloca // CHECK-NEXT: [[saved_stack:%.+]] = alloca + // CHECK-NEXT: [[vla_expr:%.+]] = alloca i64, align 8 + // CHECK-NEXT: [[vla_expr1:%.+]] = alloca i64, align 8 // CHECK-NEXT: [[sizeof_S:%.+]] = alloca // CHECK-NEXT: [[sizeof_array_t_0_0:%.+]] = alloca // CHECK-NEXT: [[sizeof_array_t_0:%.+]] = alloca @@ -37,6 +39,8 @@ void test(int n) { // CHECK-NEXT: store i8* [[t4]], i8** [[saved_stack]] // CHECK-NEXT: [[t5:%.+]] = mul nuw i64 [[t1]], [[t3]] // CHECK-NEXT: [[vla:%.+]] = alloca [[struct_S]], i64 [[t5]] + // CHECK-NEXT: store i64 [[t1]], i64* [[vla_expr]] + // CHECK-NEXT: store i64 [[t3]], i64* [[vla_expr1]] // CHECK-NEXT: [[t6:%.+]] = mul nuw i64 [[t1]], [[t3]] // CHECK-NEXT: [[isempty:%.+]] = icmp eq i64 [[t6]], 0 // CHECK-NEXT: br i1 [[isempty]], label %[[arrayctor_cont:.+]], label %[[new_ctorloop:.+]] diff --git a/test/CodeGenCXX/vla.cpp b/test/CodeGenCXX/vla.cpp index b8652f8329a57..81ff62d2cbf86 100644 --- a/test/CodeGenCXX/vla.cpp +++ b/test/CodeGenCXX/vla.cpp @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -std=c++11 -triple x86_64-apple-darwin %s -emit-llvm -o - | FileCheck -check-prefixes=X64,CHECK %s -// RUN: %clang_cc1 -std=c++11 -triple amdgcn---amdgiz %s -emit-llvm -o - | FileCheck -check-prefixes=AMD,CHECK %s +// RUN: %clang_cc1 -std=c++11 -triple amdgcn %s -emit-llvm -o - | FileCheck -check-prefixes=AMDGCN,CHECK %s template<typename T> struct S { @@ -19,17 +19,17 @@ int f() { void test0(void *array, int n) { // CHECK-LABEL: define void @_Z5test0Pvi( // X64: [[ARRAY:%.*]] = alloca i8*, align 8 - // AMD: [[ARRAY0:%.*]] = alloca i8*, align 8, addrspace(5) - // AMD-NEXT: [[ARRAY:%.*]] = addrspacecast i8* addrspace(5)* [[ARRAY0]] to i8** + // AMDGCN: [[ARRAY0:%.*]] = alloca i8*, align 8, addrspace(5) + // AMDGCN-NEXT: [[ARRAY:%.*]] = addrspacecast i8* addrspace(5)* [[ARRAY0]] to i8** // X64-NEXT: [[N:%.*]] = alloca i32, align 4 - // AMD: [[N0:%.*]] = alloca i32, align 4, addrspace(5) - // AMD-NEXT: [[N:%.*]] = addrspacecast i32 addrspace(5)* [[N0]] to i32* + // AMDGCN: [[N0:%.*]] = alloca i32, align 4, addrspace(5) + // AMDGCN-NEXT: [[N:%.*]] = addrspacecast i32 addrspace(5)* [[N0]] to i32* // X64-NEXT: [[REF:%.*]] = alloca i16*, align 8 - // AMD: [[REF0:%.*]] = alloca i16*, align 8, addrspace(5) - // AMD-NEXT: [[REF:%.*]] = addrspacecast i16* addrspace(5)* [[REF0]] to i16** + // AMDGCN: [[REF0:%.*]] = alloca i16*, align 8, addrspace(5) + // AMDGCN-NEXT: [[REF:%.*]] = addrspacecast i16* addrspace(5)* [[REF0]] to i16** // X64-NEXT: [[S:%.*]] = alloca i16, align 2 - // AMD: [[S0:%.*]] = alloca i16, align 2, addrspace(5) - // AMD-NEXT: [[S:%.*]] = addrspacecast i16 addrspace(5)* [[S0]] to i16* + // AMDGCN: [[S0:%.*]] = alloca i16, align 2, addrspace(5) + // AMDGCN-NEXT: [[S:%.*]] = addrspacecast i16 addrspace(5)* [[S0]] to i16* // CHECK-NEXT: store i8* // CHECK-NEXT: store i32 @@ -68,8 +68,8 @@ void test0(void *array, int n) { void test2(int b) { // CHECK-LABEL: define void {{.*}}test2{{.*}}(i32 %b) int varr[b]; - // AMD: %__end = alloca i32*, align 8, addrspace(5) - // AMD: [[END:%.*]] = addrspacecast i32* addrspace(5)* %__end to i32** + // AMDGCN: %__end1 = alloca i32*, align 8, addrspace(5) + // AMDGCN: [[END:%.*]] = addrspacecast i32* addrspace(5)* %__end1 to i32** // get the address of %b by checking the first store that stores it //CHECK: store i32 %b, i32* [[PTR_B:%.*]] @@ -86,16 +86,16 @@ void test2(int b) { //CHECK: [[VLA_SIZEOF:%.*]] = mul nuw i64 4, [[VLA_NUM_ELEMENTS_PRE]] //CHECK-NEXT: [[VLA_NUM_ELEMENTS_POST:%.*]] = udiv i64 [[VLA_SIZEOF]], 4 //CHECK-NEXT: [[VLA_END_PTR:%.*]] = getelementptr inbounds i32, i32* {{%.*}}, i64 [[VLA_NUM_ELEMENTS_POST]] - //X64-NEXT: store i32* [[VLA_END_PTR]], i32** %__end - //AMD-NEXT: store i32* [[VLA_END_PTR]], i32** [[END]] + //X64-NEXT: store i32* [[VLA_END_PTR]], i32** %__end1 + //AMDGCN-NEXT: store i32* [[VLA_END_PTR]], i32** [[END]] for (int d : varr) 0; } void test3(int b, int c) { // CHECK-LABEL: define void {{.*}}test3{{.*}}(i32 %b, i32 %c) int varr[b][c]; - // AMD: %__end = alloca i32*, align 8, addrspace(5) - // AMD: [[END:%.*]] = addrspacecast i32* addrspace(5)* %__end to i32** + // AMDGCN: %__end1 = alloca i32*, align 8, addrspace(5) + // AMDGCN: [[END:%.*]] = addrspacecast i32* addrspace(5)* %__end1 to i32** // get the address of %b by checking the first store that stores it //CHECK: store i32 %b, i32* [[PTR_B:%.*]] //CHECK-NEXT: store i32 %c, i32* [[PTR_C:%.*]] @@ -120,7 +120,7 @@ void test3(int b, int c) { //CHECK-NEXT: [[VLA_END_INDEX:%.*]] = mul nsw i64 [[VLA_NUM_ELEMENTS]], [[VLA_DIM2_PRE]] //CHECK-NEXT: [[VLA_END_PTR:%.*]] = getelementptr inbounds i32, i32* {{%.*}}, i64 [[VLA_END_INDEX]] //X64-NEXT: store i32* [[VLA_END_PTR]], i32** %__end - //AMD-NEXT: store i32* [[VLA_END_PTR]], i32** [[END]] + //AMDGCN-NEXT: store i32* [[VLA_END_PTR]], i32** [[END]] for (auto &d : varr) 0; } diff --git a/test/CodeGenCXX/volatile-1.cpp b/test/CodeGenCXX/volatile-1.cpp index 75fb0d26f413f..525e828da3934 100644 --- a/test/CodeGenCXX/volatile-1.cpp +++ b/test/CodeGenCXX/volatile-1.cpp @@ -1,11 +1,11 @@ // RUN: %clang_cc1 -Wno-unused-value -triple %itanium_abi_triple -emit-llvm %s -std=c++98 -o - | FileCheck %s // RUN: %clang_cc1 -Wno-unused-value -triple %itanium_abi_triple -emit-llvm %s -std=c++11 -o - | FileCheck -check-prefix=CHECK -check-prefix=CHECK11 %s -// CHECK: @i = global [[INT:i[0-9]+]] 0 +// CHECK: @i = {{(dso_local )?}}global [[INT:i[0-9]+]] 0 volatile int i, j, k; volatile int ar[5]; volatile char c; -// CHECK: @ci = global [[CINT:.*]] zeroinitializer +// CHECK: @ci = {{(dso_local )?}}global [[CINT:.*]] zeroinitializer volatile _Complex int ci; volatile struct S { #ifdef __cplusplus diff --git a/test/CodeGenCXX/vtable-assume-load.cpp b/test/CodeGenCXX/vtable-assume-load.cpp index b0857c29c6541..d1c2350391568 100644 --- a/test/CodeGenCXX/vtable-assume-load.cpp +++ b/test/CodeGenCXX/vtable-assume-load.cpp @@ -163,8 +163,8 @@ struct __declspec(novtable) S { void g(S &s) { s.foo(); } // if struct has novtable specifier, then we can't generate assumes -// CHECK-MS-LABEL: define void @"\01?test@testMS@@YAXXZ"() -// CHECK-MS: call x86_thiscallcc %"struct.testMS::S"* @"\01??0S@testMS@@QAE@XZ"( +// CHECK-MS-LABEL: define dso_local void @"?test@testMS@@YAXXZ"() +// CHECK-MS: call x86_thiscallcc %"struct.testMS::S"* @"??0S@testMS@@QAE@XZ"( // CHECK-MS-NOT: @llvm.assume // CHECK-MS-LABEL: {{^}}} diff --git a/test/CodeGenCXX/vtable-available-externally.cpp b/test/CodeGenCXX/vtable-available-externally.cpp index 0e7e8b4a3226b..24c2eac23becf 100644 --- a/test/CodeGenCXX/vtable-available-externally.cpp +++ b/test/CodeGenCXX/vtable-available-externally.cpp @@ -1,22 +1,26 @@ // RUN: %clang_cc1 %s -I%S -triple=x86_64-apple-darwin10 -std=c++98 -emit-llvm -o %t // RUN: %clang_cc1 %s -I%S -triple=x86_64-apple-darwin10 -std=c++98 -O2 -disable-llvm-passes -emit-llvm -o %t.opt -// RUN: FileCheck --check-prefix=CHECK-TEST1 %s < %t -// RUN: FileCheck --check-prefix=CHECK-TEST2 %s < %t -// RUN: FileCheck --check-prefix=CHECK-TEST5 %s < %t -// RUN: FileCheck --check-prefix=CHECK-TEST8 %s < %t.opt -// RUN: FileCheck --check-prefix=CHECK-TEST9 %s < %t.opt -// RUN: FileCheck --check-prefix=CHECK-TEST10 %s < %t.opt -// RUN: FileCheck --check-prefix=CHECK-TEST11 %s < %t.opt -// RUN: FileCheck --check-prefix=CHECK-TEST12 %s < %t.opt -// RUN: FileCheck --check-prefix=CHECK-TEST13 %s < %t.opt -// RUN: FileCheck --check-prefix=CHECK-TEST14 %s < %t.opt -// RUN: FileCheck --check-prefix=CHECK-TEST15 %s < %t.opt -// RUN: FileCheck --check-prefix=CHECK-TEST16 %s < %t.opt -// RUN: FileCheck --check-prefix=CHECK-TEST17 %s < %t.opt +// RUN: %clang_cc1 %s -I%S -triple=x86_64-apple-darwin10 -std=c++98 -O2 -disable-llvm-passes -emit-llvm -o %t.vtable -fforce-emit-vtables -fstrict-vtable-pointers -mconstructor-aliases +// RUN: FileCheck -allow-deprecated-dag-overlap --check-prefix=CHECK-TEST1 %s < %t +// RUN: FileCheck -allow-deprecated-dag-overlap --check-prefix=CHECK-TEST2 %s < %t +// RUN: FileCheck -allow-deprecated-dag-overlap --check-prefix=CHECK-TEST5 %s < %t +// RUN: FileCheck -allow-deprecated-dag-overlap --check-prefix=CHECK-TEST8 %s < %t.opt +// RUN: FileCheck -allow-deprecated-dag-overlap --check-prefix=CHECK-TEST9 %s < %t.opt +// RUN: FileCheck -allow-deprecated-dag-overlap --check-prefix=CHECK-TEST10 %s < %t.opt +// RUN: FileCheck -allow-deprecated-dag-overlap --check-prefix=CHECK-TEST11 %s < %t.opt +// RUN: FileCheck -allow-deprecated-dag-overlap --check-prefix=CHECK-TEST12 %s < %t.opt +// RUN: FileCheck -allow-deprecated-dag-overlap --check-prefix=CHECK-TEST13 %s < %t.opt +// RUN: FileCheck -allow-deprecated-dag-overlap --check-prefix=CHECK-TEST14 %s < %t.opt +// RUN: FileCheck -allow-deprecated-dag-overlap --check-prefix=CHECK-TEST15 %s < %t.opt +// RUN: FileCheck -allow-deprecated-dag-overlap --check-prefix=CHECK-TEST16 %s < %t.opt +// RUN: FileCheck -allow-deprecated-dag-overlap --check-prefix=CHECK-TEST17 %s < %t.opt +// RUN: FileCheck -allow-deprecated-dag-overlap --check-prefix=CHECK-FORCE-EMIT %s < %t.vtable + #include <typeinfo> // CHECK-TEST1: @_ZTVN5Test11AE = external unnamed_addr constant +// CHECK-FORCE-EMIT-DAG: @_ZTVN5Test11AE = available_externally unnamed_addr constant namespace Test1 { struct A { @@ -213,6 +217,7 @@ namespace Test10 { // because A's key function is defined here, vtable is generated in this TU // CHECK-TEST10-DAG: @_ZTVN6Test101AE = unnamed_addr constant +// CHECK-FORCE-EMIT-DAG: @_ZTVN6Test101AE = unnamed_addr constant struct A { virtual void foo(); virtual void bar(); @@ -221,6 +226,7 @@ void A::foo() {} // Because key function is inline we will generate vtable as linkonce_odr. // CHECK-TEST10-DAG: @_ZTVN6Test101DE = linkonce_odr unnamed_addr constant +// CHECK-FORCE-EMIT-DAG: @_ZTVN6Test101DE = linkonce_odr unnamed_addr constant struct D : A { void bar(); }; @@ -237,6 +243,7 @@ struct B : A { // can't guarantee that we will be able to refer to bar from name // so (at the moment) we can't emit vtable available_externally. // CHECK-TEST10-DAG: @_ZTVN6Test101CE = external unnamed_addr constant +// CHECK-FORCE-EMIT-DAG: @_ZTVN6Test101CE = available_externally unnamed_addr constant struct C : A { void bar() {} // defined in body - not key function virtual inline void gar(); // inline in body - not key function @@ -245,6 +252,8 @@ struct C : A { // no key function, vtable will be generated everywhere it will be used // CHECK-TEST10-DAG: @_ZTVN6Test101EE = linkonce_odr unnamed_addr constant +// CHECK-FORCE-EMIT-DAG: @_ZTVN6Test101EE = linkonce_odr unnamed_addr constant + struct E : A {}; void g(A& a) { @@ -298,11 +307,13 @@ void g() { namespace Test12 { // CHECK-TEST12: @_ZTVN6Test121AE = external unnamed_addr constant +// CHECK-FORCE-EMIT-DAG: @_ZTVN6Test121AE = available_externally unnamed_addr constant struct A { virtual void foo(); virtual ~A() {} }; // CHECK-TEST12: @_ZTVN6Test121BE = external unnamed_addr constant +// CHECK-FORCE-EMIT-DAG: @_ZTVN6Test121BE = available_externally unnamed_addr constant struct B : A { void foo(); }; @@ -319,6 +330,9 @@ namespace Test13 { // CHECK-TEST13-DAG: @_ZTVN6Test131AE = available_externally unnamed_addr constant // CHECK-TEST13-DAG: @_ZTVN6Test131BE = external unnamed_addr constant +// CHECK-FORCE-EMIT-DAG: @_ZTVN6Test131AE = available_externally unnamed_addr constant +// CHECK-FORCE-EMIT-DAG: @_ZTVN6Test131BE = available_externally unnamed_addr constant + struct A { virtual ~A(); }; @@ -371,6 +385,8 @@ namespace Test16 { // generate available_externally vtable for it. // CHECK-TEST16-DAG: @_ZTVN6Test161SE = external unnamed_addr constant // CHECK-TEST16-DAG: @_ZTVN6Test162S2E = available_externally +// CHECK-FORCE-EMIT-DAG: @_ZTVN6Test161SE = external unnamed_addr constant +// CHECK-FORCE-EMIT-DAG: @_ZTVN6Test162S2E = available_externally struct S { __attribute__((visibility("hidden"))) virtual void doStuff(); @@ -395,6 +411,10 @@ namespace Test17 { // This test checks if we emit vtables opportunistically. // CHECK-TEST17-DAG: @_ZTVN6Test171AE = available_externally // CHECK-TEST17-DAG: @_ZTVN6Test171BE = external +// CHECK-FORCE-EMIT-DAG: @_ZTVN6Test171AE = available_externally +// CHECK-FORCE-EMIT-DAG: @_ZTVN6Test171BE = available_externally +// CHECK-FORCE-EMIT-DAG: define linkonce_odr void @_ZN6Test171BD2Ev( +// CHECK-FORCE-EMIT-DAG: define linkonce_odr void @_ZN6Test171BD0Ev( struct A { virtual void key(); @@ -418,3 +438,111 @@ void testcaseB() { } } // namespace Test17 + +namespace Test18 { +// Here vtable will be only emitted because it is referenced by assume-load +// after the Derived construction. +// CHECK-FORCE-EMIT-DAG: @_ZTVN6Test187DerivedE = linkonce_odr unnamed_addr constant {{.*}} @_ZTIN6Test187DerivedE {{.*}} @_ZN6Test184Base3funEv {{.*}} @_ZN6Test184BaseD2Ev {{.*}} @_ZN6Test187DerivedD0Ev +// CHECK-FORCE-EMIT-DAG: define linkonce_odr void @_ZN6Test187DerivedD0Ev +// CHECK-FORCE-EMIT-DAG: define linkonce_odr void @_ZN6Test184BaseD2Ev +// CHECK-FORCE-EMIT-DAG: define linkonce_odr i32 @_ZN6Test184Base3funEv +// CHECK-FORCE-EMIT-DAG: @_ZTIN6Test187DerivedE = linkonce_odr constant + +struct Base { + virtual int fun() { return 42; } + virtual ~Base() { } +}; + +struct Derived : Base { + Derived(); +}; + +int foo() { + Derived *der = new Derived(); + return der->fun(); +} +} + +namespace TestTemplates { + +// CHECK-FORCE-EMIT-DAG: @_ZTVN13TestTemplates8TemplateIiEE = linkonce_odr unnamed_addr constant {{.*}} @_ZTIN13TestTemplates8TemplateIiEE {{.*}} @_ZN13TestTemplates8TemplateIiE3fooEi {{.*}}@_ZN13TestTemplates8TemplateIiE22thisShouldBeEmittedTooEi {{.*}}@_ZN13TestTemplates8TemplateIiED1Ev {{.*}}@_ZN13TestTemplates8TemplateIiED0Ev +// CHECK-FORCE-EMIT-DAG: define linkonce_odr i32 @_ZN13TestTemplates8TemplateIiE22thisShouldBeEmittedTooEi + +template<class T> +struct Template { + Template(); + virtual T foo(T val); + // CHECK-FORCE-EMIT-DAG: define linkonce_odr i32 @_ZN13TestTemplates8TemplateIiE22thisShouldBeEmittedTooEi + virtual T thisShouldBeEmittedToo(T val) { return val; } + virtual ~Template(); +}; + + +struct NonTemplate { + typedef int T; + NonTemplate(); + virtual T foo(T val); + // CHECK-FORCE-EMIT-DAG: define linkonce_odr i32 @_ZN13TestTemplates11NonTemplate22thisShouldBeEmittedTooEi + virtual T thisShouldBeEmittedToo(T val) { return val; } + virtual ~NonTemplate(); +}; + +// CHECK-FORCE-EMIT-DAG: @_ZTVN13TestTemplates16OuterNonTemplate27NestedTemplateInNonTemplateIiEE = linkonce_odr {{.*}} @_ZTIN13TestTemplates16OuterNonTemplate27NestedTemplateInNonTemplateIiEE {{.*}} @_ZN13TestTemplates16OuterNonTemplate27NestedTemplateInNonTemplateIiE3fooEi {{.*}} @_ZN13TestTemplates16OuterNonTemplate27NestedTemplateInNonTemplateIiE22thisShouldBeEmittedTooEi {{.*}} @_ZN13TestTemplates16OuterNonTemplate27NestedTemplateInNonTemplateIiED1Ev {{.*}} @_ZN13TestTemplates16OuterNonTemplate27NestedTemplateInNonTemplateIiED0Ev + +struct OuterNonTemplate { + template<class T> + struct NestedTemplateInNonTemplate { + NestedTemplateInNonTemplate(); + virtual T foo(T val); + // CHECK-FORCE-EMIT-DAG: define linkonce_odr i32 @_ZN13TestTemplates16OuterNonTemplate27NestedTemplateInNonTemplateIiE22thisShouldBeEmittedTooEi + virtual T thisShouldBeEmittedToo(T val) { return val; } + virtual ~NestedTemplateInNonTemplate(); + }; + + struct NestedNonTemplateInNonTemplate { + typedef int T; + NestedNonTemplateInNonTemplate(); + virtual T foo(T val); + // CHECK-FORCE-EMIT-DAG: define linkonce_odr i32 @_ZN13TestTemplates16OuterNonTemplate30NestedNonTemplateInNonTemplate22thisShouldBeEmittedTooEi + virtual T thisShouldBeEmittedToo(T val) { return val; } + virtual ~NestedNonTemplateInNonTemplate(); + }; +}; + +template<class> +struct OuterTemplate { + template<class T> + struct NestedTemplateInTemplate { + NestedTemplateInTemplate(); + virtual T foo(T val); + // CHECK-FORCE-EMIT-DAG: define linkonce_odr i32 @_ZN13TestTemplates13OuterTemplateIlE24NestedTemplateInTemplateIiE22thisShouldBeEmittedTooEi + virtual T thisShouldBeEmittedToo(T val) { return val; } + virtual ~NestedTemplateInTemplate(); + }; + + struct NestedNonTemplateInTemplate { + typedef int T; + NestedNonTemplateInTemplate(); + virtual T foo(T val); + // CHECK-FORCE-EMIT-DAG: define linkonce_odr i32 @_ZN13TestTemplates13OuterTemplateIlE27NestedNonTemplateInTemplate22thisShouldBeEmittedTooEi + virtual T thisShouldBeEmittedToo(T val) { return val; } + virtual ~NestedNonTemplateInTemplate(); + }; +}; + +template<class T> +int use() { + T *ptr = new T(); + return ptr->foo(42); +} + +void test() { + use<Template<int> >(); + use<OuterTemplate<long>::NestedTemplateInTemplate<int> >(); + use<OuterNonTemplate::NestedTemplateInNonTemplate<int> >(); + + use<NonTemplate>(); + use<OuterTemplate<long>::NestedNonTemplateInTemplate>(); + use<OuterNonTemplate::NestedNonTemplateInNonTemplate>(); +} +} diff --git a/test/CodeGenCXX/vtable-key-function-ios.cpp b/test/CodeGenCXX/vtable-key-function-ios.cpp index 8a3466beda442..a119c780bb4e2 100644 --- a/test/CodeGenCXX/vtable-key-function-ios.cpp +++ b/test/CodeGenCXX/vtable-key-function-ios.cpp @@ -28,8 +28,8 @@ struct Test0a { // V-table should be defined externally. Test0a::Test0a() { use(typeid(Test0a)); } -// CHECK: @_ZTV6Test0a = external unnamed_addr constant -// CHECK: @_ZTI6Test0a = external constant +// CHECK: @_ZTV6Test0a = external {{(dso_local )?}}unnamed_addr constant +// CHECK: @_ZTI6Test0a = external {{(dso_local )?}}constant // This is not a key function. void Test0a::foo() {} @@ -47,8 +47,8 @@ void Test0b::foo() {} // V-table should be defined externally. Test0b::Test0b() { use(typeid(Test0b)); } -// CHECK: @_ZTV6Test0b = external unnamed_addr constant -// CHECK: @_ZTI6Test0b = external constant +// CHECK: @_ZTV6Test0b = external {{(dso_local )?}}unnamed_addr constant +// CHECK: @_ZTI6Test0b = external {{(dso_local )?}}constant /*** Test1a ******************************************************************/ @@ -60,9 +60,9 @@ struct Test1a { // V-table needs to be defined weakly. Test1a::Test1a() { use(typeid(Test1a)); } -// CHECK: @_ZTV6Test1a = linkonce_odr unnamed_addr constant -// CHECK-LATE: @_ZTS6Test1a = linkonce_odr constant -// CHECK-LATE: @_ZTI6Test1a = linkonce_odr constant +// CHECK: @_ZTV6Test1a = linkonce_odr {{(dso_local )?}}unnamed_addr constant +// CHECK-LATE: @_ZTS6Test1a = linkonce_odr {{(dso_local )?}}constant +// CHECK-LATE: @_ZTI6Test1a = linkonce_odr {{(dso_local )?}}constant // This defines the key function. inline void Test1a::foo() {} @@ -80,9 +80,9 @@ inline void Test1b::foo() {} // V-table should be defined weakly.. Test1b::Test1b() { use(typeid(Test1b)); } -// CHECK: @_ZTV6Test1b = linkonce_odr unnamed_addr constant -// CHECK: @_ZTS6Test1b = linkonce_odr constant -// CHECK: @_ZTI6Test1b = linkonce_odr constant +// CHECK: @_ZTV6Test1b = linkonce_odr {{(dso_local )?}}unnamed_addr constant +// CHECK: @_ZTS6Test1b = linkonce_odr {{(dso_local )?}}constant +// CHECK: @_ZTI6Test1b = linkonce_odr {{(dso_local )?}}constant /*** Test2a ******************************************************************/ @@ -94,9 +94,9 @@ struct Test2a { // V-table should be defined with weak linkage. Test2a::Test2a() { use(typeid(Test2a)); } -// CHECK: @_ZTV6Test2a = linkonce_odr unnamed_addr constant -// CHECK-LATE: @_ZTS6Test2a = linkonce_odr constant -// CHECK-LATE: @_ZTI6Test2a = linkonce_odr constant +// CHECK: @_ZTV6Test2a = linkonce_odr {{(dso_local )?}}unnamed_addr constant +// CHECK-LATE: @_ZTS6Test2a = linkonce_odr {{(dso_local )?}}constant +// CHECK-LATE: @_ZTI6Test2a = linkonce_odr {{(dso_local )?}}constant void Test2a::bar() {} inline void Test2a::foo() {} @@ -113,9 +113,9 @@ void Test2b::bar() {} // V-table should be defined with weak linkage. Test2b::Test2b() { use(typeid(Test2b)); } -// CHECK: @_ZTV6Test2b = linkonce_odr unnamed_addr constant -// CHECK-LATE: @_ZTS6Test2b = linkonce_odr constant -// CHECK-LATE: @_ZTI6Test2b = linkonce_odr constant +// CHECK: @_ZTV6Test2b = linkonce_odr {{(dso_local )?}}unnamed_addr constant +// CHECK-LATE: @_ZTS6Test2b = linkonce_odr {{(dso_local )?}}constant +// CHECK-LATE: @_ZTI6Test2b = linkonce_odr {{(dso_local )?}}constant inline void Test2b::foo() {} @@ -132,9 +132,9 @@ inline void Test2c::foo() {} // V-table should be defined with weak linkage. Test2c::Test2c() { use(typeid(Test2c)); } -// CHECK: @_ZTV6Test2c = linkonce_odr unnamed_addr constant -// CHECK: @_ZTS6Test2c = linkonce_odr constant -// CHECK: @_ZTI6Test2c = linkonce_odr constant +// CHECK: @_ZTV6Test2c = linkonce_odr {{(dso_local )?}}unnamed_addr constant +// CHECK: @_ZTS6Test2c = linkonce_odr {{(dso_local )?}}constant +// CHECK: @_ZTI6Test2c = linkonce_odr {{(dso_local )?}}constant /*** Test3a ******************************************************************/ @@ -146,9 +146,9 @@ struct Test3a { // V-table should be defined with weak linkage. Test3a::Test3a() { use(typeid(Test3a)); } -// CHECK: @_ZTV6Test3a = linkonce_odr unnamed_addr constant -// CHECK-LATE: @_ZTS6Test3a = linkonce_odr constant -// CHECK-LATE: @_ZTI6Test3a = linkonce_odr constant +// CHECK: @_ZTV6Test3a = linkonce_odr {{(dso_local )?}}unnamed_addr constant +// CHECK-LATE: @_ZTS6Test3a = linkonce_odr {{(dso_local )?}}constant +// CHECK-LATE: @_ZTI6Test3a = linkonce_odr {{(dso_local )?}}constant // This defines the key function. inline void Test3a::bar() {} @@ -166,9 +166,9 @@ inline void Test3b::bar() {} // V-table should be defined with weak linkage. Test3b::Test3b() { use(typeid(Test3b)); } -// CHECK: @_ZTV6Test3b = linkonce_odr unnamed_addr constant -// CHECK-LATE: @_ZTS6Test3b = linkonce_odr constant -// CHECK-LATE: @_ZTI6Test3b = linkonce_odr constant +// CHECK: @_ZTV6Test3b = linkonce_odr {{(dso_local )?}}unnamed_addr constant +// CHECK-LATE: @_ZTS6Test3b = linkonce_odr {{(dso_local )?}}constant +// CHECK-LATE: @_ZTI6Test3b = linkonce_odr {{(dso_local )?}}constant // This defines the key function. inline void Test3b::foo() {} @@ -187,6 +187,6 @@ inline void Test3c::foo() {} // V-table should be defined with weak linkage. Test3c::Test3c() { use(typeid(Test3c)); } -// CHECK: @_ZTV6Test3c = linkonce_odr unnamed_addr constant -// CHECK: @_ZTS6Test3c = linkonce_odr constant -// CHECK: @_ZTI6Test3c = linkonce_odr constant +// CHECK: @_ZTV6Test3c = linkonce_odr {{(dso_local )?}}unnamed_addr constant +// CHECK: @_ZTS6Test3c = linkonce_odr {{(dso_local )?}}constant +// CHECK: @_ZTI6Test3c = linkonce_odr {{(dso_local )?}}constant diff --git a/test/CodeGenCXX/vtable-key-function-win-comdat.cpp b/test/CodeGenCXX/vtable-key-function-win-comdat.cpp index 3dd1be7dc69cb..e7c5be93b8075 100644 --- a/test/CodeGenCXX/vtable-key-function-win-comdat.cpp +++ b/test/CodeGenCXX/vtable-key-function-win-comdat.cpp @@ -20,6 +20,6 @@ inline void Test1a::foo() {} // CHECK-NOT: $_ZTS6Test1a.1 = comdat any // CHECK-NOT: $_ZTI6Test1a.1 = comdat any -// CHECK: @_ZTV6Test1a = linkonce_odr unnamed_addr constant {{.*}} ({ i8*, i8* }* @_ZTI6Test1a to i8*) -// CHECK: @_ZTS6Test1a = linkonce_odr constant -// CHECK: @_ZTI6Test1a = linkonce_odr constant {{.*}} [8 x i8]* @_ZTS6Test1a +// CHECK: @_ZTV6Test1a = linkonce_odr dso_local unnamed_addr constant {{.*}} ({ i8*, i8* }* @_ZTI6Test1a to i8*) +// CHECK: @_ZTS6Test1a = linkonce_odr dso_local constant +// CHECK: @_ZTI6Test1a = linkonce_odr dso_local constant {{.*}} [8 x i8]* @_ZTS6Test1a diff --git a/test/CodeGenCXX/wasm-eh.cpp b/test/CodeGenCXX/wasm-eh.cpp new file mode 100644 index 0000000000000..ea77fec820392 --- /dev/null +++ b/test/CodeGenCXX/wasm-eh.cpp @@ -0,0 +1,384 @@ +// RUN: %clang_cc1 %s -triple wasm32-unknown-unknown -fms-extensions -fexceptions -fcxx-exceptions -target-feature +exception-handling -emit-llvm -o - -std=c++11 | FileCheck %s +// RUN: %clang_cc1 %s -triple wasm64-unknown-unknown -fms-extensions -fexceptions -fcxx-exceptions -target-feature +exception-handling -emit-llvm -o - -std=c++11 | FileCheck %s + +void may_throw(); +void dont_throw() noexcept; + +struct Cleanup { + ~Cleanup() { dont_throw(); } +}; + +// Multiple catch clauses w/o catch-all +void test0() { + try { + may_throw(); + } catch (int) { + dont_throw(); + } catch (double) { + dont_throw(); + } +} + +// CHECK-LABEL: define void @_Z5test0v() {{.*}} personality i8* bitcast (i32 (...)* @__gxx_wasm_personality_v0 to i8*) + +// CHECK: %[[INT_ALLOCA:.*]] = alloca i32 +// CHECK: invoke void @_Z9may_throwv() +// CHECK-NEXT: to label %[[NORMAL_BB:.*]] unwind label %[[CATCHDISPATCH_BB:.*]] + +// CHECK: [[CATCHDISPATCH_BB]]: +// CHECK-NEXT: %[[CATCHSWITCH:.*]] = catchswitch within none [label %[[CATCHSTART_BB:.*]]] unwind to caller + +// CHECK: [[CATCHSTART_BB]]: +// CHECK-NEXT: %[[CATCHPAD:.*]] = catchpad within %[[CATCHSWITCH]] [i8* bitcast (i8** @_ZTIi to i8*), i8* bitcast (i8** @_ZTId to i8*)] +// CHECK-NEXT: %[[EXN:.*]] = call i8* @llvm.wasm.get.exception(token %[[CATCHPAD]]) +// CHECK-NEXT: store i8* %[[EXN]], i8** %exn.slot +// CHECK-NEXT: %[[SELECTOR:.*]] = call i32 @llvm.wasm.get.ehselector(token %[[CATCHPAD]]) +// CHECK-NEXT: %[[TYPEID:.*]] = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*)) #2 +// CHECK-NEXT: %[[MATCHES:.*]] = icmp eq i32 %[[SELECTOR]], %[[TYPEID]] +// CHECK-NEXT: br i1 %[[MATCHES]], label %[[CATCH_INT_BB:.*]], label %[[CATCH_FALLTHROUGH_BB:.*]] + +// CHECK: [[CATCH_INT_BB]]: +// CHECK-NEXT: %[[EXN:.*]] = load i8*, i8** %exn.slot +// CHECK-NEXT: %[[ADDR:.*]] = call i8* @__cxa_begin_catch(i8* %[[EXN]]) {{.*}} [ "funclet"(token %[[CATCHPAD]]) ] +// CHECK-NEXT: %[[ADDR_CAST:.*]] = bitcast i8* %[[ADDR]] to i32* +// CHECK-NEXT: %[[INT_VAL:.*]] = load i32, i32* %[[ADDR_CAST]] +// CHECK-NEXT: store i32 %[[INT_VAL]], i32* %[[INT_ALLOCA]] +// CHECK-NEXT: call void @_Z10dont_throwv() {{.*}} [ "funclet"(token %[[CATCHPAD]]) ] +// CHECK-NEXT: call void @__cxa_end_catch() {{.*}} [ "funclet"(token %[[CATCHPAD]]) ] +// CHECK-NEXT: catchret from %[[CATCHPAD]] to label %[[CATCHRET_DEST_BB0:.*]] + +// CHECK: [[CATCHRET_DEST_BB0]]: +// CHECK-NEXT: br label %[[TRY_CONT_BB:.*]] + +// CHECK: [[CATCH_FALLTHROUGH_BB]] +// CHECK-NEXT: %[[TYPEID:.*]] = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTId to i8*)) #2 +// CHECK-NEXT: %[[MATCHES:.*]] = icmp eq i32 %[[SELECTOR]], %[[TYPEID]] +// CHECK-NEXT: br i1 %[[MATCHES]], label %[[CATCH_FLOAT_BB:.*]], label %[[RETHROW_BB:.*]] + +// CHECK: [[CATCH_FLOAT_BB]]: +// CHECK: catchret from %[[CATCHPAD]] to label %[[CATCHRET_DEST_BB1:.*]] + +// CHECK: [[CATCHRET_DEST_BB1]]: +// CHECK-NEXT: br label %[[TRY_CONT_BB]] + +// CHECK: [[RETHROW_BB]]: +// CHECK-NEXT: call void @__cxa_rethrow() {{.*}} [ "funclet"(token %[[CATCHPAD]]) ] +// CHECK-NEXT: unreachable + +// Single catch-all +void test1() { + try { + may_throw(); + } catch (...) { + dont_throw(); + } +} + +// CATCH-LABEL: @_Z5test1v() + +// CHECK: %[[CATCHSWITCH:.*]] = catchswitch within none [label %[[CATCHSTART_BB:.*]]] unwind to caller + +// CHECK: [[CATCHSTART_BB]]: +// CHECK-NEXT: %[[CATCHPAD:.*]] = catchpad within %[[CATCHSWITCH]] [i8* null] +// CHECK: br label %[[CATCH_ALL_BB:.*]] + +// CHECK: [[CATCH_ALL_BB]]: +// CHECK: catchret from %[[CATCHPAD]] to label + +// Multiple catch clauses w/ catch-all +void test2() { + try { + may_throw(); + } catch (int) { + dont_throw(); + } catch (...) { + dont_throw(); + } +} + +// CHECK-LABEL: @_Z5test2v() + +// CHECK: %[[CATCHSWITCH:.*]] = catchswitch within none [label %[[CATCHSTART_BB:.*]]] unwind to caller + +// CHECK: [[CATCHSTART_BB]]: +// CHECK-NEXT: %[[CATCHPAD:.*]] = catchpad within %[[CATCHSWITCH]] [i8* bitcast (i8** @_ZTIi to i8*), i8* null] +// CHECK: br i1 %{{.*}}, label %[[CATCH_INT_BB:.*]], label %[[CATCH_ALL_BB:.*]] + +// CHECK: [[CATCH_INT_BB]]: +// CHECK: catchret from %[[CATCHPAD]] to label + +// CHECK: [[CATCH_ALL_BB]]: +// CHECK: catchret from %[[CATCHPAD]] to label + +// Cleanup +void test3() { + Cleanup c; + may_throw(); +} + +// CHECK-LABEL: @_Z5test3v() + +// CHECK: invoke void @_Z9may_throwv() +// CHECK-NEXT: to label {{.*}} unwind label %[[EHCLEANUP_BB:.*]] + +// CHECK: [[EHCLEANUP_BB]]: +// CHECK-NEXT: %[[CLEANUPPAD:.*]] = cleanuppad within none [] +// CHECK-NEXT: call %struct.Cleanup* @_ZN7CleanupD1Ev(%struct.Cleanup* %{{.*}}) {{.*}} [ "funclet"(token %[[CLEANUPPAD]]) ] +// CHECK-NEXT: cleanupret from %[[CLEANUPPAD]] unwind to caller + +// Possibly throwing function call within a catch +void test4() { + try { + may_throw(); + } catch (int) { + may_throw(); + } +} + +// CHECK-LABEL: @_Z5test4v() + +// CHECK: %[[CATCHSWITCH]] = catchswitch within none [label %[[CATCHSTART_BB]]] unwind to caller + +// CHECK: [[CATCHSTART_BB]]: +// CHECK: %[[CATCHPAD:.*]] = catchpad within %[[CATCHSWITCH]] [i8* bitcast (i8** @_ZTIi to i8*)] + +// CHECK: invoke void @_Z9may_throwv() [ "funclet"(token %[[CATCHPAD]]) ] +// CHECK-NEXT: to label %[[INVOKE_CONT_BB:.*]] unwind label %[[EHCLEANUP_BB:.*]] + +// CHECK: [[INVOKE_CONT_BB]]: +// CHECK-NEXT: call void @__cxa_end_catch() {{.*}} [ "funclet"(token %[[CATCHPAD]]) ] +// CHECK-NEXT: catchret from %[[CATCHPAD]] to label + +// CHECK: [[EHCLEANUP_BB]]: +// CHECK-NEXT: %[[CLEANUPPAD:.*]] = cleanuppad within %[[CATCHPAD]] [] +// CHECK-NEXT: call void @__cxa_end_catch() {{.*}} [ "funclet"(token %[[CLEANUPPAD]]) ] +// CHECK-NEXT: cleanupret from %[[CLEANUPPAD]] unwind to caller + +// Possibly throwing function call within a catch-all +void test5() { + try { + may_throw(); + } catch (...) { + may_throw(); + } +} + +// CHECK-LABEL: @_Z5test5v() + +// CHECK: %[[CATCHSWITCH:.*]] = catchswitch within none [label %[[CATCHSTART_BB]]] unwind to caller + +// CHECK: [[CATCHSTART_BB]]: +// CHECK: %[[CATCHPAD:.*]] = catchpad within %[[CATCHSWITCH]] [i8* null] + +// CHECK: invoke void @_Z9may_throwv() [ "funclet"(token %[[CATCHPAD]]) ] +// CHECK-NEXT: to label %[[INVOKE_CONT_BB0:.*]] unwind label %[[EHCLEANUP_BB:.*]] + +// CHECK: [[INVOKE_CONT_BB0]]: +// CHECK-NEXT: call void @__cxa_end_catch() [ "funclet"(token %[[CATCHPAD]]) ] +// CHECK-NEXT: catchret from %[[CATCHPAD]] to label + +// CHECK: [[EHCLEANUP_BB]]: +// CHECK-NEXT: %[[CLEANUPPAD0:.*]] = cleanuppad within %[[CATCHPAD]] [] +// CHECK-NEXT: invoke void @__cxa_end_catch() [ "funclet"(token %[[CLEANUPPAD0]]) ] +// CHECK-NEXT: to label %[[INVOKE_CONT_BB1:.*]] unwind label %[[TERMINATE_BB:.*]] + +// CHECK: [[INVOKE_CONT_BB1]]: +// CHECK-NEXT: cleanupret from %[[CLEANUPPAD0]] unwind to caller + +// CHECK: [[TERMINATE_BB]]: +// CHECK-NEXT: %[[CLEANUPPAD1:.*]] = cleanuppad within %[[CLEANUPPAD0]] [] +// CHECK-NEXT: %[[EXN:.*]] = call i8* @llvm.wasm.get.exception(token %[[CLEANUPPAD1]]) +// CHECK-NEXT: call void @__clang_call_terminate(i8* %[[EXN]]) {{.*}} [ "funclet"(token %[[CLEANUPPAD1]]) ] +// CHECK-NEXT: unreachable + +// CHECK-LABEL: define {{.*}} void @__clang_call_terminate(i8*) +// CHECK-NEXT: call i8* @__cxa_begin_catch(i8* %{{.*}}) +// CHECK-NEXT: call void @_ZSt9terminatev() +// CHECK-NEXT: unreachable + +// Try-catch with cleanups +void test6() { + Cleanup c1; + try { + Cleanup c2; + may_throw(); + } catch (int) { + Cleanup c3; + may_throw(); + } +} + +// CHECK-LABEL: @_Z5test6v() +// CHECK: invoke void @_Z9may_throwv() +// CHECK-NEXT: to label %{{.*}} unwind label %[[EHCLEANUP_BB0:.*]] + +// CHECK: [[EHCLEANUP_BB0]]: +// CHECK-NEXT: %[[CLEANUPPAD0:.*]] = cleanuppad within none [] +// CHECK-NEXT: call %struct.Cleanup* @_ZN7CleanupD1Ev(%struct.Cleanup* {{.*}}) {{.*}} [ "funclet"(token %[[CLEANUPPAD0]]) ] +// CHECK-NEXT: cleanupret from %[[CLEANUPPAD0]] unwind label %[[CATCH_DISPATCH_BB:.*]] + +// CHECK: [[CATCH_DISPATCH_BB]]: +// CHECK-NEXT: %[[CATCHSWITCH:.*]] = catchswitch within none [label %[[CATCHSTART_BB:.*]]] unwind label %[[EHCLEANUP_BB1:.*]] + +// CHECK: [[CATCHSTART_BB]]: +// CHECK-NEXT: %[[CATCHPAD:.*]] = catchpad within %[[CATCHSWITCH]] [i8* bitcast (i8** @_ZTIi to i8*)] +// CHECK: br i1 %{{.*}}, label %[[CATCH_INT_BB:.*]], label %[[RETHROW_BB:.*]] + +// CHECK: [[CATCH_INT_BB]]: +// CHECK: invoke void @_Z9may_throwv() [ "funclet"(token %[[CATCHPAD]]) ] +// CHECK-NEXT: to label %[[INVOKE_CONT_BB:.*]] unwind label %[[EHCLEANUP_BB2:.*]] + +// CHECK: [[INVOKE_CONT_BB]]: +// CHECK: catchret from %[[CATCHPAD]] to label %{{.*}} + +// CHECK: [[RETHROW_BB]]: +// CHECK-NEXT: invoke void @__cxa_rethrow() {{.*}} [ "funclet"(token %[[CATCHPAD]]) ] +// CHECK-NEXT: to label %[[UNREACHABLE_BB:.*]] unwind label %[[EHCLEANUP_BB1:.*]] + +// CHECK: [[EHCLEANUP_BB2]]: +// CHECK-NEXT: %[[CLEANUPPAD2:.*]] = cleanuppad within %[[CATCHPAD]] [] +// CHECK-NEXT: call %struct.Cleanup* @_ZN7CleanupD1Ev(%struct.Cleanup* %{{.*}}) {{.*}} [ "funclet"(token %[[CLEANUPPAD2]]) ] +// CHECK-NEXT: cleanupret from %[[CLEANUPPAD2]] unwind label %[[EHCLEANUP_BB3:.*]] + +// CHECK: [[EHCLEANUP_BB3]]: +// CHECK-NEXT: %[[CLEANUPPAD3:.*]] = cleanuppad within %[[CATCHPAD]] [] +// CHECK: cleanupret from %[[CLEANUPPAD3]] unwind label %[[EHCLEANUP_BB1:.*]] + +// CHECK: [[EHCLEANUP_BB1]]: +// CHECK-NEXT: %[[CLEANUPPAD1:.*]] = cleanuppad within none [] +// CHECK-NEXT: call %struct.Cleanup* @_ZN7CleanupD1Ev(%struct.Cleanup* %{{.*}}) {{.*}} [ "funclet"(token %[[CLEANUPPAD1]]) ] +// CHECK-NEXT: cleanupret from %[[CLEANUPPAD1]] unwind to caller + +// CHECK: [[UNREACHABLE_BB]]: +// CHECK-NEXT: unreachable + +// Nested try-catches within a try with cleanups +void test7() { + Cleanup c1; + may_throw(); + try { + Cleanup c2; + may_throw(); + try { + Cleanup c3; + may_throw(); + } catch (int) { + may_throw(); + } catch (double) { + may_throw(); + } + } catch (int) { + may_throw(); + } catch (...) { + may_throw(); + } +} + +// CHECK-LABEL: @_Z5test7v() +// CHECK: invoke void @_Z9may_throwv() + +// CHECK: invoke void @_Z9may_throwv() + +// CHECK: invoke void @_Z9may_throwv() + +// CHECK: %[[CLEANUPPAD0:.*]] = cleanuppad within none [] +// CHECK: cleanupret from %[[CLEANUPPAD0]] unwind label + +// CHECK: %[[CATCHSWITCH0:.*]] = catchswitch within none + +// CHECK: %[[CATCHPAD0:.*]] = catchpad within %[[CATCHSWITCH0]] [i8* bitcast (i8** @_ZTIi to i8*), i8* bitcast (i8** @_ZTId to i8*)] + +// CHECK: invoke void @_Z9may_throwv() [ "funclet"(token %[[CATCHPAD0]]) ] + +// CHECK: catchret from %[[CATCHPAD0]] to label + +// CHECK: invoke void @_Z9may_throwv() [ "funclet"(token %[[CATCHPAD0]]) ] + +// CHECK: catchret from %[[CATCHPAD0]] to label + +// CHECK: invoke void @__cxa_rethrow() {{.*}} [ "funclet"(token %[[CATCHPAD0]]) ] + +// CHECK: %[[CLEANUPPAD1:.*]] = cleanuppad within %[[CATCHPAD0]] [] +// CHECK: cleanupret from %[[CLEANUPPAD1]] unwind label + +// CHECK: %[[CLEANUPPAD2:.*]] = cleanuppad within %[[CATCHPAD0]] [] +// CHECK: cleanupret from %[[CLEANUPPAD2]] unwind label + +// CHECK: %[[CLEANUPPAD3:.*]] = cleanuppad within none [] +// CHECK: cleanupret from %[[CLEANUPPAD3]] unwind label + +// CHECK: %[[CATCHSWITCH1:.*]] = catchswitch within none + +// CHECK: %[[CATCHPAD1:.*]] = catchpad within %[[CATCHSWITCH1]] [i8* bitcast (i8** @_ZTIi to i8*), i8* null] + +// CHECK: invoke void @_Z9may_throwv() [ "funclet"(token %[[CATCHPAD1]]) ] + +// CHECK: catchret from %[[CATCHPAD1]] to label + +// CHECK: invoke void @_Z9may_throwv() [ "funclet"(token %[[CATCHPAD1]]) ] + +// CHECK: invoke void @__cxa_end_catch() [ "funclet"(token %[[CATCHPAD1]]) ] + +// CHECK: catchret from %[[CATCHPAD1]] to label + +// CHECK: %[[CLEANUPPAD4:.*]] = cleanuppad within %[[CATCHPAD1]] [] +// CHECK: invoke void @__cxa_end_catch() [ "funclet"(token %[[CLEANUPPAD4]]) ] + +// CHECK: cleanupret from %[[CLEANUPPAD4]] unwind label + +// CHECK: %[[CLEANUPPAD5:.*]] = cleanuppad within %[[CATCHPAD1]] [] +// CHECK: cleanupret from %[[CLEANUPPAD5]] unwind label + +// CHECK: %[[CLEANUPPAD6:.*]] = cleanuppad within none [] +// CHECK: cleanupret from %[[CLEANUPPAD6]] unwind to caller + +// CHECK: unreachable + +// CHECK: %[[CLEANUPPAD7:.*]] = cleanuppad within %[[CLEANUPPAD4]] [] +// CHECK: call void @__clang_call_terminate(i8* %{{.*}}) {{.*}} [ "funclet"(token %[[CLEANUPPAD7]]) ] +// CHECK: unreachable + +// Nested try-catches within a catch +void test8() { + try { + may_throw(); + } catch (int) { + try { + may_throw(); + } catch (int) { + may_throw(); + } + } +} + +// CHECK-LABEL: @_Z5test8v() +// CHECK: invoke void @_Z9may_throwv() + +// CHECK: %[[CATCHSWITCH0:.*]] = catchswitch within none + +// CHECK: %[[CATCHPAD0:.*]] = catchpad within %[[CATCHSWITCH0]] [i8* bitcast (i8** @_ZTIi to i8*)] + +// CHECK: invoke void @_Z9may_throwv() [ "funclet"(token %[[CATCHPAD0]]) ] + +// CHECK: %[[CATCHSWITCH1:.*]] = catchswitch within %[[CATCHPAD0]] + +// CHECK: %[[CATCHPAD1:.*]] = catchpad within %[[CATCHSWITCH1]] [i8* bitcast (i8** @_ZTIi to i8*)] + +// CHECK: invoke void @_Z9may_throwv() [ "funclet"(token %[[CATCHPAD1]]) ] + +// CHECK: catchret from %[[CATCHPAD1]] to label + +// CHECK: invoke void @__cxa_rethrow() {{.*}} [ "funclet"(token %[[CATCHPAD1]]) ] + +// CHECK: catchret from %[[CATCHPAD0]] to label + +// CHECK: call void @__cxa_rethrow() {{.*}} [ "funclet"(token %[[CATCHPAD0]]) ] +// CHECK: unreachable + +// CHECK: %[[CLEANUPPAD0:.*]] = cleanuppad within %[[CATCHPAD1]] [] +// CHECK: cleanupret from %[[CLEANUPPAD0]] unwind label + +// CHECK: %[[CLEANUPPAD1:.*]] = cleanuppad within %[[CATCHPAD0]] [] +// CHECK: cleanupret from %[[CLEANUPPAD1]] unwind to caller + +// CHECK: unreachable diff --git a/test/CodeGenCXX/weak-extern-typeinfo.cpp b/test/CodeGenCXX/weak-extern-typeinfo.cpp index 38f6a3e462330..6bbb473a8e8d1 100644 --- a/test/CodeGenCXX/weak-extern-typeinfo.cpp +++ b/test/CodeGenCXX/weak-extern-typeinfo.cpp @@ -31,17 +31,17 @@ class V2 : public virtual V1 { void V1::foo() { } void V2::foo() { } -// CHECK: @_ZTS1A = weak_odr constant -// CHECK: @_ZTI1A = weak_odr constant -// CHECK: @_ZTS1B = weak_odr constant -// CHECK: @_ZTI1B = weak_odr constant -// CHECK: @_ZTS1C = weak_odr constant -// CHECK: @_ZTS2T1 = linkonce_odr constant -// CHECK: @_ZTI2T1 = linkonce_odr constant -// CHECK: @_ZTS1T = linkonce_odr constant -// CHECK: @_ZTI1T = linkonce_odr constant -// CHECK: @_ZTI1C = weak_odr constant -// CHECK: @_ZTS2V1 = weak_odr constant -// CHECK: @_ZTI2V1 = weak_odr constant -// CHECK: @_ZTS2V2 = weak_odr constant -// CHECK: @_ZTI2V2 = weak_odr constant +// CHECK: @_ZTS1A = weak_odr {{(dso_local )?}}constant +// CHECK: @_ZTI1A = weak_odr {{(dso_local )?}}constant +// CHECK: @_ZTS1B = weak_odr {{(dso_local )?}}constant +// CHECK: @_ZTI1B = weak_odr {{(dso_local )?}}constant +// CHECK: @_ZTS1C = weak_odr {{(dso_local )?}}constant +// CHECK: @_ZTS2T1 = linkonce_odr {{(dso_local )?}}constant +// CHECK: @_ZTI2T1 = linkonce_odr {{(dso_local )?}}constant +// CHECK: @_ZTS1T = linkonce_odr {{(dso_local )?}}constant +// CHECK: @_ZTI1T = linkonce_odr {{(dso_local )?}}constant +// CHECK: @_ZTI1C = weak_odr {{(dso_local )?}}constant +// CHECK: @_ZTS2V1 = weak_odr {{(dso_local )?}}constant +// CHECK: @_ZTI2V1 = weak_odr {{(dso_local )?}}constant +// CHECK: @_ZTS2V2 = weak_odr {{(dso_local )?}}constant +// CHECK: @_ZTI2V2 = weak_odr {{(dso_local )?}}constant diff --git a/test/CodeGenCXX/windows-implicit-dllexport-template-specialization.cpp b/test/CodeGenCXX/windows-implicit-dllexport-template-specialization.cpp index c2f2a0773e907..20ba4bc5d0405 100644 --- a/test/CodeGenCXX/windows-implicit-dllexport-template-specialization.cpp +++ b/test/CodeGenCXX/windows-implicit-dllexport-template-specialization.cpp @@ -10,8 +10,8 @@ class t : s<T_> {}; extern template class t<char>; template class __declspec(dllexport) t<char>; -// CHECK-MS: dllexport {{.*}} @"\01??4?$t@D@@QAEAAV0@ABV0@@Z" -// CHECK-MS: dllexport {{.*}} @"\01??4?$s@D@@QAEAAU0@ABU0@@Z" +// CHECK-MS: dllexport {{.*}} @"??4?$t@D@@QAEAAV0@ABV0@@Z" +// CHECK-MS: dllexport {{.*}} @"??4?$s@D@@QAEAAU0@ABU0@@Z" // CHECK-IA: dllexport {{.*}} @_ZN1tIcEaSERKS0_ // CHECK-IA: dllexport {{.*}} @_ZN1sIcEaSERKS0_ diff --git a/test/CodeGenCXX/windows-itanium-exceptions.cpp b/test/CodeGenCXX/windows-itanium-exceptions.cpp index b2c8707efc068..1bca4e8917170 100644 --- a/test/CodeGenCXX/windows-itanium-exceptions.cpp +++ b/test/CodeGenCXX/windows-itanium-exceptions.cpp @@ -10,7 +10,7 @@ void attempt() { try { except(); } catch (...) { } } -// CHECK: @_ZTIi = external constant i8* +// CHECK: @_ZTIi = external dso_local constant i8* // CHECK: define {{.*}}void @_Z6exceptv() {{.*}} { // CHECK: %exception = call {{.*}}i8* @__cxa_allocate_exception(i32 4) diff --git a/test/CodeGenCXX/windows-itanium-type-info.cpp b/test/CodeGenCXX/windows-itanium-type-info.cpp index 285b59815da26..20bd78df50983 100644 --- a/test/CodeGenCXX/windows-itanium-type-info.cpp +++ b/test/CodeGenCXX/windows-itanium-type-info.cpp @@ -24,17 +24,17 @@ void f() { throw base(); } -// CHECK-DAG: @_ZTIi = dllexport constant -// CHECK-DAG: @_ZTSi = dllexport constant +// CHECK-DAG: @_ZTIi = dso_local dllexport constant +// CHECK-DAG: @_ZTSi = dso_local dllexport constant -// CHECK-DAG: @_ZTI7derived = dllexport constant -// CHECK-DAG: @_ZTS7derived = dllexport constant -// CHECK-DAG: @_ZTV7derived = dllexport unnamed_addr constant +// CHECK-DAG: @_ZTI7derived = dso_local dllexport constant +// CHECK-DAG: @_ZTS7derived = dso_local dllexport constant +// CHECK-DAG: @_ZTV7derived = dso_local dllexport unnamed_addr constant // CHECK-DAG: @_ZTI4base = external dllimport constant -// CHECK-EH-IMPORT: @_ZTS4base = linkonce_odr constant -// CHECK-EH-IMPORT: @_ZTI4base = linkonce_odr constant +// CHECK-EH-IMPORT: @_ZTS4base = linkonce_odr dso_local constant +// CHECK-EH-IMPORT: @_ZTI4base = linkonce_odr dso_local constant struct __declspec(dllimport) gatekeeper {}; struct zuul : gatekeeper { @@ -42,5 +42,5 @@ struct zuul : gatekeeper { }; zuul::~zuul() {} -// CHECK-DAG: @_ZTI10gatekeeper = linkonce_odr constant -// CHECK-DAG: @_ZTS10gatekeeper = linkonce_odr constant +// CHECK-DAG: @_ZTI10gatekeeper = linkonce_odr dso_local constant +// CHECK-DAG: @_ZTS10gatekeeper = linkonce_odr dso_local constant |