]> granicus.if.org Git - clang/commitdiff
[clang] Fix format test
authorAlexander Shaposhnikov <shal1t712@gmail.com>
Sat, 15 Jul 2017 01:06:59 +0000 (01:06 +0000)
committerAlexander Shaposhnikov <shal1t712@gmail.com>
Sat, 15 Jul 2017 01:06:59 +0000 (01:06 +0000)
This diff makes the test FixIt/format.m more robust.
The issue was caught by the build bot clang-cmake-thumbv7-a15.

Test plan: make check-all

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308073 91177308-0d34-0410-b5e6-96231b3b80d8

test/FixIt/format.m

index f676c24cac9df01d30cbb2f9cb93bc0930a3f191..5806f22c0a72d97bd923bcc2fcc04171899f2f93 100644 (file)
@@ -230,14 +230,14 @@ void testSignedness(long i, unsigned long u) {
 }
 
 void testSizeTypes() {
-  printf("%zu", 0.f); // expected-warning{{format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'float'}}
+  printf("%zu", 0.f); // expected-warning-re{{format specifies type 'size_t' (aka '{{.+}}') but the argument has type 'float'}}
   // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:14}:"%f"
 
-  printf("%zd", 0.f); // expected-warning{{format specifies type 'ssize_t' (aka 'long') but the argument has type 'float'}}
+  printf("%zd", 0.f); // expected-warning-re{{format specifies type 'ssize_t' (aka '{{.+}}') but the argument has type 'float'}}
   // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:14}:"%f"
   
   int x;
-  printf("%zn", &x); // expected-warning{{format specifies type 'ssize_t *' (aka 'long *') but the argument has type 'int *'}}
+  printf("%zn", &x); // expected-warning-re{{format specifies type 'ssize_t *' (aka '{{.+}}') but the argument has type 'int *'}}
   // PrintfSpecifier::fixType doesn't handle %n, so a fix-it is not emitted, 
   // see the comment in PrintfSpecifier::fixType in PrintfFormatString.cpp.
 }