Thanks! Implemented in r<span style="line-height:19.799999237060547px">204587.</span><br><br><div>On Sun Mar 23 2014 at 11:48:45 AM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Mar 23, 2014 at 11:22 AM, David Majnemer <span dir="ltr"><<a href="mailto:david.majnemer@gmail.com" target="_blank">david.majnemer@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: majnemer<br>
Date: Sun Mar 23 13:22:10 2014<br>
New Revision: 204566<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=204566&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=204566&view=rev</a><br>
Log:<br>
CodeGen: Make string tests exercise the MS ABI<br>
<br>
r204562 unwittingly failed tests for some bots.  Make those tests work<br>
with both the Itanium and MS ABIs.<br>
<br>
Modified:<br>
    cfe/trunk/test/CodeGen/c-strings.c<br>
    cfe/trunk/test/CodeGen/string-literal-short-wstring.c<br>
<br>
Modified: cfe/trunk/test/CodeGen/c-strings.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/c-strings.c?rev=204566&r1=204565&r2=204566&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/c-strings.c?rev=204566&r1=204565&r2=204566&view=diff</a><br>


==============================================================================<br>
--- cfe/trunk/test/CodeGen/c-strings.c (original)<br>
+++ cfe/trunk/test/CodeGen/c-strings.c Sun Mar 23 13:22:10 2014<br>
@@ -1,15 +1,23 @@<br>
-// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s<br>
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s<br>
+// RUN: %clang_cc1 -triple %ms_abi_triple -emit-llvm -o - %s | FileCheck %s --check-prefix=WIN32<br>
<br>
 // Should be 3 hello strings, two global (of different sizes), the rest are<br>
 // shared.<br>
<br>
 // CHECK: @align = global i8 [[ALIGN:[0-9]+]]<br>
+// WIN32: @align = global i8 [[ALIGN:[0-9]+]]<br></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>You don't need to duplicate the common checks for both runs of this test. You can give FileCheck multiple --check-prefixes: for instance, give the first one --check-prefix=CHECK --check-prefix=ITANIUM and the second --check-prefix=CHECK --check-prefix=WIN32, and use CHECK: for the things that should match in both runs.</div>
</div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 // CHECK: @.str = private unnamed_addr constant [6 x i8] c"hello\00"<br>
+// WIN32: @"\01??_C@_05CJBACGMB@hello?$AA@" = linkonce_odr unnamed_addr constant [6 x i8] c"hello\00", align 1<br>
 // CHECK: @f1.x = internal global i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0)<br>
+// WIN32: @f1.x = internal global i8* getelementptr inbounds ([6 x i8]* @"\01??_C@_05CJBACGMB@hello?$AA@", i32 0, i32 0)<br>
 // CHECK: @f2.x = internal global [6 x i8] c"hello\00", align [[ALIGN]]<br>
+// WIN32: @f2.x = internal global [6 x i8] c"hello\00", align [[ALIGN]]<br>
 // CHECK: @f3.x = internal global [8 x i8] c"hello\00\00\00", align [[ALIGN]]<br>
+// WIN32: @f3.x = internal global [8 x i8] c"hello\00\00\00", align [[ALIGN]]<br>
 // CHECK: @f4.x = internal global %struct.s { i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0) }<br>
+// WIN32: @f4.x = internal global %struct.s { i8* getelementptr inbounds ([6 x i8]* @"\01??_C@_05CJBACGMB@hello?$AA@", i32 0, i32 0) }<br>
 // CHECK: @x = global [3 x i8] c"ola", align [[ALIGN]]<br>
+// WIN32: @x = global [3 x i8] c"ola", align [[ALIGN]]<br>
<br>
 #if defined(__s390x__)<br>
 unsigned char align = 2;<br>
@@ -20,42 +28,53 @@ unsigned char align = 1;<br>
 void bar(const char *);<br>
<br>
 // CHECK-LABEL: define void @f0()<br>
+// WIN32-LABEL: define void @f0()<br>
 void f0() {<br>
   bar("hello");<br>
   // CHECK: call void @bar({{.*}} @.str<br>
+  // WIN32: call void @bar({{.*}} @"\01??_C@_05CJBACGMB@hello?$AA@"<br>
 }<br>
<br>
 // CHECK-LABEL: define void @f1()<br>
