teak-llvm/clang/test/CodeGenCXX/mangle-ms-cxx17.cpp
Nico Weber a47dc841cd Implement Microsoft-compatible mangling for decomposition declarations.
Match cl.exe's mangling for decomposition declarations.

Decomposition declarations are considered to be anonymous structs,
and use the same convention as for anonymous struct/union declarations.

Naming confirmed to match https://godbolt.org/z/K2osJa

Patch from Eric Astor <epastor@google.com>!

Differential Revision: https://reviews.llvm.org/D67202

llvm-svn: 371124
2019-09-05 21:08:50 +00:00

22 lines
673 B
C++

// RUN: %clang_cc1 -std=c++1z -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=19.10 | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK --check-prefix=MSVC2017
// RUN: %clang_cc1 -std=c++1z -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
struct S {
int x;
double y;
};
S f();
// CHECK-DAG: "?$S1@@3US@@B"
const auto [x0, y0] = f();
// CHECK-DAG: "?$S2@@3US@@B"
const auto [x1, y1] = f();
static union {
int a;
double b;
};
// CHECK-DAG: "?$S4@@3US@@B"
const auto [x2, y2] = f();