<div>Or maybe something that combines the two test scheme with my original change:</div>
<div> </div>
<div>// RUN: clang-cc %s -fsyntax-only -verify &&<br>// RUN: clang-cc %s -fsyntax-only -fshort-wchar -verify -DSHORT_WCHAR"<br> <br>#include <wchar.h></div>
<div> </div>
<div>#if defined(_WIN32) || defined(_M_IX86) || defined(__CYGWIN__) \\<br> || defined(_M_X64) || defined(SHORT_WCHAR)<br>  #define WCHAR_T_TYPE unsigned short<br>#else<br>  #define WCHAR_T_TYPE int<br>#endif</div>
<div> </div>
<div>int check_wchar_size[sizeof(*L"") == sizeof(wchar_t) ? 1 : -1];</div>
<div> </div>
<div>void foo() {<br>  WCHAR_T_TYPE t1[] = L"x";<br>  wchar_t tab[] = L"x";</div>
<div>  WCHAR_T_TYPE t2[] = "x";     // expected-error {{initialization}}<br>  char t3[] = L"x";   // expected-error {{initialization}}<br>}<br></div>
<div>You don't get the complete platform-independence, but it avoids the include problems with specifying a triple, and still tests -fshort-wchar, but only on non-windows platforms.<br></div>
<div>-John<br></div>
<div class="gmail_quote">On Wed, Nov 4, 2009 at 3:20 PM, John Thompson <span dir="ltr"><<a href="mailto:john.thompson.jtsoftware@gmail.com">john.thompson.jtsoftware@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>Doug,</div>
<div class="im">
<div> </div>
<div>>RUN: clang-cc %s -fsyntax-only -triple i686-pc-linux-gnu -verify -DWCHAR_T_TYPE="int" &&<br></div></div>
<div>Sorry, I totally missed noticing that last comment.  There's a catch with this however.  By using "-triple i686-pc-linux-gnu", it causes the default include paths to be those for Linux.</div>
<div> </div>
<div>I can work around this by setting up a \usr\include directory on my PC and copying the Linux headers over, but would this be okay, since it would require any Windows-hosted developer running the test to do the same?</div>

<div> </div>
<div>This also would cause a couple of other minor problems in the tests, as 6 tests then start failing on Windows.  I think the presence of another stdint.h in the system confuses Clang's stdint.h scheme, causing the Linux stdint to be included.  This can be worked around by putting -fms-extensions=0 in these tests, except that for one test this causes a problem because it also including limits.h, which includes crtdef.h which has at least one Window-isn __int64.</div>

<div> </div>
<div>I've included these work-arounds in the patch, in case you want to go this route.  Otherwise I'll need some help in knowing what to do.</div>
<div> </div>
<div>-John</div>
<div> </div><font color="#888888">
<div> </div>
<div> </div>
<div>-John<br><br></div></font>
<div>
<div></div>
<div class="h5">
<div class="gmail_quote">On Wed, Nov 4, 2009 at 2:06 PM, Douglas Gregor <span dir="ltr"><<a href="mailto:dgregor@apple.com" target="_blank">dgregor@apple.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div style="WORD-WRAP: break-word"><br>
<div>
<div>
<div>On Nov 4, 2009, at 1:53 PM, John Thompson wrote:</div><br>
<blockquote type="cite">
<div>Here's another go at it, adding stuff for PCH and the driver.  I put in a partial test of the driver change in test/Driver/clang_f_opts.c, which I hope is an appropriate place.</div></blockquote>
<div><br></div></div>Looks good, but could you address this comment</div>
<div>
<div><br>
<blockquote type="cite">
<div class="gmail_quote">
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<blockquote style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote"><br><br>
<div>The change to the wchar.c test allows it to pass on Windows (and still pass on Linux, which defaults to int for wchar_t).<br></div></blockquote><br>
<div>
<div></div>
<div>I'd like to retain the test that we use "int" for the other targets. Could you do something like<br><br> RUN: clang-cc %s -fsyntax-only -triple i686-pc-linux-gnu -verify -DWCHAR_T_TYPE="int" &&<br>
 RUN: clang-cc %s -fsyntax-only -fshort-wchar -verify -DWCHAR_T_TYPE="unsigned short"<br><br>then use WCHAR_T_TYPE as the element type of the t1 and t2 arrays?<br><br>       - Doug<br></div></div></blockquote></div>
</blockquote></div><br></div>
<div>before committing?</div>
<div><br></div>
<div><span style="WHITE-SPACE: pre"></span>- Doug</div></div></blockquote></div><br><br clear="all"><br></div></div>
<div>
<div></div>
<div class="h5">-- <br>John Thompson<br><a href="mailto:John.Thompson.JTSoftware@gmail.com" target="_blank">John.Thompson.JTSoftware@gmail.com</a><br><br></div></div></blockquote></div><br><br clear="all"><br>-- <br>John Thompson<br>
<a href="mailto:John.Thompson.JTSoftware@gmail.com">John.Thompson.JTSoftware@gmail.com</a><br><br>