diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-10-22 07:15:56 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-10-22 07:15:56 +0000 |
commit | 0f43e2c14827e7d77533d9ccb0bd15f8e9c4dd94 (patch) | |
tree | 98c2af74de5cdbe60c7ce949e00369ffb391fb3d /test/CodeGenCXX/mangle-ms-cxx11.cpp | |
parent | 37bc78dc7ac5d7d9029363d788ea7149db0d70a8 (diff) |
[MS ABI] Mangle static anonymous unions
We believed that internal linkage variables at global scope which are
not variable template specializations did not have to be mangled.
However, static anonymous unions have no identifier and therefore must
be mangled.
This fixes PR18204.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250997 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/mangle-ms-cxx11.cpp')
-rw-r--r-- | test/CodeGenCXX/mangle-ms-cxx11.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/CodeGenCXX/mangle-ms-cxx11.cpp b/test/CodeGenCXX/mangle-ms-cxx11.cpp index 0a4c602df6..999def87fc 100644 --- a/test/CodeGenCXX/mangle-ms-cxx11.cpp +++ b/test/CodeGenCXX/mangle-ms-cxx11.cpp @@ -277,3 +277,12 @@ void g() { // 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" } + +namespace PR18204 { +template <typename T> +int f(T *); +static union { + int n = f(this); +}; +// CHECK-DAG: @"\01??$f@T<unnamed-type-$S1>@PR18204@@@PR18204@@YAHPAT<unnamed-type-$S1>@0@@Z" +} |