+// WIN32-LABEL: define void @f1()<br>
 void f1() {<br>
   static char *x = "hello";<br>
   bar(x);<br>
   // CHECK: [[T1:%.*]] = load i8** @f1.x<br>
   // CHECK: call void @bar(i8* [[T1:%.*]])<br>
+  // WIN32: [[T1:%.*]] = load i8** @f1.x<br>
+  // WIN32: call void @bar(i8* [[T1:%.*]])<br>
 }<br>
<br>
 // CHECK-LABEL: define void @f2()<br>
+// WIN32-LABEL: define void @f2()<br>
 void f2() {<br>
   static char x[] = "hello";<br>
   bar(x);<br>
   // CHECK: call void @bar({{.*}} @f2.x<br>
+  // WIN32: call void @bar({{.*}} @f2.x<br>
 }<br>
<br>
 // CHECK-LABEL: define void @f3()<br>
+// WIN32-LABEL: define void @f3()<br>
 void f3() {<br>
   static char x[8] = "hello";<br>
   bar(x);<br>
   // CHECK: call void @bar({{.*}} @f3.x<br>
+  // WIN32: call void @bar({{.*}} @f3.x<br>
 }<br>
<br>
 void gaz(void *);<br>
<br>
 // CHECK-LABEL: define void @f4()<br>
+// WIN32-LABEL: define void @f4()<br>
 void f4() {<br>
   static struct s {<br>
     char *name;<br>
   } x = { "hello" };<br>
   gaz(&x);<br>
   // CHECK: call void @gaz({{.*}} @f4.x<br>
+  // WIN32: call void @gaz({{.*}} @f4.x<br>
 }<br>
<br>
 char x[3] = "ola";<br>
<br>
Modified: cfe/trunk/test/CodeGen/string-literal-short-wstring.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/string-literal-short-wstring.c?rev=204566&r1=204565&r2=204566&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/string-literal-short-wstring.c?rev=204566&r1=204565&r2=204566&view=diff</a><br>


==============================================================================<br>
--- cfe/trunk/test/CodeGen/string-literal-short-wstring.c (original)<br>
+++ cfe/trunk/test/CodeGen/string-literal-short-wstring.c Sun Mar 23 13:22:10 2014<br>
@@ -1,32 +1,40 @@<br>
-// RUN: %clang_cc1 -x c++ -emit-llvm -fshort-wchar %s -o - | FileCheck %s<br>
+// RUN: %clang_cc1 -x c++ -triple %itanium_abi_triple -emit-llvm -fshort-wchar %s -o - | FileCheck %s<br>
+// RUN: %clang_cc1 -x c++ -triple %ms_abi_triple -emit-llvm -fshort-wchar %s -o - | FileCheck %s --check-prefix=WIN32<br>
 // Runs in c++ mode so that wchar_t is available.<br>
<br>
 int main() {<br>
   // This should convert to utf8.<br>
   // CHECK: private unnamed_addr constant [10 x i8] c"\E1\84\A0\C8\A0\F4\82\80\B0\00", align 1<br>
+  // WIN32: private unnamed_addr constant [10 x i8] c"\E1\84\A0\C8\A0\F4\82\80\B0\00", align 1<br>
   char b[10] = "\u1120\u0220\U00102030";<br>
<br>
   // CHECK: private unnamed_addr constant [3 x i16] [i16 65, i16 66, i16 0]<br>
+  // WIN32: linkonce_odr unnamed_addr constant [3 x i16] [i16 65, i16 66, i16 0]<br>
   const wchar_t *foo = L"AB";<br>
<br>
   // This should convert to utf16.<br>
   // CHECK: private unnamed_addr constant [5 x i16] [i16 4384, i16 544, i16 -9272, i16 -9168, i16 0]<br>
+  // WIN32: linkonce_odr unnamed_addr constant [5 x i16] [i16 4384, i16 544, i16 -9272, i16 -9168, i16 0]<br>
   const wchar_t *bar = L"\u1120\u0220\U00102030";<br>
<br>
<br>
<br>
   // Should pick second character.<br>
   // CHECK: store i8 98<br>
+  // WIN32: store i8 98<br>
   char c = 'ab';<br>
<br>
   // CHECK: store i16 97<br>
+  // WIN32: store i16 97<br>
   wchar_t wa = L'a';<br>
<br>
   // Should pick second character.<br>
   // CHECK: store i16 98<br>
+  // WIN32: store i16 98<br>
   wchar_t wb = L'ab';<br>
<br>
   // -4085 == 0xf00b<br>
   // CHECK: store i16 -4085<br>
+  // WIN32: store i16 -4085<br>
   wchar_t wc = L'\uF00B';<br>
 }<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div></div></div></blockquote>