From 5ee51e8154253088b333c8e82c64d0f00d7d0524 Mon Sep 17 00:00:00 2001 From: YingChi Long Date: Thu, 1 Sep 2022 11:25:41 +0800 Subject: [PATCH] [clang] trim trailing space in format tests. NFC Found in https://reviews.llvm.org/D132568 Differential Revision: https://reviews.llvm.org/D133085 --- clang/test/FixIt/format.m | 12 ++++++------ clang/test/FixIt/format.mm | 4 ++-- clang/test/Sema/format-strings-scanf.c | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/clang/test/FixIt/format.m b/clang/test/FixIt/format.m index 966cf79b2e0f..950765bad933 100644 --- a/clang/test/FixIt/format.m +++ b/clang/test/FixIt/format.m @@ -37,7 +37,7 @@ void test_string_correction (char *x) { // CHECK: fix-it:"{{.*}}":{34:11-34:13}:"%s" } -void test_object_correction (id x) { +void test_object_correction (id x) { NSLog(@"%d", x); // expected-warning{{format specifies type 'int' but the argument has type 'id'}} NSLog(@"%s", x); // expected-warning{{format specifies type 'char *' but the argument has type 'id'}} NSLog(@"%lf", x); // expected-warning{{format specifies type 'double' but the argument has type 'id'}} @@ -108,7 +108,7 @@ void test_char(char c, signed char s, unsigned char u, uint8_t n) { NSLog(@"%c", c); // no-warning // CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:13}:"%c" - + NSLog(@"%s", s); // expected-warning{{format specifies type 'char *' but the argument has type 'signed char'}} // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:13}:"%c" @@ -197,11 +197,11 @@ void test_percent_C(void) { // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:16-[[@LINE-2]]:16}:"(unsigned short)" typedef unsigned short unichar; - + NSLog(@"%C", 0x260300); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'int'}} // CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:13}:"%d" // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:16-[[@LINE-2]]:16}:"(unichar)" - + NSLog(@"%C", data ? 0x2F0000 : 0x260300); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'int'}} // CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:13}:"%d" // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:16-[[@LINE-2]]:16}:"(unichar)(" @@ -239,7 +239,7 @@ void testSizeTypes(void) { 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" - + short x; #if !defined(__ANDROID__) && !defined(__Fuchsia__) printf("%zn", &x); // expected-warning-re{{format specifies type 'ssize_t *' (aka '{{.+}}') but the argument has type 'short *'}} @@ -266,7 +266,7 @@ void testPtrDiffTypes(void) { printf("%tu", 0.f); // expected-warning-re{{format specifies type 'unsigned ptrdiff_t' (aka '{{.+}}') but the argument has type 'float'}} // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:14}:"%f" - + ptrdiff_t p2 = 0; printf("%td", p2); // No warning. diff --git a/clang/test/FixIt/format.mm b/clang/test/FixIt/format.mm index 9d89c062faa9..eed7c981f2c4 100644 --- a/clang/test/FixIt/format.mm +++ b/clang/test/FixIt/format.mm @@ -19,11 +19,11 @@ void test_percent_C() { NSLog(@"%C", wchar_data); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'wchar_t'}} // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:16-[[@LINE-1]]:16}:"(unichar)" - + NSLog(@"%C", 0x260300); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'int'}} // CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:13}:"%d" // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:16-[[@LINE-2]]:16}:"(unichar)" - + NSLog(@"%C", 0.0); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'double'}} // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:13}:"%f" // CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-2]]:16-[[@LINE-2]]:16}:"(unichar)" diff --git a/clang/test/Sema/format-strings-scanf.c b/clang/test/Sema/format-strings-scanf.c index 054439ecaf5a..aebb68c37fb9 100644 --- a/clang/test/Sema/format-strings-scanf.c +++ b/clang/test/Sema/format-strings-scanf.c @@ -12,7 +12,7 @@ typedef __SIZE_TYPE__ size_t; unsigned int : (int)0, \ unsigned short : (short)0, \ unsigned char : (signed char)0)) -typedef __SSIZE_TYPE__ ssize_t; +typedef __SSIZE_TYPE__ ssize_t; typedef __PTRDIFF_TYPE__ ptrdiff_t; #define __UNSIGNED_PTRDIFF_TYPE__ \ @@ -224,13 +224,13 @@ void test_ptrdiff_t_types(void) { ptrdiff_t p2 = 0; scanf("%td", &p2); // No warning. - + double d2 = 0.; scanf("%td", &d2); // expected-warning-re{{format specifies type 'ptrdiff_t *' (aka '{{.+}}') but the argument has type 'double *'}} ptrdiff_t p3 = 0; scanf("%tn", &p3); // No warning. - + double d3 = 0.; scanf("%tn", &d3); // expected-warning-re{{format specifies type 'ptrdiff_t *' (aka '{{.+}}') but the argument has type 'double *'}} }