[PATCH] D52229: [clang-tidy] use CHECK-NOTES in tests for bugprone suspicious-enum-usage

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 18 04:55:39 PDT 2018


JonasToth created this revision.
JonasToth added reviewers: alexfh, aaron.ballman, hokein.
Herald added subscribers: cfe-commits, xazax.hun.

Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D52229

Files:
  test/clang-tidy/bugprone-suspicious-enum-usage-strict.cpp
  test/clang-tidy/bugprone-suspicious-enum-usage.cpp


Index: test/clang-tidy/bugprone-suspicious-enum-usage.cpp
===================================================================
--- test/clang-tidy/bugprone-suspicious-enum-usage.cpp
+++ test/clang-tidy/bugprone-suspicious-enum-usage.cpp
@@ -54,10 +54,10 @@
   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() {
Index: test/clang-tidy/bugprone-suspicious-enum-usage-strict.cpp
===================================================================
--- test/clang-tidy/bugprone-suspicious-enum-usage-strict.cpp
+++ test/clang-tidy/bugprone-suspicious-enum-usage-strict.cpp
@@ -10,23 +10,23 @@
   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 @@
 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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52229.165941.patch
Type: text/x-patch
Size: 3367 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180918/7ed35c60/attachment.bin>


More information about the cfe-commits mailing list