r221824 - Update the tests to handle proper result type of (?:)
Anton Korobeynikov
asl at math.spbu.ru
Wed Nov 12 14:48:38 PST 2014
Author: asl
Date: Wed Nov 12 16:48:38 2014
New Revision: 221824
URL: http://llvm.org/viewvc/llvm-project?rev=221824&view=rev
Log:
Update the tests to handle proper result type of (?:)
Modified:
cfe/trunk/test/FixIt/format-darwin.m
cfe/trunk/test/SemaObjC/format-strings-objc.m
Modified: cfe/trunk/test/FixIt/format-darwin.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/FixIt/format-darwin.m?rev=221824&r1=221823&r2=221824&view=diff
==============================================================================
--- cfe/trunk/test/FixIt/format-darwin.m (original)
+++ cfe/trunk/test/FixIt/format-darwin.m Wed Nov 12 16:48:38 2014
@@ -83,12 +83,12 @@ void testParens(Foo *obj, struct Bar *re
printf("%s", [obj getInteger]); // expected-warning{{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}}
printf("%s", obj.value); // expected-warning{{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}}
printf("%s", record->value); // expected-warning{{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}}
- printf("%s", (i ? i : i)); // expected-warning{{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}}
+ printf("%s", (i ? i : i)); // expected-warning{{format specifies type 'char *' but the argument has type 'int'}}
printf("%s", *arr); // expected-warning{{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}}
// CHECK-NOT: fix-it:{{.*}}:")"
- printf("%s", i ? i : i); // expected-warning{{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}}
+ printf("%s", i ? i : i); // expected-warning{{format specifies type 'char *' but the argument has type 'int'}}
// CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:11-[[@LINE-2]]:13}:"%ld"
// CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:16-[[@LINE-3]]:16}:"(long)("
Modified: cfe/trunk/test/SemaObjC/format-strings-objc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/format-strings-objc.m?rev=221824&r1=221823&r2=221824&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/format-strings-objc.m (original)
+++ cfe/trunk/test/SemaObjC/format-strings-objc.m Wed Nov 12 16:48:38 2014
@@ -243,7 +243,7 @@ void testByValueObjectInFormat(Foo *obj)
// <rdar://problem/13557053>
void testTypeOf(NSInteger dW, NSInteger dH) {
- NSLog(@"dW %d dH %d",({ __typeof__(dW) __a = (dW); __a < 0 ? -__a : __a; }),({ __typeof__(dH) __a = (dH); __a < 0 ? -__a : __a; })); // expected-warning 2 {{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}}
+ NSLog(@"dW %d dH %d",({ __typeof__(dW) __a = (dW); __a < 0 ? -__a : __a; }),({ __typeof__(dH) __a = (dH); __a < 0 ? -__a : __a; })); // expected-warning 2 {{format specifies type 'int' but the argument has type 'long'}}
}
void testUnicode() {
More information about the cfe-commits
mailing list