================
@@ -0,0 +1,87 @@
+// RUN: %check_clang_tidy %s bugprone-macro-condition %t
+
+#define USE_FOO 0
+// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: Macro 'USE_FOO' defined here with 
a value and checked for definition
+
+#if defined(USE_FOO)
+// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: Macro 'USE_FOO' defined with a 
value and checked here for definition
+void f()
+{
+  extern void foo();
+  foo();
+}
+#endif
+
+#if 0
+#elif OTHER_MACRO
+// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: Undefined macro 'OTHER_MACRO' 
checked here for value
----------------
LegalizeAdulthood wrote:

I've added `-U` and `-D` test cases.

https://github.com/llvm/llvm-project/pull/210768
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to