[PATCH] C99 partial re-initialization behavior (DR-253)

Arthur O'Dwyer arthur.j.odwyer+phab+github at gmail.com
Sat Dec 27 21:09:32 PST 2014


Commented on a test. The functional change is way out of my league.
Also consider adding a "three-pass" test case similar to

  struct B { int b1; int c; int b2; };
  struct A { int a1; struct B b; int a2; };
  struct A a = { 1, { 2, 3, 4 }, 5,
               .b = { 6, 7, 8 },
                  .b.c = 9
  };
  struct A expected = { 1, { 6, 9, 8 }, 5 };
  assert(!memcmp(a, expected));


================
Comment at: test/CodeGen/partial-reinitialization1.c:54-61
@@ +53,10 @@
+typedef __WCHAR_TYPE__ wchar_t;                                                  
+#if defined(_WIN32) || defined(_M_IX86) || defined(__CYGWIN__) \                 
+  || defined(_M_X64) || defined(SHORT_WCHAR)                                     
+  #define WCHAR_T_TYPE unsigned short                                            
+#elif defined(__sun) || defined(__AuroraUX__)                                    
+  #define WCHAR_T_TYPE long                                                      
+#else /* Solaris or AuroraUX. */                                                 
+  #define WCHAR_T_TYPE int                                                       
+#endif
+
----------------
You don't need any of these lines, right?
(If you ran this test on triples other than x64, you might want something like this, but it would have to be in lieu of the CHECK on line 67, not just defining an unused macro up here.)

http://reviews.llvm.org/D5789

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list