r204349 - Remove wchar_t* buffer from scanf format fix-it test.

Jordan Rose jordan_rose at apple.com
Thu Mar 20 08:54:16 PDT 2014


Author: jrose
Date: Thu Mar 20 10:54:16 2014
New Revision: 204349

URL: http://llvm.org/viewvc/llvm-project?rev=204349&view=rev
Log:
Remove wchar_t* buffer from scanf format fix-it test.

Amends r204300 to not try to test fixing a wchar_t* to "%ls", which we don't
do correctly anyway. In C mode, wchar_t is just a typedef for a normal
primitive integer type, not a distinct type like it is in C++. To make this
work correctly, we'll need to look for the wchar_t typedef, not just the
builtin type.

Should fix the buildbots.

Modified:
    cfe/trunk/test/Sema/format-strings-fixit.c

Modified: cfe/trunk/test/Sema/format-strings-fixit.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/format-strings-fixit.c?rev=204349&r1=204348&r2=204349&view=diff
==============================================================================
--- cfe/trunk/test/Sema/format-strings-fixit.c (original)
+++ cfe/trunk/test/Sema/format-strings-fixit.c Thu Mar 20 10:54:16 2014
@@ -101,7 +101,6 @@ int scanf(char const *, ...);
 void test2(int intSAParm[static 2]) {
   char str[100];
   char *vstr = "abc";
-  wchar_t wstr[100];
   short shortVar;
   unsigned short uShortVar;
   int intVar;
@@ -124,8 +123,6 @@ void test2(int intSAParm[static 2]) {
   scanf("%lf", str);
   scanf("%lf", vstr);
   scanf("%ls", str);
-  scanf("%f", wstr); // FIXME: wchar_t should resolve to %ls, not %d.
-  scanf("%s", wstr); // FIXME: wchar_t should resolve to %ls, not %d.
   scanf("%ls", str);
 
   // Some integer types.
@@ -225,8 +222,6 @@ void test2(int intSAParm[static 2]) {
 // CHECK: scanf("%99s", str);
 // CHECK: scanf("%s", vstr);
 // CHECK: scanf("%99s", str);
-// CHECK: scanf("{{%d|%hu}}", wstr);
-// CHECK: scanf("{{%d|%hu}}", wstr);
 // CHECK: scanf("%99s", str);
 // CHECK: scanf("%hd", &shortVar);
 // CHECK: scanf("%hu", &uShortVar);





More information about the cfe-commits mailing list