summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/copy-constructor-synthesis.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-08-11 18:49:54 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-08-11 18:49:54 +0000
commitb2197042b8bbed9287957d4c21dbe8f53deb6007 (patch)
tree726798c8e88e730689893b5a735fabc6a32e6399 /clang/test/CodeGenCXX/copy-constructor-synthesis.cpp
parentd362857f4c93e35d1729d9c31e73dbc9ab500096 (diff)
downloadbcm5719-llvm-b2197042b8bbed9287957d4c21dbe8f53deb6007.tar.gz
bcm5719-llvm-b2197042b8bbed9287957d4c21dbe8f53deb6007.zip
ir-gen support for anonymous union data member
copying in copy constructors and used in default constructor's initializer list. llvm-svn: 78700
Diffstat (limited to 'clang/test/CodeGenCXX/copy-constructor-synthesis.cpp')
-rw-r--r--clang/test/CodeGenCXX/copy-constructor-synthesis.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/copy-constructor-synthesis.cpp b/clang/test/CodeGenCXX/copy-constructor-synthesis.cpp
index 851a4ea60a5..121fd41b5cc 100644
--- a/clang/test/CodeGenCXX/copy-constructor-synthesis.cpp
+++ b/clang/test/CodeGenCXX/copy-constructor-synthesis.cpp
@@ -26,12 +26,15 @@ struct P {
struct X : M, N, P { // ...
- X() : f1(1.0), d1(2.0), i1(3), name("HELLO"), bf1(0xff), bf2(0xabcd) {}
+ X() : f1(1.0), d1(2.0), i1(3), name("HELLO"), bf1(0xff), bf2(0xabcd),
+ au_i1(1234), au1_4("MASKED") {}
P p0;
void pr() { printf("iM = %d iN = %d, m1.iM = %d\n", iM, iN, m1.iM);
printf("im = %d p0.iP = %d, p1.iP = %d\n", iP, p0.iP, p1.iP);
printf("f1 = %f d1 = %f i1 = %d name(%s) \n", f1, d1, i1, name);
printf("bf1 = %x bf2 = %x\n", bf1, bf2);
+ printf("au_i2 = %d\n", au_i2);
+ printf("au1_1 = %s\n", au1_1);
}
M m1;
P p1;
@@ -41,6 +44,17 @@ struct X : M, N, P { // ...
const char *name;
unsigned bf1 : 8;
unsigned bf2 : 16;
+
+ union {
+ int au_i1;
+ int au_i2;
+ };
+ union {
+ const char * au1_1;
+ float au1_2;
+ int au1_3;
+ const char * au1_4;
+ };
};
int main()
OpenPOWER on IntegriCloud