summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/mangle-unnamed.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-06-08 14:49:03 +0000
committerAnders Carlsson <andersca@mac.com>2010-06-08 14:49:03 +0000
commit6f7e2f4019860cad19883db44f4d0bfa36d2f552 (patch)
treef34dce4a4b27312225149201bf167a643c0a489e /test/CodeGenCXX/mangle-unnamed.cpp
parent1c573cb0e06bac4e557123703069da7dd45d3dc0 (diff)
Correctly mangle static variables of anonymous struct/union type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105606 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/mangle-unnamed.cpp')
-rw-r--r--test/CodeGenCXX/mangle-unnamed.cpp34
1 files changed, 33 insertions, 1 deletions
diff --git a/test/CodeGenCXX/mangle-unnamed.cpp b/test/CodeGenCXX/mangle-unnamed.cpp
index 4aec7dbf4a..83b46d6945 100644
--- a/test/CodeGenCXX/mangle-unnamed.cpp
+++ b/test/CodeGenCXX/mangle-unnamed.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm-only -verify %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin10 | FileCheck %s
struct S {
virtual ~S() { }
@@ -37,3 +37,35 @@ struct A {
};
int f4() { return A().a(); }
+
+int f5() {
+ static union {
+ int a;
+ };
+
+ // CHECK: _ZZ2f5vE1a
+ return a;
+}
+
+int f6() {
+ static union {
+ union {
+ int : 1;
+ };
+ int b;
+ };
+
+ // CHECK: _ZZ2f6vE1b
+ return b;
+}
+
+int f7() {
+ static union {
+ union {
+ int b;
+ } a;
+ };
+
+ // CHECK: _ZZ2f7vE1a
+ return a.b;
+}