Argyrios Kyrtzidis | 3efd52c | 2011-01-14 20:54:07 +0000 | [diff] [blame] | 1 | // Test this without pch. |
| 2 | // RUN: %clang_cc1 %s -include %s -verify -fsyntax-only -Wno-sign-compare -Wtautological-compare |
| 3 | |
| 4 | // Test with pch. |
| 5 | // RUN: %clang_cc1 %s -emit-pch -o %t -Wsign-compare -Wtautological-compare |
| 6 | // RUN: %clang_cc1 %s -include-pch %t -verify -fsyntax-only -Wno-sign-compare -Wtautological-compare |
| 7 | |
| 8 | // This tests that diagnostic mappings from PCH are propagated for #pragma |
| 9 | // diagnostics but not for command-line flags. |
| 10 | |
| 11 | #ifndef HEADER |
| 12 | #define HEADER |
| 13 | |
| 14 | #pragma clang diagnostic ignored "-Wtautological-compare" |
| 15 | |
| 16 | #else |
| 17 | |
| 18 | int f() { |
Chandler Carruth | a7689ef | 2011-03-27 09:46:56 +0000 | [diff] [blame] | 19 | int a; |
| 20 | int b = a==a; |
Argyrios Kyrtzidis | 3efd52c | 2011-01-14 20:54:07 +0000 | [diff] [blame] | 21 | unsigned x; |
| 22 | signed y; |
| 23 | return x == y; |
| 24 | } |
| 25 | |
| 26 | #endif |