diff options
author | Timm Bäder <tbaeder@redhat.com> | 2023-05-17 14:04:30 +0200 |
---|---|---|
committer | Timm Bäder <tbaeder@redhat.com> | 2023-05-31 07:26:03 +0200 |
commit | f63155aaa6467bd2610820dfd1996af3bb6029a7 (patch) | |
tree | 50c6d9754202cccdb7cf865a981ee8a5befbc1b1 /clang-tools-extra/test | |
parent | e517c5a897c3332ce12b584ff5e522395a0e0469 (diff) | |
download | llvm-f63155aaa6467bd2610820dfd1996af3bb6029a7.zip llvm-f63155aaa6467bd2610820dfd1996af3bb6029a7.tar.gz llvm-f63155aaa6467bd2610820dfd1996af3bb6029a7.tar.bz2 |
[clang] Show line numbers in diagnostic code snippets
Show line numbers to the left of diagnostic code snippets and increase
the numbers of lines shown from 1 to 16.
Differential Revision: https://reviews.llvm.org/D147875
Diffstat (limited to 'clang-tools-extra/test')
8 files changed, 59 insertions, 59 deletions
diff --git a/clang-tools-extra/test/clang-tidy/checkers/cert/uppercase-literal-suffix-integer.cpp b/clang-tools-extra/test/clang-tidy/checkers/cert/uppercase-literal-suffix-integer.cpp index 0dc06df..6fa700b 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/cert/uppercase-literal-suffix-integer.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/cert/uppercase-literal-suffix-integer.cpp @@ -31,7 +31,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: integer literal has suffix 'l', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v5 = 1l; // CHECK-MESSAGES-NEXT: ^~ - // CHECK-MESSAGES-NEXT: {{^ *}}L{{$}} + // CHECK-MESSAGES-NEXT: {{^ *| *}}L{{$}} // CHECK-FIXES: static constexpr auto v5 = 1L; static_assert(is_same<decltype(v5), const long>::value, ""); static_assert(v5 == 1, ""); @@ -46,7 +46,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: integer literal has suffix 'll', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v7 = 1ll; // CHECK-MESSAGES-NEXT: ^~~ - // CHECK-MESSAGES-NEXT: {{^ *}}LL{{$}} + // CHECK-MESSAGES-NEXT: {{^ *| *}}LL{{$}} // CHECK-FIXES: static constexpr auto v7 = 1LL; static_assert(is_same<decltype(v7), const long long>::value, ""); static_assert(v7 == 1, ""); @@ -79,7 +79,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'lu', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v13 = 1lu; // CHECK-MESSAGES-NEXT: ^~~ - // CHECK-MESSAGES-NEXT: {{^ *}}LU{{$}} + // CHECK-MESSAGES-NEXT: {{^ *| *}}LU{{$}} // CHECK-FIXES: static constexpr auto v13 = 1LU; static_assert(is_same<decltype(v13), const unsigned long>::value, ""); static_assert(v13 == 1, ""); @@ -88,7 +88,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'Lu', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v14 = 1Lu; // CHECK-MESSAGES-NEXT: ^~~ - // CHECK-MESSAGES-NEXT: {{^ *}}LU{{$}} + // CHECK-MESSAGES-NEXT: {{^ *| *}}LU{{$}} // CHECK-FIXES: static constexpr auto v14 = 1LU; static_assert(is_same<decltype(v14), const unsigned long>::value, ""); static_assert(v14 == 1, ""); @@ -97,7 +97,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'lU', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v15 = 1lU; // CHECK-MESSAGES-NEXT: ^~~ - // CHECK-MESSAGES-NEXT: {{^ *}}LU{{$}} + // CHECK-MESSAGES-NEXT: {{^ *| *}}LU{{$}} // CHECK-FIXES: static constexpr auto v15 = 1LU; static_assert(is_same<decltype(v15), const unsigned long>::value, ""); static_assert(v15 == 1, ""); @@ -130,7 +130,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'llu', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v21 = 1llu; // CHECK-MESSAGES-NEXT: ^~~~ - // CHECK-MESSAGES-NEXT: {{^ *}}LLU{{$}} + // CHECK-MESSAGES-NEXT: {{^ *| *}}LLU{{$}} // CHECK-FIXES: static constexpr auto v21 = 1LLU; static_assert(is_same<decltype(v21), const unsigned long long>::value, ""); static_assert(v21 == 1, ""); @@ -139,7 +139,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'LLu', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v22 = 1LLu; // CHECK-MESSAGES-NEXT: ^~~~ - // CHECK-MESSAGES-NEXT: {{^ *}}LLU{{$}} + // CHECK-MESSAGES-NEXT: {{^ *| *}}LLU{{$}} // CHECK-FIXES: static constexpr auto v22 = 1LLU; static_assert(is_same<decltype(v22), const unsigned long long>::value, ""); static_assert(v22 == 1, ""); @@ -148,7 +148,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'llU', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v23 = 1llU; // CHECK-MESSAGES-NEXT: ^~~~ - // CHECK-MESSAGES-NEXT: {{^ *}}LLU{{$}} + // CHECK-MESSAGES-NEXT: {{^ *| *}}LLU{{$}} // CHECK-FIXES: static constexpr auto v23 = 1LLU; static_assert(is_same<decltype(v23), const unsigned long long>::value, ""); static_assert(v23 == 1, ""); diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-float16.cpp b/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-float16.cpp index a790597..46d7bc1 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-float16.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-float16.cpp @@ -9,7 +9,7 @@ void float16_normal_literals() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: floating point literal has suffix 'f16', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v14 = 1.f16; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}F16{{$}} + // CHECK-MESSAGES-NEXT: F16{{$}} // CHECK-FIXES: static constexpr auto v14 = 1.F16; static_assert(is_same<decltype(v14), const _Float16>::value, ""); static_assert(v14 == 1.F16, ""); @@ -18,7 +18,7 @@ void float16_normal_literals() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: floating point literal has suffix 'f16', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v15 = 1.e0f16; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}F16{{$}} + // CHECK-MESSAGES-NEXT: F16{{$}} // CHECK-FIXES: static constexpr auto v15 = 1.e0F16; static_assert(is_same<decltype(v15), const _Float16>::value, ""); static_assert(v15 == 1.F16, ""); @@ -39,7 +39,7 @@ void float16_hexadecimal_literals() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: floating point literal has suffix 'f16', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v13 = 0xfp0f16; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}F16{{$}} + // CHECK-MESSAGES-NEXT: F16{{$}} // CHECK-FIXES: static constexpr auto v13 = 0xfp0F16; static_assert(is_same<decltype(v13), const _Float16>::value, ""); static_assert(v13 == 0xfp0F16, ""); diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-floating-point-opencl-half.cpp b/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-floating-point-opencl-half.cpp index 8cea2a4..ef905da 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-floating-point-opencl-half.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-floating-point-opencl-half.cpp @@ -14,14 +14,14 @@ void floating_point_half_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: floating point literal has suffix 'h', which is not uppercase // CHECK-MESSAGES-NEXT: static half v2 = 1.h; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}H{{$}} + // CHECK-MESSAGES-NEXT: H{{$}} // CHECK-HIXES: static half v2 = 1.H; static half v3 = 1.e0h; // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: floating point literal has suffix 'h', which is not uppercase // CHECK-MESSAGES-NEXT: static half v3 = 1.e0h; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}H{{$}} + // CHECK-MESSAGES-NEXT: H{{$}} // CHECK-HIXES: static half v3 = 1.e0H; static half v4 = 1.H; // OK. diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-floating-point.cpp b/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-floating-point.cpp index a0dcc38..d9f5bfb 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-floating-point.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-floating-point.cpp @@ -20,7 +20,7 @@ void floating_point_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: floating point literal has suffix 'f', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v2 = 1.f; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}F{{$}} + // CHECK-MESSAGES-NEXT: F{{$}} // CHECK-FIXES: static constexpr auto v2 = 1.F; static_assert(is_same<decltype(v2), const float>::value, ""); static_assert(v2 == 1.0F, ""); @@ -29,7 +29,7 @@ void floating_point_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: floating point literal has suffix 'f', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v3 = 1.e0f; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}F{{$}} + // CHECK-MESSAGES-NEXT: F{{$}} // CHECK-FIXES: static constexpr auto v3 = 1.e0F; static_assert(is_same<decltype(v3), const float>::value, ""); static_assert(v3 == 1.0F, ""); @@ -48,7 +48,7 @@ void floating_point_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: floating point literal has suffix 'l', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v6 = 1.l; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}L{{$}} + // CHECK-MESSAGES-NEXT: L{{$}} // CHECK-FIXES: static constexpr auto v6 = 1.L; static_assert(is_same<decltype(v6), const long double>::value, ""); static_assert(v6 == 1., ""); @@ -57,7 +57,7 @@ void floating_point_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: floating point literal has suffix 'l', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v7 = 1.e0l; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}L{{$}} + // CHECK-MESSAGES-NEXT: L{{$}} // CHECK-FIXES: static constexpr auto v7 = 1.e0L; static_assert(is_same<decltype(v7), const long double>::value, ""); static_assert(v7 == 1., ""); @@ -76,7 +76,7 @@ void floating_point_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: floating point literal has suffix 'q', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v10 = 1.q; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}Q{{$}} + // CHECK-MESSAGES-NEXT: Q{{$}} // CHECK-FIXES: static constexpr auto v10 = 1.Q; static_assert(is_same<decltype(v10), const __float128>::value, ""); static_assert(v10 == 1., ""); @@ -85,7 +85,7 @@ void floating_point_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: floating point literal has suffix 'q', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v11 = 1.e0q; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}Q{{$}} + // CHECK-MESSAGES-NEXT: Q{{$}} // CHECK-FIXES: static constexpr auto v11 = 1.e0Q; static_assert(is_same<decltype(v11), const __float128>::value, ""); static_assert(v11 == 1., ""); @@ -106,7 +106,7 @@ void floating_point_complex_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: floating point literal has suffix 'i', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v14 = 1.i; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}I{{$}} + // CHECK-MESSAGES-NEXT: I{{$}} // CHECK-FIXES: static constexpr auto v14 = 1.I; static_assert(is_same<decltype(v14), const _Complex double>::value, ""); static_assert(v14 == 1.I, ""); @@ -115,7 +115,7 @@ void floating_point_complex_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: floating point literal has suffix 'i', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v15 = 1.e0i; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}I{{$}} + // CHECK-MESSAGES-NEXT: I{{$}} // CHECK-FIXES: static constexpr auto v15 = 1.e0I; static_assert(is_same<decltype(v15), const _Complex double>::value, ""); static_assert(v15 == 1.I, ""); @@ -134,7 +134,7 @@ void floating_point_complex_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: floating point literal has suffix 'j', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v18 = 1.j; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}J{{$}} + // CHECK-MESSAGES-NEXT: J{{$}} // CHECK-FIXES: static constexpr auto v18 = 1.J; static_assert(is_same<decltype(v18), const _Complex double>::value, ""); static_assert(v18 == 1.J, ""); @@ -143,7 +143,7 @@ void floating_point_complex_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: floating point literal has suffix 'j', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v19 = 1.e0j; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}J{{$}} + // CHECK-MESSAGES-NEXT: J{{$}} // CHECK-FIXES: static constexpr auto v19 = 1.e0J; static_assert(is_same<decltype(v19), const _Complex double>::value, ""); static_assert(v19 == 1.J, ""); @@ -163,7 +163,7 @@ void macros() { // CHECK-MESSAGES: :[[@LINE-1]]:42: warning: floating point literal has suffix 'f', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto m0 = PASSTHROUGH(1.f); // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}F{{$}} + // CHECK-MESSAGES-NEXT: F{{$}} // CHECK-FIXES: static constexpr auto m0 = PASSTHROUGH(1.F); static_assert(is_same<decltype(m0), const float>::value, ""); static_assert(m0 == 1.0F, ""); diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-hexadecimal-floating-point.cpp b/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-hexadecimal-floating-point.cpp index 57d24fb..7207715 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-hexadecimal-floating-point.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-hexadecimal-floating-point.cpp @@ -16,7 +16,7 @@ void floating_point_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: floating point literal has suffix 'f', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v1 = 0xfp0f; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}F{{$}} + // CHECK-MESSAGES-NEXT: F{{$}} // CHECK-FIXES: static constexpr auto v1 = 0xfp0F; static_assert(is_same<decltype(v1), const float>::value, ""); static_assert(v1 == 15, ""); @@ -29,7 +29,7 @@ void floating_point_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: floating point literal has suffix 'f', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v3 = 0xfP0f; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}F{{$}} + // CHECK-MESSAGES-NEXT: F{{$}} // CHECK-FIXES: static constexpr auto v3 = 0xfP0F; static_assert(is_same<decltype(v3), const float>::value, ""); static_assert(v3 == 15, ""); @@ -42,7 +42,7 @@ void floating_point_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: floating point literal has suffix 'f', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v5 = 0xFP0f; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}F{{$}} + // CHECK-MESSAGES-NEXT: F{{$}} // CHECK-FIXES: static constexpr auto v5 = 0xFP0F; static_assert(is_same<decltype(v5), const float>::value, ""); static_assert(v5 == 15, ""); @@ -55,7 +55,7 @@ void floating_point_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: floating point literal has suffix 'f', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v7 = 0xFp0f; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}F{{$}} + // CHECK-MESSAGES-NEXT: F{{$}} // CHECK-FIXES: static constexpr auto v7 = 0xFp0F; static_assert(is_same<decltype(v7), const float>::value, ""); static_assert(v7 == 15, ""); @@ -70,7 +70,7 @@ void floating_point_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: floating point literal has suffix 'l', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v9 = 0xfp0l; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}L{{$}} + // CHECK-MESSAGES-NEXT: L{{$}} // CHECK-FIXES: static constexpr auto v9 = 0xfp0L; static_assert(is_same<decltype(v9), const long double>::value, ""); static_assert(v9 == 0xfp0, ""); @@ -85,7 +85,7 @@ void floating_point_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: floating point literal has suffix 'q', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v11 = 0xfp0q; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}Q{{$}} + // CHECK-MESSAGES-NEXT: Q{{$}} // CHECK-FIXES: static constexpr auto v11 = 0xfp0Q; static_assert(is_same<decltype(v11), const __float128>::value, ""); static_assert(v11 == 0xfp0, ""); @@ -102,7 +102,7 @@ void floating_point_complex_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: floating point literal has suffix 'i', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v14 = 0xfp0i; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}I{{$}} + // CHECK-MESSAGES-NEXT: I{{$}} // CHECK-FIXES: static constexpr auto v14 = 0xfp0I; static_assert(is_same<decltype(v14), const _Complex double>::value, ""); static_assert(v14 == 0xfp0I, ""); @@ -117,7 +117,7 @@ void floating_point_complex_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: floating point literal has suffix 'j', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v18 = 0xfp0j; // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}J{{$}} + // CHECK-MESSAGES-NEXT: J{{$}} // CHECK-FIXES: static constexpr auto v18 = 0xfp0J; static_assert(is_same<decltype(v18), const _Complex double>::value, ""); static_assert(v18 == 0xfp0J, ""); @@ -133,7 +133,7 @@ void macros() { // CHECK-MESSAGES: :[[@LINE-1]]:42: warning: floating point literal has suffix 'f', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto m0 = PASSTHROUGH(0x0p0f); // CHECK-MESSAGES-NEXT: ^ ~ - // CHECK-MESSAGES-NEXT: {{^ *}}F{{$}} + // CHECK-MESSAGES-NEXT: F{{$}} // CHECK-FIXES: static constexpr auto m0 = PASSTHROUGH(0x0p0F); static_assert(is_same<decltype(m0), const float>::value, ""); static_assert(m0 == 0x0p0F, ""); diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-integer-custom-list.cpp b/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-integer-custom-list.cpp index c787cab..5ee0952 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-integer-custom-list.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-integer-custom-list.cpp @@ -22,7 +22,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: integer literal has suffix 'l', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v5 = 1l; // CHECK-MESSAGES-NEXT: ^~ - // CHECK-MESSAGES-NEXT: {{^ *}}L{{$}} + // CHECK-MESSAGES-NEXT: L{{$}} // CHECK-FIXES: static constexpr auto v5 = 1L; static_assert(is_same<decltype(v5), const long>::value, ""); static_assert(v5 == 1, ""); @@ -47,7 +47,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: integer literal has suffix 'ul', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v9 = 1ul; // CHECK-MESSAGES-NEXT: ^~~ - // CHECK-MESSAGES-NEXT: {{^ *}}uL{{$}} + // CHECK-MESSAGES-NEXT: uL{{$}} // CHECK-FIXES: static constexpr auto v9 = 1uL; static_assert(is_same<decltype(v9), const unsigned long>::value, ""); static_assert(v9 == 1, ""); @@ -60,7 +60,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'Ul', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v11 = 1Ul; // CHECK-MESSAGES-NEXT: ^~~ - // CHECK-MESSAGES-NEXT: {{^ *}}uL{{$}} + // CHECK-MESSAGES-NEXT: uL{{$}} // CHECK-FIXES: static constexpr auto v11 = 1uL; static_assert(is_same<decltype(v11), const unsigned long>::value, ""); static_assert(v11 == 1, ""); @@ -69,7 +69,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'UL', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v12 = 1UL; // CHECK-MESSAGES-NEXT: ^~~ - // CHECK-MESSAGES-NEXT: {{^ *}}uL{{$}} + // CHECK-MESSAGES-NEXT: uL{{$}} // CHECK-FIXES: static constexpr auto v12 = 1uL; static_assert(is_same<decltype(v12), const unsigned long>::value, ""); static_assert(v12 == 1, ""); diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-integer-ms.cpp b/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-integer-ms.cpp index fe3269f..7ac4a75 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-integer-ms.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-integer-ms.cpp @@ -21,7 +21,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: integer literal has suffix 'i32', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v3 = 1i32; // CHECK-MESSAGES-NEXT: ^~ - // CHECK-MESSAGES-NEXT: {{^ *}}I32{{$}} + // CHECK-MESSAGES-NEXT: I32{{$}} // CHECK-FIXES: static constexpr auto v3 = 1I32; static_assert(is_same<decltype(v3), const int>::value, ""); static_assert(v3 == 1I32, ""); @@ -36,7 +36,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: integer literal has suffix 'i64', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v5 = 1i64; // CHECK-MESSAGES-NEXT: ^~ - // CHECK-MESSAGES-NEXT: {{^ *}}I64{{$}} + // CHECK-MESSAGES-NEXT: I64{{$}} // CHECK-FIXES: static constexpr auto v5 = 1I64; static_assert(is_same<decltype(v5), const long int>::value, ""); static_assert(v5 == 1I64, ""); @@ -51,7 +51,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: integer literal has suffix 'i16', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v7 = 1i16; // CHECK-MESSAGES-NEXT: ^~ - // CHECK-MESSAGES-NEXT: {{^ *}}I16{{$}} + // CHECK-MESSAGES-NEXT: I16{{$}} // CHECK-FIXES: static constexpr auto v7 = 1I16; static_assert(is_same<decltype(v7), const short>::value, ""); static_assert(v7 == 1I16, ""); @@ -66,7 +66,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: integer literal has suffix 'i8', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v9 = 1i8; // CHECK-MESSAGES-NEXT: ^~ - // CHECK-MESSAGES-NEXT: {{^ *}}I8{{$}} + // CHECK-MESSAGES-NEXT: I8{{$}} // CHECK-FIXES: static constexpr auto v9 = 1I8; static_assert(is_same<decltype(v9), const char>::value, ""); static_assert(v9 == 1I8, ""); diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-integer.cpp b/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-integer.cpp index c03ccc23..084d9f6 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-integer.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-integer.cpp @@ -21,7 +21,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: integer literal has suffix 'u', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v3 = 1u; // CHECK-MESSAGES-NEXT: ^~ - // CHECK-MESSAGES-NEXT: {{^ *}}U{{$}} + // CHECK-MESSAGES-NEXT: U{{$}} // CHECK-FIXES: static constexpr auto v3 = 1U; static_assert(is_same<decltype(v3), const unsigned int>::value, ""); static_assert(v3 == 1, ""); @@ -36,7 +36,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: integer literal has suffix 'l', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v5 = 1l; // CHECK-MESSAGES-NEXT: ^~ - // CHECK-MESSAGES-NEXT: {{^ *}}L{{$}} + // CHECK-MESSAGES-NEXT: L{{$}} // CHECK-FIXES: static constexpr auto v5 = 1L; static_assert(is_same<decltype(v5), const long>::value, ""); static_assert(v5 == 1, ""); @@ -51,7 +51,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: integer literal has suffix 'll', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v7 = 1ll; // CHECK-MESSAGES-NEXT: ^~~ - // CHECK-MESSAGES-NEXT: {{^ *}}LL{{$}} + // CHECK-MESSAGES-NEXT: LL{{$}} // CHECK-FIXES: static constexpr auto v7 = 1LL; static_assert(is_same<decltype(v7), const long long>::value, ""); static_assert(v7 == 1, ""); @@ -66,7 +66,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: integer literal has suffix 'ul', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v9 = 1ul; // CHECK-MESSAGES-NEXT: ^~~ - // CHECK-MESSAGES-NEXT: {{^ *}}UL{{$}} + // CHECK-MESSAGES-NEXT: UL{{$}} // CHECK-FIXES: static constexpr auto v9 = 1UL; static_assert(is_same<decltype(v9), const unsigned long>::value, ""); static_assert(v9 == 1, ""); @@ -75,7 +75,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'uL', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v10 = 1uL; // CHECK-MESSAGES-NEXT: ^~~ - // CHECK-MESSAGES-NEXT: {{^ *}}UL{{$}} + // CHECK-MESSAGES-NEXT: UL{{$}} // CHECK-FIXES: static constexpr auto v10 = 1UL; static_assert(is_same<decltype(v10), const unsigned long>::value, ""); static_assert(v10 == 1, ""); @@ -84,7 +84,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'Ul', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v11 = 1Ul; // CHECK-MESSAGES-NEXT: ^~~ - // CHECK-MESSAGES-NEXT: {{^ *}}UL{{$}} + // CHECK-MESSAGES-NEXT: UL{{$}} // CHECK-FIXES: static constexpr auto v11 = 1UL; static_assert(is_same<decltype(v11), const unsigned long>::value, ""); static_assert(v11 == 1, ""); @@ -99,7 +99,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'lu', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v13 = 1lu; // CHECK-MESSAGES-NEXT: ^~~ - // CHECK-MESSAGES-NEXT: {{^ *}}LU{{$}} + // CHECK-MESSAGES-NEXT: LU{{$}} // CHECK-FIXES: static constexpr auto v13 = 1LU; static_assert(is_same<decltype(v13), const unsigned long>::value, ""); static_assert(v13 == 1, ""); @@ -108,7 +108,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'Lu', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v14 = 1Lu; // CHECK-MESSAGES-NEXT: ^~~ - // CHECK-MESSAGES-NEXT: {{^ *}}LU{{$}} + // CHECK-MESSAGES-NEXT: LU{{$}} // CHECK-FIXES: static constexpr auto v14 = 1LU; static_assert(is_same<decltype(v14), const unsigned long>::value, ""); static_assert(v14 == 1, ""); @@ -117,7 +117,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'lU', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v15 = 1lU; // CHECK-MESSAGES-NEXT: ^~~ - // CHECK-MESSAGES-NEXT: {{^ *}}LU{{$}} + // CHECK-MESSAGES-NEXT: LU{{$}} // CHECK-FIXES: static constexpr auto v15 = 1LU; static_assert(is_same<decltype(v15), const unsigned long>::value, ""); static_assert(v15 == 1, ""); @@ -132,7 +132,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'ull', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v17 = 1ull; // CHECK-MESSAGES-NEXT: ^~~~ - // CHECK-MESSAGES-NEXT: {{^ *}}ULL{{$}} + // CHECK-MESSAGES-NEXT: ULL{{$}} // CHECK-FIXES: static constexpr auto v17 = 1ULL; static_assert(is_same<decltype(v17), const unsigned long long>::value, ""); static_assert(v17 == 1, ""); @@ -141,7 +141,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'uLL', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v18 = 1uLL; // CHECK-MESSAGES-NEXT: ^~~~ - // CHECK-MESSAGES-NEXT: {{^ *}}ULL{{$}} + // CHECK-MESSAGES-NEXT: ULL{{$}} // CHECK-FIXES: static constexpr auto v18 = 1ULL; static_assert(is_same<decltype(v18), const unsigned long long>::value, ""); static_assert(v18 == 1, ""); @@ -150,7 +150,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'Ull', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v19 = 1Ull; // CHECK-MESSAGES-NEXT: ^~~~ - // CHECK-MESSAGES-NEXT: {{^ *}}ULL{{$}} + // CHECK-MESSAGES-NEXT: ULL{{$}} // CHECK-FIXES: static constexpr auto v19 = 1ULL; static_assert(is_same<decltype(v19), const unsigned long long>::value, ""); static_assert(v19 == 1, ""); @@ -165,7 +165,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'llu', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v21 = 1llu; // CHECK-MESSAGES-NEXT: ^~~~ - // CHECK-MESSAGES-NEXT: {{^ *}}LLU{{$}} + // CHECK-MESSAGES-NEXT: LLU{{$}} // CHECK-FIXES: static constexpr auto v21 = 1LLU; static_assert(is_same<decltype(v21), const unsigned long long>::value, ""); static_assert(v21 == 1, ""); @@ -174,7 +174,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'LLu', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v22 = 1LLu; // CHECK-MESSAGES-NEXT: ^~~~ - // CHECK-MESSAGES-NEXT: {{^ *}}LLU{{$}} + // CHECK-MESSAGES-NEXT: LLU{{$}} // CHECK-FIXES: static constexpr auto v22 = 1LLU; static_assert(is_same<decltype(v22), const unsigned long long>::value, ""); static_assert(v22 == 1, ""); @@ -183,7 +183,7 @@ void integer_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'llU', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v23 = 1llU; // CHECK-MESSAGES-NEXT: ^~~~ - // CHECK-MESSAGES-NEXT: {{^ *}}LLU{{$}} + // CHECK-MESSAGES-NEXT: LLU{{$}} // CHECK-FIXES: static constexpr auto v23 = 1LLU; static_assert(is_same<decltype(v23), const unsigned long long>::value, ""); static_assert(v23 == 1, ""); @@ -200,7 +200,7 @@ void integer_complex_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'i', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v25 = 1i; // CHECK-MESSAGES-NEXT: ^~ - // CHECK-MESSAGES-NEXT: {{^ *}}I{{$}} + // CHECK-MESSAGES-NEXT: I{{$}} // CHECK-FIXES: static constexpr auto v25 = 1I; static_assert(is_same<decltype(v25), const _Complex int>::value, ""); static_assert(v25 == 1I, ""); @@ -215,7 +215,7 @@ void integer_complex_suffix() { // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'j', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v27 = 1j; // CHECK-MESSAGES-NEXT: ^~ - // CHECK-MESSAGES-NEXT: {{^ *}}J{{$}} + // CHECK-MESSAGES-NEXT: J{{$}} // CHECK-FIXES: static constexpr auto v27 = 1J; static_assert(is_same<decltype(v27), const _Complex int>::value, ""); static_assert(v27 == 1J, ""); @@ -231,7 +231,7 @@ void macros() { // CHECK-MESSAGES: :[[@LINE-1]]:42: warning: integer literal has suffix 'u', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto m0 = PASSTHROUGH(1u); // CHECK-MESSAGES-NEXT: ^~ - // CHECK-MESSAGES-NEXT: {{^ *}}U{{$}} + // CHECK-MESSAGES-NEXT: U{{$}} // CHECK-FIXES: static constexpr auto m0 = PASSTHROUGH(1U); static_assert(is_same<decltype(m0), const unsigned int>::value, ""); static_assert(m0 == 1, ""); |