[clang-tools-extra] r343201 - [clang-tidy] use CHECK-NOTES in tests for bugprone suspicious-enum-usage
Jonas Toth via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 27 05:30:44 PDT 2018
Author: jonastoth
Date: Thu Sep 27 05:30:44 2018
New Revision: 343201
URL: http://llvm.org/viewvc/llvm-project?rev=343201&view=rev
Log:
[clang-tidy] use CHECK-NOTES in tests for bugprone suspicious-enum-usage
Reviewers: alexfh, aaron.ballman, hokein
Subscribers: xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D52229
Modified:
clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-enum-usage-strict.cpp
clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-enum-usage.cpp
Modified: clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-enum-usage-strict.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-enum-usage-strict.cpp?rev=343201&r1=343200&r2=343201&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-enum-usage-strict.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-enum-usage-strict.cpp Thu Sep 27 05:30:44 2018
@@ -10,23 +10,23 @@ enum A {
G = 63
};
-// CHECK-MESSAGES: :[[@LINE+2]]:1: warning: enum type seems like a bitmask (contains mostly power-of-2 literals) but a literal is not power-of-2
-// CHECK-MESSAGES: :76:7: note: used here as a bitmask
+// CHECK-NOTES: :[[@LINE+2]]:1: warning: enum type seems like a bitmask (contains mostly power-of-2 literals) but a literal is not power-of-2
+// CHECK-NOTES: :76:7: note: used here as a bitmask
enum X {
X = 8,
Y = 16,
Z = 4,
ZZ = 3
- // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: enum type seems like a bitmask (contains mostly power-of-2 literals), but this literal is not a power-of-2 [bugprone-suspicious-enum-usage]
-// CHECK-MESSAGES: :70:13: note: used here as a bitmask
+ // CHECK-NOTES: :[[@LINE-1]]:3: warning: enum type seems like a bitmask (contains mostly power-of-2 literals), but this literal is not a power-of-2 [bugprone-suspicious-enum-usage]
+// CHECK-NOTES: :70:13: note: used here as a bitmask
};
-// CHECK-MESSAGES: :[[@LINE+2]]:1: warning: enum type seems like a bitmask (contains mostly power-of-2 literals) but some literals are not power-of-2
-// CHECK-MESSAGES: :73:8: note: used here as a bitmask
+// CHECK-NOTES: :[[@LINE+2]]:1: warning: enum type seems like a bitmask (contains mostly power-of-2 literals) but some literals are not power-of-2
+// CHECK-NOTES: :73:8: note: used here as a bitmask
enum PP {
P = 2,
Q = 3,
- // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: enum type seems like a bitmask (contains mostly power-of-2 literals), but this literal is not a power-of-2
- // CHECK-MESSAGES: :65:11: note: used here as a bitmask
+ // CHECK-NOTES: :[[@LINE-1]]:3: warning: enum type seems like a bitmask (contains mostly power-of-2 literals), but this literal is not a power-of-2
+ // CHECK-NOTES: :65:11: note: used here as a bitmask
R = 4,
S = 8,
T = 16,
@@ -58,10 +58,10 @@ Days bestDay() {
int trigger() {
if (bestDay() | A)
return 1;
- // CHECK-MESSAGES: :[[@LINE-2]]:17: warning: enum values are from different enum types
+ // CHECK-NOTES: :[[@LINE-2]]:17: warning: enum values are from different enum types
if (I | Y)
return 1;
- // CHECK-MESSAGES: :[[@LINE-2]]:9: warning: enum values are from different enum types
+ // CHECK-NOTES: :[[@LINE-2]]:9: warning: enum values are from different enum types
if (P + Q == R)
return 1;
else if ((S | R) == T)
Modified: clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-enum-usage.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-enum-usage.cpp?rev=343201&r1=343200&r2=343201&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-enum-usage.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-suspicious-enum-usage.cpp Thu Sep 27 05:30:44 2018
@@ -54,10 +54,10 @@ int trigger() {
int emptytest = EmptyVal | B;
if (bestDay() | A)
return 1;
- // CHECK-MESSAGES: :[[@LINE-2]]:17: warning: enum values are from different enum types
+ // CHECK-NOTES: :[[@LINE-2]]:17: warning: enum values are from different enum types
if (I | Y)
return 1;
- // CHECK-MESSAGES: :[[@LINE-2]]:9: warning: enum values are from different enum types
+ // CHECK-NOTES: :[[@LINE-2]]:9: warning: enum values are from different enum types
}
int dont_trigger() {
More information about the cfe-commits
mailing list