[cfe-commits] r78943 - /cfe/trunk/test/CodeGenCXX/copy-assign-synthesis.cpp

Fariborz Jahanian fjahanian at apple.com
Thu Aug 13 14:47:21 PDT 2009


Author: fjahanian
Date: Thu Aug 13 16:47:21 2009
New Revision: 78943

URL: http://llvm.org/viewvc/llvm-project?rev=78943&view=rev
Log:
Adds testing of copy assignment of anonymous union
data members.

Modified:
    cfe/trunk/test/CodeGenCXX/copy-assign-synthesis.cpp

Modified: cfe/trunk/test/CodeGenCXX/copy-assign-synthesis.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/copy-assign-synthesis.cpp?rev=78943&r1=78942&r2=78943&view=diff

==============================================================================
--- cfe/trunk/test/CodeGenCXX/copy-assign-synthesis.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/copy-assign-synthesis.cpp Thu Aug 13 16:47:21 2009
@@ -4,21 +4,30 @@
 extern "C" int printf(...);
 
 struct B {
-  B() : B1(3.14), B2(3.15) {} 
+  B() : B1(3.14), B2(3.15), auB2(3.16)  {} 
   float B1;
   float B2;
   void pr() {
-    printf("B1 = %f B2 = %f\n", B1, B2);
+    printf("B1 = %f B2 = %f auB1 = %f\n", B1, B2, auB1);
   }
+
+  union {
+    float auB1;
+    float auB2;
+  };
 };
 
 struct M {
-  M() : M1(10), M2(11) {} 
+  M() : M1(10), M2(11) , auM1(12) {} 
   int M1;
   int M2;
   void pr() {
-    printf("M1 = %d M2 = %d\n", M1, M2);
+    printf("M1 = %d M2 = %d auM1 = %d auM2 = %d\n", M1, M2, auM1, auM2);
   }
+  union {
+    int auM1;
+    int auM2;
+  };
 };
 
 struct N  : B {





More information about the cfe-commits mailing list