2018-02-07 09:55:08 +08:00
|
|
|
// RUN: %clang_cc1 -triple i686-unknown-windows-msvc -fdeclspec -emit-llvm %s -o - | FileCheck %s
|
2018-04-03 06:25:50 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -fdeclspec -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-64
|
2018-02-07 09:55:08 +08:00
|
|
|
|
|
|
|
void __attribute__((__swiftcall__)) f() {}
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK-DAG: @"?f@@YSXXZ"
|
2018-04-03 06:25:50 +08:00
|
|
|
// CHECK-64-DAG: @"?f@@YSXXZ"
|
2018-02-07 09:55:08 +08:00
|
|
|
|
|
|
|
void (__attribute__((__swiftcall__)) *p)();
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK-DAG: @"?p@@3P6SXXZA"
|
2018-04-03 06:25:50 +08:00
|
|
|
// CHECK-64-DAG: @"?p@@3P6SXXZEA
|
2018-02-07 09:55:08 +08:00
|
|
|
|
|
|
|
namespace {
|
|
|
|
void __attribute__((__swiftcall__)) __attribute__((__used__)) f() { }
|
|
|
|
}
|
[MS] Mangle a hash of the main file path into anonymous namespaces
Summary:
This is needed to avoid conflicts in mangled names for codeview types in
anonymous namespaces. In CodeView, types refer to each other typically
through forward declarations, which contain mangled names. These names
have to be unique, otherwise the debugger will look up the mangled name
and find the wrong definition.
Furthermore, ThinLTO will deduplicate the types, and debug info
verification can fail when the types have the wrong sizes. This is
PR38608.
Fixes PR38609.
Reviewers: majnemer, inglorion, hans
Subscribers: mehdi_amini, aprantl, JDevlieghere, dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D50877
llvm-svn: 340079
2018-08-18 04:59:27 +08:00
|
|
|
// CHECK-DAG: @"?f@?A0x{{[^@]*}}@@YSXXZ"
|
|
|
|
// CHECK-64-DAG: @"?f@?A0x{{[^@]*}}@@YSXXZ"
|
2018-02-07 09:55:08 +08:00
|
|
|
|
|
|
|
namespace n {
|
|
|
|
void __attribute__((__swiftcall__)) f() {}
|
|
|
|
}
|
2018-04-03 06:25:50 +08:00
|
|
|
// CHECK-DAG: @"?f@n@@YSXXZ"
|
|
|
|
// CHECK-64-DAG: @"?f@n@@YSXXZ"
|
2018-02-07 09:55:08 +08:00
|
|
|
|
|
|
|
struct __declspec(dllexport) S {
|
|
|
|
S(const S &) = delete;
|
|
|
|
S & operator=(const S &) = delete;
|
|
|
|
void __attribute__((__swiftcall__)) m() { }
|
|
|
|
};
|
2018-04-03 06:25:50 +08:00
|
|
|
// CHECK-DAG: @"?m@S@@QASXXZ"
|
|
|
|
// CHECK-64-DAG: @"?m@S@@QEASXXZ"
|
2018-02-07 09:55:08 +08:00
|
|
|
|
|
|
|
void f(void (__attribute__((__swiftcall__))())) {}
|
2018-04-03 06:25:50 +08:00
|
|
|
// 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() {}
|
|
|
|
}
|
[MS] Mangle a hash of the main file path into anonymous namespaces
Summary:
This is needed to avoid conflicts in mangled names for codeview types in
anonymous namespaces. In CodeView, types refer to each other typically
through forward declarations, which contain mangled names. These names
have to be unique, otherwise the debugger will look up the mangled name
and find the wrong definition.
Furthermore, ThinLTO will deduplicate the types, and debug info
verification can fail when the types have the wrong sizes. This is
PR38608.
Fixes PR38609.
Reviewers: majnemer, inglorion, hans
Subscribers: mehdi_amini, aprantl, JDevlieghere, dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D50877
llvm-svn: 340079
2018-08-18 04:59:27 +08:00
|
|
|
// CHECK-DAG: @"?g@?A0x{{[^@]*}}@@YUXXZ"
|
|
|
|
// CHECK-64-DAG: @"?g@?A0x{{[^@]*}}@@YUXXZ"
|
2018-04-03 06:25:50 +08:00
|
|
|
|
|
|
|
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"
|
2018-02-07 09:55:08 +08:00
|
|
|
|