blob: 7639f1f0db6598f08ffddf77fdf3f4dfd2960bcc [file] [log] [blame]
Argyrios Kyrtzidis3efd52c2011-01-14 20:54:07 +00001// 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
Andy Gibbs8e8fb3b2012-10-19 12:44:48 +00008// expected-no-diagnostics
9
Argyrios Kyrtzidis3efd52c2011-01-14 20:54:07 +000010// This tests that diagnostic mappings from PCH are propagated for #pragma
11// diagnostics but not for command-line flags.
12
13#ifndef HEADER
14#define HEADER
15
16#pragma clang diagnostic ignored "-Wtautological-compare"
17
18#else
19
20int f() {
Chandler Carrutha7689ef2011-03-27 09:46:56 +000021 int a;
22 int b = a==a;
Argyrios Kyrtzidis3efd52c2011-01-14 20:54:07 +000023 unsigned x;
24 signed y;
25 return x == y;
26}
27
28#endif