1 // RUN: %clang_cc1 -fsyntax-only -Wall -Wunused-macros -Wunused-parameter -Wno-uninitialized -verify %s
4 void m1() { int b
; while (b
==b
); } // expected-warning {{always evaluates to true}}
6 #pragma clang diagnostic push
7 #pragma clang diagnostic ignored "-Wtautological-compare"
8 void m2() { int b
; while (b
==b
); }
9 #pragma clang diagnostic pop
11 void m3() { int b
; while (b
==b
); } // expected-warning {{always evaluates to true}}
14 //------------------------------------------------------------------------------
16 #pragma clang diagnostic push
17 #pragma clang diagnostic ignored "-Wtautological-compare"
20 void m() { T b
; while (b
==b
); }
22 #pragma clang diagnostic pop
29 //------------------------------------------------------------------------------
31 #define UNUSED_MACRO1 // expected-warning {{macro is not used}}
33 #pragma clang diagnostic push
34 #pragma clang diagnostic ignored "-Wunused-macros"
36 #pragma clang diagnostic pop
38 //------------------------------------------------------------------------------
40 #pragma clang diagnostic push
41 #pragma clang diagnostic ignored "-Wreturn-type"
43 #pragma clang diagnostic pop
45 //------------------------------------------------------------------------------
48 #pragma clang diagnostic push
49 #pragma clang diagnostic ignored "-Wunused-parameter"
51 #pragma clang diagnostic pop
52 int y
) // expected-warning {{unused}}
56 //------------------------------------------------------------------------------
61 #pragma clang diagnostic push
62 #pragma clang diagnostic ignored "-Wreorder"
65 #pragma clang diagnostic pop
69 //------------------------------------------------------------------------------
72 _Pragma("clang diagnostic push") \
73 _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") \
74 _Pragma("clang diagnostic pop")
78 //------------------------------------------------------------------------------