1 // RUN: %clang_cc1 -fsyntax-only -Wall -Wunused-macros -Wunused-parameter -Wno-uninitialized -verify %s
5 void m1() { int b
; while (b
==b
); } // expected-warning {{always evaluates to true}}
7 #pragma clang diagnostic push
8 #pragma clang diagnostic ignored "-Wtautological-compare"
9 void m2() { int b
; while (b
==b
); }
10 #pragma clang diagnostic pop
12 void m3() { int b
; while (b
==b
); } // expected-warning {{always evaluates to true}}
15 //------------------------------------------------------------------------------
17 #pragma clang diagnostic push
18 #pragma clang diagnostic ignored "-Wtautological-compare"
21 void m() { T b
; while (b
==b
); }
23 #pragma clang diagnostic pop
30 //------------------------------------------------------------------------------
32 #define UNUSED_MACRO1 // expected-warning {{macro is not used}}
34 #pragma clang diagnostic push
35 #pragma clang diagnostic ignored "-Wunused-macros"
37 #pragma clang diagnostic pop
39 //------------------------------------------------------------------------------
41 #pragma clang diagnostic push
42 #pragma clang diagnostic ignored "-Wreturn-type"
44 #pragma clang diagnostic pop
46 //------------------------------------------------------------------------------
49 #pragma clang diagnostic push
50 #pragma clang diagnostic ignored "-Wunused-parameter"
52 #pragma clang diagnostic pop
53 int y
) // expected-warning {{unused}}
57 //------------------------------------------------------------------------------
62 #pragma clang diagnostic push
63 #pragma clang diagnostic ignored "-Wreorder"
66 #pragma clang diagnostic pop
70 //------------------------------------------------------------------------------
74 _Pragma("clang diagnostic push") \
75 _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") \
76 _Pragma("clang diagnostic pop")
80 //------------------------------------------------------------------------------